Plasma
querymatch.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2006-2007 Aaron Seigo <aseigo@kde.org> 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU Library General Public License as 00006 * published by the Free Software Foundation; either version 2, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details 00013 * 00014 * You should have received a copy of the GNU Library General Public 00015 * License along with this program; if not, write to the 00016 * Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef PLASMA_QUERYMATCH_H 00021 #define PLASMA_QUERYMATCH_H 00022 00023 #include <QtCore/QList> 00024 #include <QtCore/QSharedDataPointer> 00025 00026 #include <plasma/plasma_export.h> 00027 00028 class QAction; 00029 class QIcon; 00030 class QString; 00031 class QVariant; 00032 class QWidget; 00033 00034 namespace Plasma 00035 { 00036 00037 class RunnerContext; 00038 class AbstractRunner; 00039 class QueryMatchPrivate; 00040 00047 class PLASMA_EXPORT QueryMatch 00048 { 00049 public: 00053 enum Type { 00054 NoMatch = 0, 00055 CompletionMatch = 10, 00056 PossibleMatch = 30, 00057 InformationalMatch = 50, 00059 HelperMatch = 70, 00067 ExactMatch = 100 00068 }; 00069 00077 explicit QueryMatch(AbstractRunner *runner); 00078 00082 QueryMatch(const QueryMatch &other); 00083 00084 ~QueryMatch(); 00085 QueryMatch &operator=(const QueryMatch &other); 00086 bool operator==(const QueryMatch &other) const; 00087 bool operator!=(const QueryMatch &other) const; 00088 bool operator<(const QueryMatch &other) const; 00089 00090 00094 AbstractRunner *runner() const; 00095 00100 bool isValid() const; 00101 00105 void setType(Type type); 00106 00110 Type type() const; 00111 00118 void setRelevance(qreal relevance); 00119 00126 qreal relevance() const; 00127 00135 void run(const RunnerContext &context) const; 00136 00146 void setData(const QVariant &data); 00147 00151 QVariant data() const; 00152 00162 void setId(const QString &id); 00163 00172 QString id() const; 00173 00180 void setText(const QString &text); 00181 00185 QString text() const; 00186 00193 void setSubtext(const QString &text); 00194 00198 QString subtext() const; 00199 00205 void setIcon(const QIcon &icon); 00206 00210 QIcon icon() const; 00211 00217 void setEnabled(bool enable); 00218 00222 bool isEnabled() const; 00223 00227 QAction* selectedAction() const; 00228 00232 void setSelectedAction(QAction *action); 00233 00238 bool hasConfigurationInterface() const; 00239 00248 void createConfigurationInterface(QWidget *parent); 00249 00250 private: 00251 QSharedDataPointer<QueryMatchPrivate> d; 00252 }; 00253 00254 } 00255 00256 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:30:44 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:30:44 by doxygen 1.7.5.1 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.