Plasma
runnercontext.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 PLASMA_RUNNERCONTEXT_H
00021 #define PLASMA_RUNNERCONTEXT_H
00022
00023 #include <QtCore/QList>
00024 #include <QtCore/QObject>
00025 #include <QtCore/QSharedDataPointer>
00026
00027 #include <plasma/plasma_export.h>
00028
00029 class KCompletion;
00030
00031 namespace Plasma
00032 {
00033
00034 class QueryMatch;
00035 class AbstractRunner;
00036 class RunnerContextPrivate;
00037
00045 class PLASMA_EXPORT RunnerContext : public QObject
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 enum Type {
00051 None = 0,
00052 UnknownType = 1,
00053 Directory = 2,
00054 File = 4,
00055 NetworkLocation = 8,
00056 Executable = 16,
00057 ShellCommand = 32,
00058 Help = 64,
00059 FileSystem = Directory | File | Executable | ShellCommand
00060 };
00061
00062 Q_DECLARE_FLAGS(Types, Type)
00063
00064 explicit RunnerContext(QObject *parent = 0);
00065
00069 explicit RunnerContext(RunnerContext &other, QObject *parent = 0);
00070
00071 ~RunnerContext();
00072
00077 void reset();
00078
00083 void setQuery(const QString &term);
00084
00088 QString query() const;
00089
00094 Type type() const;
00095
00103 QString mimeType() const;
00104
00112
00113
00114 bool addMatches(const QString &term, const QList<QueryMatch> &matches);
00115
00126
00127
00128 bool addMatch(const QString &term, const QueryMatch &match);
00129
00135 QList<QueryMatch> matches() const;
00136
00144 QueryMatch match(const QString &id) const;
00145
00146 Q_SIGNALS:
00147 void matchesChanged();
00148
00149 private:
00150 QExplicitlySharedDataPointer<RunnerContextPrivate> d;
00151 };
00152
00153 }
00154
00155 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::RunnerContext::Types)
00156
00157 #endif