Plasma
runnermanager.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 #ifndef PLASMA_RUNNERMANAGER_H
00023 #define PLASMA_RUNNERMANAGER_H
00024
00025 #include <QtCore/QList>
00026 #include <QtCore/QObject>
00027
00028 #include <plasma/plasma_export.h>
00029 #include "abstractrunner.h"
00030
00031 class QAction;
00032 class KConfigGroup;
00033
00034 namespace Plasma
00035 {
00036 class QueryMatch;
00037 class AbstractRunner;
00038 class RunnerContext;
00039 class RunnerManagerPrivate;
00040
00047 class PLASMA_EXPORT RunnerManager : public QObject
00048 {
00049 Q_OBJECT
00050
00051 public:
00052 explicit RunnerManager(QObject *parent=0);
00053 explicit RunnerManager(KConfigGroup &config, QObject *parent=0);
00054 ~RunnerManager();
00055
00061 AbstractRunner *runner(const QString &name) const;
00062
00066 QList<AbstractRunner *> runners() const;
00067
00072 RunnerContext *searchContext() const;
00073
00078 QList<QueryMatch> matches() const;
00079
00084 void run(const QueryMatch &match);
00085
00090 void run(const QString &id);
00091
00095 QList<QAction*> actionsForMatch(const QueryMatch &match);
00096
00100 QString query() const;
00101
00105 void reloadConfiguration();
00106
00107 public Q_SLOTS:
00116 void launchQuery(const QString &term, const QString &runnerName);
00117
00121 void launchQuery(const QString &term);
00122
00132 bool execQuery(const QString &term, const QString &runnerName);
00133
00137 bool execQuery(const QString &term);
00138
00142 void reset();
00143
00144 Q_SIGNALS:
00148 void matchesChanged(const QList<Plasma::QueryMatch> &matches);
00149
00150 private:
00151 Q_PRIVATE_SLOT(d, void scheduleMatchesChanged())
00152 Q_PRIVATE_SLOT(d, void matchesChanged())
00153 Q_PRIVATE_SLOT(d, void jobDone(ThreadWeaver::Job*))
00154 Q_PRIVATE_SLOT(d, void unblockJobs())
00155
00156 RunnerManagerPrivate * const d;
00157
00158 friend class RunnerManagerPrivate;
00159 };
00160
00161 }
00162
00163 #endif