akregator/src
akregator_view.h00001
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
00027 #ifndef _AKREGATORVIEW_H_
00028 #define _AKREGATORVIEW_H_
00029
00030 #include <qpixmap.h>
00031 #include <qwidget.h>
00032
00033 #include <kurl.h>
00034
00035 #include "akregator_run.h"
00036 #include "feed.h"
00037
00038 class QSplitter;
00039 class QDomDocument;
00040 class QDomElement;
00041 class QHBox;
00042 class QToolButton;
00043 class QListViewItem;
00044 class KComboBox;
00045 class KConfig;
00046 class KFileItem;
00047 class KLineEdit;
00048 class KListView;
00049 class KListViewItem;
00050 class KTabWidget;
00051 class Viewer;
00052
00053 namespace KIO {
00054
00055 class Job;
00056 }
00057
00058 namespace Akregator {
00059
00060 class AboutPageViewer;
00061 class ActionManagerImpl;
00062 class ArticleMatcher;
00063 class ArticleListView;
00064 class ArticleViewer;
00065 class BrowserRun;
00066 class Folder;
00067 class FeedList;
00068 class Frame;
00069 class NodeListView;
00070 class ListTabWidget;
00071 class Part;
00072 class SearchBar;
00073 class TabWidget;
00074 class Tag;
00075 class TagNodeList;
00076
00080 class View : public QWidget
00081 {
00082 Q_OBJECT
00083 public:
00084
00091 View(Akregator::Part *part, QWidget *parent, ActionManagerImpl* actionManager, const char* name);
00092
00095 ~View();
00096
00098 void saveSettings();
00099
00100 void slotSettingsChanged();
00101
00104 bool importFeeds(const QDomDocument& doc);
00105
00110 bool loadFeeds(const QDomDocument& doc, Folder* parent = 0);
00111
00115 QDomDocument feedListToOPML();
00116
00123 void addFeedToGroup(const QString& url, const QString& group);
00124
00126 virtual void readProperties(KConfig* config);
00127 virtual void saveProperties(KConfig* config);
00128
00129 Frame* currentFrame() const { return m_currentFrame; }
00130
00131 signals:
00133 void signalUnreadCountChanged(int);
00134
00135 void setWindowCaption(const QString&);
00136 void setStatusBarText(const QString&);
00137 void setProgress(int);
00138 void signalStarted(KIO::Job*);
00139 void signalCompleted();
00140 void signalCanceled(const QString&);
00141
00142 public slots:
00143
00144 void slotOnShutdown();
00145
00147 void slotNodeSelected(TreeNode* node);
00148
00150 void slotArticleSelected(const Article&);
00151
00153 void slotFeedTreeContextMenu(KListView*, TreeNode*, const QPoint&);
00154
00156 void slotSetTotalUnread();
00157
00159 void slotMouseButtonPressed(int button, const Article& article, const QPoint & pos, int c);
00160
00162 void slotOpenArticleExternal(const Article& article, const QPoint&, int);
00163
00166 void slotOpenCurrentArticleExternal();
00167
00170 void slotOpenCurrentArticleBackgroundTab();
00171
00173 void slotOpenCurrentArticle();
00174
00177 void slotCopyLinkAddress();
00178
00182 void slotOpenNewTab(const KURL& url, bool background = false);
00183
00186 void slotFrameChanged(Frame *f);
00187
00189 void slotCaptionChanged(const QString &);
00190
00192 void slotFeedURLDropped (KURL::List &urls, TreeNode* after, Folder *parent);
00193
00195 void slotMouseOverInfo(const KFileItem *kifi);
00196
00198 void slotStatusText(const QString &);
00199
00200 void slotStarted();
00201 void slotCanceled(const QString &);
00202 void slotCompleted();
00203 void slotLoadingProgress(int);
00204
00205 void slotFetchingStarted();
00206 void slotFetchingStopped();
00207
00208
00210 void slotFeedFetched(Feed *);
00211
00213 void slotFeedAdd();
00215 void slotFeedAddGroup();
00217 void slotFeedRemove();
00219 void slotFeedModify();
00221 void slotFetchCurrentFeed();
00223 void slotFetchAllFeeds();
00225 void slotMarkAllRead();
00227 void slotMarkAllFeedsRead();
00229 void slotOpenHomepage();
00230
00232 void slotArticleToggleKeepFlag(bool enabled);
00234 void slotArticleDelete();
00236 void slotSetSelectedArticleRead();
00238 void slotSetSelectedArticleUnread();
00240 void slotSetSelectedArticleNew();
00242 void slotSetCurrentArticleReadDelayed();
00243
00245 void slotTextToSpeechRequest();
00246
00247 void slotAssignTag(const Tag& tag, bool assign);
00248
00249 void slotNewTag();
00250 void slotTagCreated(const Tag& tag);
00251 void slotTagRemoved(const Tag& tag);
00252
00254 void slotNormalView();
00256 void slotWidescreenView();
00258 void slotCombinedView();
00260 void slotToggleShowQuickFilter();
00261
00263 void slotPrevUnreadArticle();
00265 void slotNextUnreadArticle();
00266
00267 void slotMoveCurrentNodeUp();
00268 void slotMoveCurrentNodeDown();
00269 void slotMoveCurrentNodeLeft();
00270 void slotMoveCurrentNodeRight();
00271
00272 protected:
00273
00274 void addFeed(const QString& url, TreeNode* after, Folder* parent, bool autoExec = true);
00275
00276 void connectToFeedList(FeedList* feedList);
00277 void disconnectFromFeedList(FeedList* feedList);
00278
00279 void updateTagActions();
00280
00281 protected slots:
00282
00283 void connectFrame(Frame *);
00284
00285 void setTabIcon(const QPixmap&);
00286
00287 void slotDoIntervalFetches();
00288 void slotDeleteExpiredArticles();
00289
00291 void slotOpenURLReply(const KURL& url, Akregator::Viewer* currentViewer, Akregator::BrowserRun::OpeningMode mode);
00292
00294 void slotUrlClickedInViewer(const KURL& url, Viewer* viewer, bool newTab, bool background);
00295
00296 void slotOpenURL(const KURL& url, Akregator::Viewer* currentViewer, Akregator::BrowserRun::OpeningMode mode);
00297
00298 public:
00299
00300
00301 enum ViewMode { NormalView=0, WidescreenView, CombinedView };
00302
00303 FeedList* m_feedList;
00304 TagNodeList* m_tagNodeList;
00305 NodeListView* m_feedListView;
00306 NodeListView* m_tagNodeListView;
00307 ArticleListView *m_articleList;
00308 ArticleViewer *m_articleViewer;
00309 TabWidget *m_tabs;
00310
00311 QWidget *m_mainTab;
00312 Frame *m_mainFrame;
00313 Frame *m_currentFrame;
00314
00315 SearchBar* m_searchBar;
00316
00317 QSplitter *m_articleSplitter;
00318 QSplitter *m_horizontalSplitter;
00319
00320 ListTabWidget* m_listTabWidget;
00321 Akregator::Part *m_part;
00322 ViewMode m_viewMode;
00323
00324 QTimer *m_fetchTimer;
00325 QTimer* m_expiryTimer;
00326 QTimer *m_markReadTimer;
00327
00328 bool m_shuttingDown;
00329 bool m_displayingAboutPage;
00330
00331 ActionManagerImpl* m_actionManager;
00332
00333 QPixmap m_keepFlagIcon;
00334 friend class EditNodePropertiesVisitor;
00335 class EditNodePropertiesVisitor;
00336 EditNodePropertiesVisitor* m_editNodePropertiesVisitor;
00337 friend class DeleteNodeVisitor;
00338 class DeleteNodeVisitor;
00339 DeleteNodeVisitor* m_deleteNodeVisitor;
00340 };
00341 }
00342
00343 #endif // _AKREGATORVIEW_H_
|