Engines
rss.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 #ifndef RSS_DATAENGINE_H
00022 #define RSS_DATAENGINE_H
00023
00024 #include <syndication/item.h>
00025 #include <syndication/loader.h>
00026 #include <syndication/feed.h>
00027 #include <Plasma/DataEngine>
00028
00029 class QDBusInterface;
00030 class QSignalMapper;
00031
00041 class RssEngine : public Plasma::DataEngine
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 RssEngine(QObject* parent, const QVariantList& args);
00047 virtual ~RssEngine();
00048
00049 protected:
00050 bool sourceRequestEvent(const QString &name);
00051 bool updateSourceEvent(const QString& name);
00052
00053 protected slots:
00054 void processRss(Syndication::Loader* loader,
00055 Syndication::FeedPtr feed,
00056 Syndication::ErrorCode error);
00057 void slotIconChanged(bool isHost, const QString& hostOrURL,
00058 const QString& iconName);
00059 void timeout(const QString & source);
00060
00061 private:
00062 QVariantList mergeFeeds(QString source) const;
00063 void updateFeeds(const QString & source,
00064 const QString & title);
00065 bool cachesUpToDate(const QString & source) const;
00066 QString iconLocation(const KUrl & url) const;
00067
00068 QHash<Syndication::Loader*, QString> m_feedMap;
00069 QHash<Syndication::Loader*, QString> m_sourceMap;
00070 QHash<QString, QTimer*> m_timerMap;
00071 QHash<QString, QVariantList> m_feedItems;
00072 QHash<QString, QString> m_feedIcons;
00073 QHash<QString, QString> m_feedTitles;
00074 QHash<QString, QDateTime> m_feedTimes;
00075
00076 QDBusInterface * m_favIconsModule;
00077 QSignalMapper * m_signalMapper;
00078 };
00079
00080 K_EXPORT_PLASMA_DATAENGINE(rss, RssEngine)
00081
00082 #endif
00083