Akonadi Search

contactquery.h
1 /*
2  * This file is part of the KDE Akonadi Search Project
3  * SPDX-FileCopyrightText: 2013 Vishesh Handa <[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 "search_pim_export.h"
13 
14 #include <QString>
15 
16 #include <memory>
17 
18 namespace Akonadi
19 {
20 namespace Search
21 {
22 namespace PIM
23 {
24 class ContactQueryPrivate;
25 
26 /**
27  * Query for a list of contacts matching a criteria
28  */
29 class AKONADI_SEARCH_PIM_EXPORT ContactQuery : public Query
30 {
31 public:
32  ContactQuery();
33  ~ContactQuery() override;
34 
35  void matchName(const QString &name);
36  void matchNickname(const QString &nick);
37  void matchEmail(const QString &email);
38  void matchUID(const QString &uid);
39  void match(const QString &str);
40 
41  enum MatchCriteria {
42  ExactMatch,
43  StartsWithMatch,
44  };
45 
46  void setMatchCriteria(MatchCriteria m);
47  [[nodiscard]] MatchCriteria matchCriteria() const;
48 
49  ResultIterator exec() override;
50 
51  [[nodiscard]] int limit() const;
52  void setLimit(int limit);
53 
54 private:
55  std::unique_ptr<ContactQueryPrivate> const d;
56 };
57 }
58 }
59 }
Query for a list of contacts matching a criteria.
Definition: contactquery.h:29
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.