Changeset View
Changeset View
Standalone View
Standalone View
src/urifilters/ikws/searchprovider.h
Show All 14 Lines | |||||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | 19 | | |||
20 | #ifndef SEARCHPROVIDER_H | 20 | #ifndef SEARCHPROVIDER_H | ||
21 | #define SEARCHPROVIDER_H | 21 | #define SEARCHPROVIDER_H | ||
22 | 22 | | |||
23 | #include <kservice.h> | | |||
24 | #include <KUriFilter> | 23 | #include <KUriFilter> | ||
25 | 24 | | |||
26 | class SearchProvider : public KUriFilterSearchProvider | 25 | class SearchProvider : public KUriFilterSearchProvider | ||
27 | { | 26 | { | ||
28 | public: | 27 | public: | ||
29 | SearchProvider() : m_dirty(false) {} | 28 | SearchProvider() : m_dirty(false) {} | ||
30 | explicit SearchProvider(const KService::Ptr service); | 29 | explicit SearchProvider(const QString &servicePath); | ||
30 | ~SearchProvider(); | ||||
31 | 31 | | |||
32 | const QString& charset() const { return m_charset; } | 32 | const QString& charset() const { return m_charset; } | ||
33 | const QString& query() const { return m_query; } | 33 | const QString& query() const { return m_query; } | ||
34 | bool isDirty() const { return m_dirty; } | 34 | bool isDirty() const { return m_dirty; } | ||
35 | 35 | | |||
36 | void setName(const QString&); | 36 | void setName(const QString&); | ||
37 | void setQuery(const QString&); | 37 | void setQuery(const QString&); | ||
38 | void setKeys(const QStringList&); | 38 | void setKeys(const QStringList&); | ||
39 | void setCharset(const QString&); | 39 | void setCharset(const QString&); | ||
40 | void setDirty(bool dirty); | 40 | void setDirty(bool dirty); | ||
41 | 41 | | |||
42 | QString iconName() const Q_DECL_OVERRIDE; | 42 | QString iconName() const Q_DECL_OVERRIDE; | ||
43 | 43 | | |||
44 | static SearchProvider *findByDesktopName(const QString &); | | |||
45 | static SearchProvider *findByKey(const QString &); | | |||
46 | static QList<SearchProvider *> findAll(); | | |||
47 | private: | 44 | private: | ||
48 | QString m_query; | 45 | QString m_query; | ||
49 | QString m_charset; | 46 | QString m_charset; | ||
50 | bool m_dirty; | 47 | bool m_dirty; | ||
51 | }; | 48 | }; | ||
52 | 49 | | |||
53 | #endif | 50 | #endif |