Akonadi Search

collectionquery.h
1 /*
2  * This file is part of the KDE Akonadi Search Project
3  * SPDX-FileCopyrightText: 2014 Christian Mollekopf <[email protected]>
4  *
5  * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6  *
7  */
8 
9 #pragma once
10 
11 #include "query.h"
12 #include "resultiterator.h"
13 #include "search_pim_export.h"
14 
15 #include <Akonadi/Collection>
16 #include <QStringList>
17 
18 #include <memory>
19 
20 namespace Akonadi
21 {
22 namespace Search
23 {
24 /** PIM specific search API. */
25 namespace PIM
26 {
27 class CollectionQueryPrivate;
28 
29 /** Collection query. */
30 class AKONADI_SEARCH_PIM_EXPORT CollectionQuery : public Query
31 {
32 public:
34  ~CollectionQuery() override;
35 
36  void setNamespace(const QStringList &ns);
37  void setMimetype(const QStringList &mt);
38 
39  /**
40  * Matches the string \p match in the name.
41  */
42  void nameMatches(const QString &match);
43  void identifierMatches(const QString &match);
44  void pathMatches(const QString &match);
45 
46  void setLimit(int limit);
47  [[nodiscard]] int limit() const;
48 
49  /**
50  * Execute the query and return an iterator to fetch
51  * the results
52  */
53  [[nodiscard]] ResultIterator exec() override;
54 
55  /**
56  * For testing
57  */
58  void setDatabaseDir(const QString &dir);
59 
60 private:
61  //@cond PRIVATE
62  std::unique_ptr<CollectionQueryPrivate> const d;
63  //@endcond
64 };
65 }
66 }
67 }
Query base class.
Definition: lib/query.h:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:11:35 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.