add more spacing
[personal-kdebase.git] / workspace / plasma / applets / kickoff / core / searchmodel.h
blob6122efba1220dc40e10372ce2d4569fa29e5ef26
1 /*
2 Copyright 2007 Robert Knight <robertknight@gmail.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef SEARCHMODEL_H
21 #define SEARCHMODEL_H
23 #include "core/kickoff_export.h"
24 #include "core/kickoffmodel.h"
26 namespace Kickoff
29 class SearchResult
31 public:
32 QString url;
33 QString title;
34 QString subTitle;
36 typedef QList<SearchResult> ResultList;
38 class KICKOFF_EXPORT SearchModel : public KickoffModel
40 Q_OBJECT
42 public:
43 SearchModel(QObject *parent);
44 virtual ~SearchModel();
46 public Q_SLOTS:
47 void setQuery(const QString& query);
49 private Q_SLOTS:
50 void resultsAvailable(const QStringList& results);
51 void resultsAvailable(const ResultList& results);
53 Q_SIGNALS:
54 void resultsAvailable();
56 private:
57 class Private;
58 Private * const d;
61 class SearchInterface : public QObject
63 Q_OBJECT
65 public:
66 SearchInterface(QObject *parent);
68 virtual QString name() const = 0;
69 virtual void setQuery(const QString& query) = 0;
72 Q_SIGNALS:
73 void resultsAvailable(const QStringList& results);
74 void resultsAvailable(const ResultList& results);
77 class ApplicationSearch : public SearchInterface
79 Q_OBJECT
81 public:
82 ApplicationSearch(QObject *parent);
84 virtual QString name() const;
85 virtual void setQuery(const QString& query);
87 private:
88 QString mimeNameForQuery(const QString& query) const;
91 class WebSearch : public SearchInterface
93 Q_OBJECT
95 public:
96 WebSearch(QObject *parent);
97 virtual QString name() const;
98 virtual void setQuery(const QString& query);
101 class IndexerSearch : public SearchInterface
103 Q_OBJECT
105 public:
106 IndexerSearch(QObject *parent);
107 virtual QString name() const;
108 virtual void setQuery(const QString& query);
113 #endif // SEARCHMODEL_H