akregator/src
akregator_part.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 #ifndef _AKREGATORPART_H_
00027 #define _AKREGATORPART_H_
00028
00029 #include <kparts/browserextension.h>
00030 #include <kparts/part.h>
00031 #include <kurl.h>
00032
00033 #include "config.h"
00034
00035 #include "akregator_partiface.h"
00036
00037 class TQDomDocument;
00038 class TQTimer;
00039
00040 class KAboutData;
00041 class KConfig;
00042 class KURL;
00043
00044 namespace Akregator
00045 {
00046 namespace Backend
00047 {
00048 class Storage;
00049 }
00050
00051 typedef KParts::ReadOnlyPart MyBasePart;
00052
00053 class ActionManagerImpl;
00054 class View;
00055 class Part;
00056 class Feed;
00057 class Article;
00058 class TrayIcon;
00059
00060 class BrowserExtension : public KParts::BrowserExtension
00061 {
00062 Q_OBJECT
00063 TQ_OBJECT
00064
00065 public:
00066 BrowserExtension(Part *p, const char *name );
00067 public slots:
00068 void saveSettings();
00069 private:
00070 Part *m_part;
00071 };
00072
00077 class Part : public MyBasePart, virtual public AkregatorPartIface
00078 {
00079 Q_OBJECT
00080 TQ_OBJECT
00081 public:
00082 typedef MyBasePart inherited;
00083
00085 Part(TQWidget *parentWidget, const char *widgetName,
00086 TQObject *parent, const char *name, const TQStringList&);
00087
00089 virtual ~Part();
00090
00092 static KAboutData *createAboutData();
00093
00098 virtual bool openURL(const KURL& url);
00099
00101 virtual void openStandardFeedList();
00102
00103 virtual void fetchFeedUrl(const TQString&);
00104
00106 virtual void fetchAllFeeds();
00107
00115 virtual void addFeedsToGroup(const TQStringList& urls, const TQString& group);
00116
00117 virtual void addFeed();
00118
00125 virtual void readProperties(KConfig* config);
00126
00130 virtual void saveProperties(KConfig* config);
00131
00134 virtual bool mergePart(KParts::Part*);
00135
00136 void loadTagSet(const TQString& path);
00137 void saveTagSet(const TQString& path);
00138
00139 public slots:
00141 virtual void saveSettings();
00142
00144 void slotSaveFeedList();
00145
00146 void fileImport();
00147 void fileExport();
00148 void fileGetFeeds();
00149
00150 void fileSendLink() { fileSendArticle(); }
00151 void fileSendFile() { fileSendArticle(true); }
00152 void fileSendArticle(bool attach=false);
00153
00155 void showOptions();
00156 void showKNotifyOptions();
00157
00158 signals:
00159 void showPart();
00160 void signalSettingsChanged();
00161
00162
00163 protected:
00164
00166 virtual bool isTrayIconEnabled() const;
00167
00169 void loadPlugins();
00170
00172 virtual bool openFile();
00173
00174 void importFile(const KURL& url);
00175 void exportFile(const KURL& url);
00176
00178 TQWidget* getMainWindow();
00179
00180 virtual KParts::Part *hitTest(TQWidget *widget, const TQPoint &globalPos);
00181
00183 virtual void partActivateEvent(KParts::PartActivateEvent* event);
00184
00185 protected slots:
00186 void slotOnShutdown();
00187 void slotSettingsChanged();
00188
00189 private:
00190
00191 bool copyFile(const TQString& backup);
00192
00194 void initFonts();
00195
00197 static TQDomDocument createDefaultFeedList();
00198
00199 bool tryToLock(const TQString& backendName);
00200
00201 private:
00202
00203 class ApplyFiltersInterceptor;
00204 ApplyFiltersInterceptor* m_applyFiltersInterceptor;
00205 TQString m_standardFeedList;
00206 TQString m_tagSetPath;
00207 bool m_standardListLoaded;
00208 bool m_shuttingDown;
00209
00210 KParts::BrowserExtension *m_extension;
00211 KParts::Part* m_mergedPart;
00212 View* m_view;
00213
00214 TQTimer* m_autosaveTimer;
00216 bool m_backedUpList;
00217 Backend::Storage* m_storage;
00218 ActionManagerImpl* m_actionManager;
00219 };
00220 }
00221
00222 #endif // _AKREGATORPART_H_
00223
00224
|