KNewStuff

resultsstream.h
1/*
2 SPDX-FileCopyrightText: 2023 Aleix Pol Gonzalez <aleixpol@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-or-later
5*/
6
7#ifndef RESULTSSTREAM_H
8#define RESULTSSTREAM_H
9
10#include <QObject>
11
12#include "enginebase.h"
13#include "provider.h"
14
15#include "knewstuffcore_export.h"
16
17namespace KNSCore
18{
19class ResultsStreamPrivate;
20/**
21 * The ResultsStream is returned by EngineBase::search. It is used to communicate
22 * the different entries in response to a request using the signal @m entriesFound.
23 *
24 * Initially the stream will communicate the entries part of the page as specified
25 * in the request. Further pages can be requested using @m fetchMore.
26 *
27 * Once we have reached the end of the requested stream, the object shall emit
28 * @m finished and delete itself.
29 *
30 * @since 6.0
31 */
33{
34 Q_OBJECT
35public:
36 ~ResultsStream() override;
37
38 /// Issues the search, make sure all signals are connected before calling
39 void fetch();
40
41 /// Increments the requested page and issues another search
42 void fetchMore();
43
44Q_SIGNALS:
45 void entriesFound(const KNSCore::Entry::List &entries);
46 void finished();
47
48private:
49 friend class EngineBase;
51 void finish();
52
53 std::unique_ptr<ResultsStreamPrivate> d;
54};
55
56}
57
58#endif // RESULTSSTREAM_H
KNewStuff engine.
Definition enginebase.h:52
The ResultsStream is returned by EngineBase::search.
used to keep track of a search
Definition provider.h:70
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:17:01 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.