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
00285 void delayedInit();
00286
00287 void connectFrame(Frame *);
00288
00289 void setTabIcon(const QPixmap&);
00290
00291 void slotDoIntervalFetches();
00292 void slotDeleteExpiredArticles();
00293
00295 void slotOpenURLReply(const KURL& url, Akregator::Viewer* currentViewer, Akregator::BrowserRun::OpeningMode mode);
00296
00298 void slotUrlClickedInViewer(const KURL& url, Viewer* viewer, bool newTab, bool background);
00299
00300 void slotOpenURL(const KURL& url, Akregator::Viewer* currentViewer, Akregator::BrowserRun::OpeningMode mode);
00301
00302 public:
00303
00304
00305 enum ViewMode { NormalView=0, WidescreenView, CombinedView };
00306
00307 FeedList* m_feedList;
00308 TagNodeList* m_tagNodeList;
00309 NodeListView* m_feedListView;
00310 NodeListView* m_tagNodeListView;
00311 ArticleListView *m_articleList;
00312 ArticleViewer *m_articleViewer;
00313 TabWidget *m_tabs;
00314
00315 QWidget *m_mainTab;
00316 Frame *m_mainFrame;
00317 Frame *m_currentFrame;
00318
00319 SearchBar* m_searchBar;
00320
00321 QSplitter *m_articleSplitter;
00322 QSplitter *m_horizontalSplitter;
00323
00324 ListTabWidget* m_listTabWidget;
00325 Akregator::Part *m_part;
00326 ViewMode m_viewMode;
00327
00328 QTimer *m_fetchTimer;
00329 QTimer* m_expiryTimer;
00330 QTimer *m_markReadTimer;
00331
00332 bool m_shuttingDown;
00333 bool m_displayingAboutPage;
00334
00335 ActionManagerImpl* m_actionManager;
00336
00337 QPixmap m_keepFlagIcon;
00338 friend class EditNodePropertiesVisitor;
00339 class EditNodePropertiesVisitor;
00340 EditNodePropertiesVisitor* m_editNodePropertiesVisitor;
00341 friend class DeleteNodeVisitor;
00342 class DeleteNodeVisitor;
00343 DeleteNodeVisitor* m_deleteNodeVisitor;
00344 };
00345 }
00346
00347 #endif // _AKREGATORVIEW_H_
|