Akonadi

searchrequest.h
1 /*
2  SPDX-FileCopyrightText: 2013, 2014 Daniel Vrátil <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef AKONADI_SEARCHREQUEST_H
8 #define AKONADI_SEARCHREQUEST_H
9 
10 #include <QObject>
11 #include <QVector>
12 #include <QSet>
13 #include <QStringList>
14 
15 namespace Akonadi
16 {
17 namespace Server
18 {
19 
20 class Connection;
21 class SearchManager;
22 class SearchTaskManager;
23 
24 class SearchRequest : public QObject
25 {
26  Q_OBJECT
27 
28 public:
29  explicit SearchRequest(const QByteArray &connectionId, SearchManager &searchManager, SearchTaskManager &agentSearchTask);
30  ~SearchRequest();
31 
32  void setQuery(const QString &query);
33  QString query() const;
34  void setCollections(const QVector<qint64> &collections);
35  QVector<qint64> collections() const;
36  void setMimeTypes(const QStringList &mimeTypes);
37  QStringList mimeTypes() const;
38  void setRemoteSearch(bool remote);
39  bool remoteSearch() const;
40 
46  void setStoreResults(bool storeResults);
47 
48  QByteArray connectionId() const;
49 
50  void exec();
51 
52  QSet<qint64> results() const;
53 
54 Q_SIGNALS:
55  void resultsAvailable(const QSet<qint64> &results);
56 
57 private:
58  void searchPlugins();
59  void emitResults(const QSet<qint64> &results);
60 
61  QByteArray mConnectionId;
62  QString mQuery;
63  QVector<qint64> mCollections;
64  QStringList mMimeTypes;
65  bool mRemoteSearch = false;
66  bool mStoreResults = false;
67  QSet<qint64> mResults;
68 
69  SearchManager &mSearchManager;
70  SearchTaskManager &mAgentSearchManager;
71 };
72 
73 } // namespace Server
74 } // namespace Akonadi
75 
76 #endif // AKONADI_SEARCHREQUEST_H
std::optional< QSqlQuery > query(const QString &queryStatement)
Returns the cached (and prepared) query for queryStatement.
Definition: querycache.cpp:95
Q_SIGNALSQ_SIGNALS
Q_OBJECTQ_OBJECT
QStringList mimeTypes(Types)
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Jul 12 2020 23:16:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.