Akonadi Search

collectionquery.h
1/*
2 * This file is part of the KDE Akonadi Search Project
3 * SPDX-FileCopyrightText: 2014 Christian Mollekopf <mollekopf@kolabsys.com>
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
20namespace Akonadi
21{
22namespace Search
23{
24/** PIM specific search API. */
25namespace PIM
26{
27class CollectionQueryPrivate;
28
29/** Collection query. */
30class AKONADI_SEARCH_PIM_EXPORT CollectionQuery : public Query
31{
32public:
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
60private:
61 //@cond PRIVATE
62 std::unique_ptr<CollectionQueryPrivate> const d;
63 //@endcond
64};
65}
66}
67}
Query base class.
Definition lib/query.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:48:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.