libplasma
querymatch.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 QUERYMATCH_H
00021 #define QUERYMATCH_H
00022
00023 #include <QtCore/QSharedDataPointer>
00024
00025 #include <plasma/plasma_export.h>
00026
00027 class QIcon;
00028 class QVariant;
00029 class QString;
00030
00031 namespace Plasma
00032 {
00033
00034 class RunnerContext;
00035 class AbstractRunner;
00036 class QueryMatchPrivate;
00037
00043 class PLASMA_EXPORT QueryMatch
00044 {
00045 public:
00049 enum Type { NoMatch = 0 ,
00050 CompletionMatch = 10 ,
00051 PossibleMatch = 30 ,
00052 InformationalMatch = 50 ,
00054 HelperMatch = 70 ,
00062 ExactMatch = 100 };
00063
00064
00072 explicit QueryMatch(AbstractRunner *runner);
00073
00077 QueryMatch(const QueryMatch &other);
00078
00079 ~QueryMatch();
00080
00081 bool isValid() const;
00082
00086 void setType(Type type);
00087
00091 Type type() const;
00092
00099 void setRelevance(qreal relevance);
00100
00107 qreal relevance() const;
00108
00112 AbstractRunner* runner() const;
00113
00122 QString id() const;
00123
00124 QString text() const;
00125 QString subtext() const;
00126 QVariant data() const;
00127 QIcon icon() const;
00128 bool isEnabled() const;
00129
00130 bool operator<(const QueryMatch& other) const;
00131 QueryMatch& operator=(const QueryMatch &other);
00132
00138 void run(const RunnerContext &context) const;
00139
00149 void setData(const QVariant& data);
00150
00160 void setId(const QString &id);
00161
00162 void setText(const QString& text);
00163 void setSubtext(const QString& text);
00164 void setIcon(const QIcon& icon);
00165 void setEnabled(bool enable);
00166
00167 private:
00168 QSharedDataPointer<QueryMatchPrivate> d;
00169 };
00170
00171 }
00172
00173 #endif