Plasma
bookmarksrunner.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 #ifndef BOOKMARKSRUNNER_H
00021 #define BOOKMARKSRUNNER_H
00022
00023 #include <KIcon>
00024 #include <QSqlDatabase>
00025 #include <Plasma/AbstractRunner>
00026
00027
00028 class KBookmark;
00029 class KBookmarkManager;
00030
00032 class BookmarksRunner : public Plasma::AbstractRunner
00033 {
00034 Q_OBJECT
00035
00036 public:
00037 BookmarksRunner(QObject* parent, const QVariantList &args);
00038 ~BookmarksRunner();
00039
00040 void match(Plasma::RunnerContext &context);
00041 void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action);
00042 void reloadConfiguration();
00043
00044 private:
00053 enum Browser { Konqueror,
00054 Firefox,
00055 Default = Konqueror
00056 };
00057
00059 KIcon favicon(const KUrl &url);
00060
00062 void matchFirefoxBookmarks(Plasma::RunnerContext& context, bool allBookmarks,
00063 const QString& term);
00065 void matchKonquerorBookmarks(Plasma::RunnerContext& context, bool allBookmarks,
00066 const QString& term);
00067
00071 Browser whichBrowser();
00072
00073 private:
00074 KIcon m_icon;
00075 bool m_dbOK;
00076 Browser m_browser;
00077 QString m_dbFile;
00078 QString m_dbCacheFile;
00079 QSqlDatabase m_db;
00080 KBookmarkManager *m_bookmarkManager;
00081
00082 private Q_SLOTS:
00083 void prep();
00084 void down();
00085 };
00086
00087 K_EXPORT_PLASMA_RUNNER(bookmarksrunner, BookmarksRunner)
00088
00089 #endif