00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ARTICLEVIEWER_H
00027 #define ARTICLEVIEWER_H
00028
00029 #include <tdelocale.h>
00030
00031 #include <tqcolor.h>
00032 #include <tqfont.h>
00033
00034 #include "article.h"
00035 #include "articlefilter.h"
00036 #include "viewer.h"
00037
00038 class TQKeyEvent;
00039
00040 namespace Akregator
00041 {
00042 class Feed;
00043 class Folder;
00044 class TreeNode;
00045
00048 class ArticleViewer : public Viewer
00049 {
00050 Q_OBJECT
00051
00052 public:
00054 ArticleViewer(TQWidget* parent, const char* name);
00055 virtual ~ArticleViewer();
00056
00057 virtual bool openURL(const KURL &url);
00058
00060 void reload();
00061
00062 void displayAboutPage();
00063
00064 public slots:
00065
00066
00067
00068
00071 void slotShowArticle(const Article& article);
00072
00075 void slotShowNode(TreeNode* node);
00076
00080 void slotSetFilter(const Akregator::Filters::ArticleMatcher& textFilter, const Akregator::Filters::ArticleMatcher& statusFilter);
00081
00083 void slotUpdateCombinedView();
00084
00086 void slotClear();
00087
00088 void slotShowSummary(TreeNode *node);
00089
00090 virtual void slotPaletteOrFontChanged();
00091
00092 protected slots:
00093
00094 void slotArticlesUpdated(TreeNode* node, const TQValueList<Article>& list);
00095 void slotArticlesAdded(TreeNode* node, const TQValueList<Article>& list);
00096 void slotArticlesRemoved(TreeNode* node, const TQValueList<Article>& list);
00097
00098 protected:
00099
00100 virtual void keyPressEvent(TQKeyEvent* e);
00101 virtual void urlSelected (const TQString &url, int button, int state, const TQString &_target, KParts::URLArgs args);
00102
00103 public:
00104
00105
00106 friend class ShowNodeSummaryVisitor;
00107 class ShowSummaryVisitor;
00108 ShowSummaryVisitor* m_showSummaryVisitor;
00109
00112 void renderContent(const TQString& body);
00113
00118 TQString formatArticleNormalMode(Feed* feed, const Article& article);
00119
00124 TQString formatArticleCombinedMode(Feed* feed, const Article& article);
00125
00128 void beginWriting();
00129
00131 void endWriting();
00132
00134 void generateNormalModeCSS();
00136 void generateCombinedModeCSS();
00137 void connectToNode(TreeNode* node);
00138 void disconnectFromNode(TreeNode* node);
00139
00140 TQString m_normalModeCSS;
00141 TQString m_combinedModeCSS;
00142 TQString m_htmlFooter;
00143 TQString m_currentText;
00144 KURL m_imageDir;
00145 TreeNode* m_node;
00146 Article m_article;
00147 KURL m_link;
00148 Akregator::Filters::ArticleMatcher m_textFilter;
00149 Akregator::Filters::ArticleMatcher m_statusFilter;
00150 enum ViewMode { NormalView, CombinedView, SummaryView };
00151 ViewMode m_viewMode;
00152 };
00153 }
00154
00155 #endif // ARTICLEVIEWER_H