Akonadi Search

core/resultiterator.h
1/*
2 * This file is part of the KDE Akonadi Search Project
3 * SPDX-FileCopyrightText: 2013 Vishesh Handa <me@vhanda.in>
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
16namespace Akonadi
17{
18namespace Search
19{
20class SearchStore;
21class Result;
22
23class Q_DECL_HIDDEN ResultIteratorPrivate : public QSharedData
24{
25public:
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. */
42class AKONADI_SEARCH_CORE_EXPORT ResultIterator
43{
44public:
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
62private:
64};
65}
66}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:37:50 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.