akregator/src

akregator_view.h

00001 /*
00002     This file is part of Akregator.
00003 
00004     Copyright (C) 2004 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net>
00005                   2004 Sashmit Bhaduri <smt@vfemail.net>
00006                   2005 Frank Osterfeld <frank.osterfeld at kdemail.net>
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00021 
00022     As a special exception, permission is given to link this program
00023     with any edition of Qt, and distribute the resulting executable,
00024     without including the source code for Qt in the source distribution.
00025 */
00026 
00027 #ifndef _AKREGATORVIEW_H_
00028 #define _AKREGATORVIEW_H_
00029 
00030 #include <tqpixmap.h>
00031 #include <tqwidget.h>
00032 
00033 #include <kurl.h>
00034 
00035 #include "akregator_run.h"
00036 #include "feed.h"
00037 
00038 class TQSplitter;
00039 class TQDomDocument;
00040 class TQDomElement;
00041 class TQHBox;
00042 class TQToolButton;
00043 class TQListViewItem;
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, TQWidget *parent, ActionManagerImpl* actionManager, const char* name);
00092 
00095             ~View();
00096 
00098             void saveSettings();
00099 
00100             void slotSettingsChanged();
00101 
00104             bool importFeeds(const TQDomDocument& doc);
00105 
00110             bool loadFeeds(const TQDomDocument& doc, Folder* parent = 0);
00111 
00115              TQDomDocument feedListToOPML();
00116 
00123             void addFeedToGroup(const TQString& url, const TQString& 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 TQString&);
00136             void setStatusBarText(const TQString&);
00137             void setProgress(int);
00138             void signalStarted(KIO::Job*);
00139             void signalCompleted();
00140             void signalCanceled(const TQString&);
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 TQPoint&);
00154 
00156             void slotSetTotalUnread();
00157 
00159             void slotMouseButtonPressed(int button, const Article& article, const TQPoint & pos, int c);
00160 
00162             void slotOpenArticleExternal(const Article& article, const TQPoint&, 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 TQString &);
00190 
00192             void slotFeedURLDropped (KURL::List &urls, TreeNode* after, Folder *parent);
00193 
00195             void slotMouseOverInfo(const KFileItem *kifi);
00196 
00198             void slotStatusText(const TQString &);
00199 
00200             void slotStarted();
00201             void slotCanceled(const TQString &);
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             //void slotRemoveTag(const Tag& tag);
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 TQString& 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 TQPixmap&);
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:         // compat with KDE-3.x assertions, remove for KDE 4
00299 //         private:
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             TQWidget *m_mainTab;
00312             Frame *m_mainFrame;
00313             Frame *m_currentFrame;
00314 
00315             SearchBar* m_searchBar;
00316 
00317             TQSplitter *m_articleSplitter;
00318             TQSplitter *m_horizontalSplitter;
00319        
00320             ListTabWidget* m_listTabWidget;
00321             Akregator::Part *m_part;
00322             ViewMode m_viewMode;
00323 
00324             TQTimer *m_fetchTimer;
00325             TQTimer* m_expiryTimer;
00326             TQTimer *m_markReadTimer;
00327 
00328             bool m_shuttingDown;
00329             bool m_displayingAboutPage;
00330 
00331             ActionManagerImpl* m_actionManager;
00332 
00333             TQPixmap 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_