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 QDomDocument;
00038 class QTimer;
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
00064 public:
00065 BrowserExtension(Part *p, const char *name );
00066 public slots:
00067 void saveSettings();
00068 private:
00069 Part *m_part;
00070 };
00071
00076 class Part : public MyBasePart, virtual public AkregatorPartIface
00077 {
00078 Q_OBJECT
00079 public:
00080 typedef MyBasePart inherited;
00081
00083 Part(QWidget *parentWidget, const char *widgetName,
00084 QObject *parent, const char *name, const QStringList&);
00085
00087 virtual ~Part();
00088
00090 static KAboutData *createAboutData();
00091
00096 virtual bool openURL(const KURL& url);
00097
00099 virtual void openStandardFeedList();
00100
00101 virtual void fetchFeedUrl(const QString&);
00102
00104 virtual void fetchAllFeeds();
00105
00113 virtual void addFeedsToGroup(const QStringList& urls, const QString& group);
00114
00115 virtual void addFeed();
00116
00123 virtual void readProperties(KConfig* config);
00124
00128 virtual void saveProperties(KConfig* config);
00129
00132 virtual bool mergePart(KParts::Part*);
00133
00134 void loadTagSet(const QString& path);
00135 void saveTagSet(const QString& path);
00136
00137 public slots:
00139 virtual void saveSettings();
00140
00142 void slotSaveFeedList();
00143
00144 void fileImport();
00145 void fileExport();
00146 void fileGetFeeds();
00147
00148 void fileSendLink() { fileSendArticle(); }
00149 void fileSendFile() { fileSendArticle(true); }
00150 void fileSendArticle(bool attach=false);
00151
00153 void showOptions();
00154 void showKNotifyOptions();
00155
00156 signals:
00157 void showPart();
00158 void signalSettingsChanged();
00159
00160
00161 protected:
00162
00164 virtual bool isTrayIconEnabled() const;
00165
00167 void loadPlugins();
00168
00170 virtual bool openFile();
00171
00172 void importFile(const KURL& url);
00173 void exportFile(const KURL& url);
00174
00176 QWidget* getMainWindow();
00177
00178 virtual KParts::Part *hitTest(QWidget *widget, const QPoint &globalPos);
00179
00181 virtual void partActivateEvent(KParts::PartActivateEvent* event);
00182
00183 protected slots:
00184 void slotOnShutdown();
00185 void slotSettingsChanged();
00186
00187 private:
00188
00189 bool copyFile(const QString& backup);
00190
00192 void initFonts();
00193
00195 static QDomDocument createDefaultFeedList();
00196
00197 bool tryToLock(const QString& backendName);
00198
00199 private:
00200
00201 class ApplyFiltersInterceptor;
00202 ApplyFiltersInterceptor* m_applyFiltersInterceptor;
00203 QString m_standardFeedList;
00204 QString m_tagSetPath;
00205 bool m_standardListLoaded;
00206 bool m_shuttingDown;
00207
00208 KParts::BrowserExtension *m_extension;
00209 KParts::Part* m_mergedPart;
00210 View* m_view;
00211
00212 QTimer* m_autosaveTimer;
00214 bool m_backedUpList;
00215 Backend::Storage* m_storage;
00216 ActionManagerImpl* m_actionManager;
00217 };
00218 }
00219
00220 #endif // _AKREGATORPART_H_
00221
00222
|