Akonadi Search

core/resultiterator.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 "search_core_export.h"
12 #include "searchstore.h"
13 
14 #include <QExplicitlySharedDataPointer>
15 
16 namespace Akonadi
17 {
18 namespace Search
19 {
20 class SearchStore;
21 class Result;
22 
23 class Q_DECL_HIDDEN ResultIteratorPrivate : public QSharedData
24 {
25 public:
26  ResultIteratorPrivate()
27  {
28  }
29 
30  ~ResultIteratorPrivate()
31  {
32  if (store) {
33  store->close(queryId);
34  }
35  }
36 
37  int queryId = 0;
38  SearchStore *store = nullptr;
39 };
40 
41 /** Result iterator. */
42 class AKONADI_SEARCH_CORE_EXPORT ResultIterator
43 {
44 public:
46  ResultIterator(const ResultIterator &rhs);
47  ~ResultIterator();
48 
49  ResultIterator &operator=(const ResultIterator &other);
50 
51  // internal
52  ResultIterator(int id, SearchStore *store);
53 
54  bool next();
55 
56  [[nodiscard]] QByteArray id() const;
57  [[nodiscard]] QUrl url() const;
58 
59  [[nodiscard]] QString text() const;
60  [[nodiscard]] QString icon() const;
61 
62 private:
64 };
65 }
66 }
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.