Akonadi

searchrequest.h
1/*
2 SPDX-FileCopyrightText: 2013, 2014 Daniel Vrátil <dvratil@redhat.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QList>
10#include <QObject>
11#include <QSet>
12#include <QStringList>
13
14namespace Akonadi
15{
16namespace Server
17{
18class Connection;
19class SearchManager;
20class SearchTaskManager;
21
22class SearchRequest : public QObject
23{
25
26public:
27 explicit SearchRequest(const QByteArray &connectionId, SearchManager &searchManager, SearchTaskManager &agentSearchTask);
28 ~SearchRequest() override;
29
30 void setQuery(const QString &query);
31 QString query() const;
32 void setCollections(const QList<qint64> &collections);
33 QList<qint64> collections() const;
34 void setMimeTypes(const QStringList &mimeTypes);
35 QStringList mimeTypes() const;
36 void setRemoteSearch(bool remote);
37 bool remoteSearch() const;
38
39 /**
40 * Whether results should be stored after they are emitted via resultsAvailable(),
41 * so that they can be extracted via results() after the search is over. This
42 * is disabled by default.
43 */
44 void setStoreResults(bool storeResults);
45
46 QByteArray connectionId() const;
47
48 void exec();
49
50 QSet<qint64> results() const;
51
53 void resultsAvailable(const QSet<qint64> &results);
54
55private:
56 void searchPlugins();
57 void emitResults(const QSet<qint64> &results);
58
59 QByteArray mConnectionId;
60 QString mQuery;
61 QList<qint64> mCollections;
62 QStringList mMimeTypes;
63 bool mRemoteSearch = false;
64 bool mStoreResults = false;
65 QSet<qint64> mResults;
66
67 SearchManager &mSearchManager;
68 SearchTaskManager &mAgentSearchManager;
69};
70
71} // namespace Server
72} // namespace Akonadi
Helper integration between Akonadi and Qt.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.