akregator
akregator_part.h
Go to the documentation of this file.00001
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 AKREGATOR_PART_H
00027 #define AKREGATOR_PART_H
00028
00029 #include <kurl.h>
00030 #include <kparts/browserextension.h>
00031 #include <kparts/part.h>
00032
00033 class KConfigGroup;
00034 class KUrl;
00035 class KCMultiDialog;
00036
00037 class QDomDocument;
00038 class QTimer;
00039
00040 namespace Akregator {
00041
00042 namespace Backend
00043 {
00044 class Storage;
00045 }
00046
00047 typedef KParts::ReadOnlyPart MyBasePart;
00048
00049 class ActionManagerImpl;
00050 class Feed;
00051 class MainWidget;
00052 class Part;
00053 class TrayIcon;
00054
00055 class BrowserExtension : public KParts::BrowserExtension
00056 {
00057 Q_OBJECT
00058
00059 public:
00060 explicit BrowserExtension(Part *p, const char *name=0);
00061 public slots:
00062 void saveSettings();
00063 private:
00064 Part *m_part;
00065 };
00066
00071 class Part : public MyBasePart
00072 {
00073 Q_OBJECT
00074 public:
00075 typedef MyBasePart inherited;
00076
00078 Part(QWidget *parentWidget, QObject *parent, const QVariantList&);
00079
00081 ~Part();
00082
00087 bool openUrl(const KUrl& url);
00088
00090 void openStandardFeedList();
00091
00092 void fetchFeedUrl(const QString&);
00093
00095 void fetchAllFeeds();
00096
00104 void addFeedsToGroup(const QStringList& urls, const QString& group);
00105
00106 void addFeed();
00107
00114 virtual void readProperties(const KConfigGroup & config);
00115
00119 virtual void saveProperties(KConfigGroup & config);
00120
00123 bool mergePart(KParts::Part*);
00124
00125 void exportFile(const KUrl& url);
00126
00127 public slots:
00129 void saveSettings();
00130
00132 void slotSaveFeedList();
00133
00134 void fileImport();
00135 void fileExport();
00136
00138 void showOptions();
00139 void showKNotifyOptions();
00140
00141 signals:
00142 void showPart();
00143 void signalSettingsChanged();
00144
00145
00146 private:
00147
00149 bool isTrayIconEnabled() const;
00150
00152 void loadStoragePlugins();
00153
00155 bool openFile();
00156
00157 void importFile(const KUrl& url);
00158
00160 QWidget* getMainWindow();
00161
00162 KParts::Part *hitTest(QWidget *widget, const QPoint &globalPos);
00163
00165 void partActivateEvent(KParts::PartActivateEvent* event);
00166
00167 private slots:
00168 void slotStarted();
00169
00170 void slotOnShutdown();
00171 void slotSettingsChanged();
00172
00173 private:
00174
00175 bool copyFile(const QString& backup);
00176
00178 void initFonts();
00179
00181 static QDomDocument createDefaultFeedList();
00182
00183 private:
00184
00185 class ApplyFiltersInterceptor;
00186 ApplyFiltersInterceptor* m_applyFiltersInterceptor;
00187 QString m_standardFeedList;
00188 bool m_standardListLoaded;
00189 bool m_shuttingDown;
00190
00191 KParts::BrowserExtension *m_extension;
00192 KParts::Part* m_mergedPart;
00193
00194 QTimer* m_autosaveTimer;
00196 bool m_backedUpList;
00197 MainWidget* m_mainWidget;
00198 Backend::Storage* m_storage;
00199 ActionManagerImpl* m_actionManager;
00200 KCMultiDialog* m_dialog;
00201 };
00202
00203 }
00204
00205 #endif // AKREGATOR_PART_H