KOSMIndoorMap

wikidataquerymanager.h
1/*
2 SPDX-FileCopyrightText: 2020 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef WIKIDATAQUERYMANAGER_H
8#define WIKIDATAQUERYMANAGER_H
9
10#include <QObject>
11
13class QNetworkReply;
14
15namespace Wikidata {
16class Query;
17
18/** Executes wikidata queries. */
19class QueryManager : public QObject
20{
22public:
23 explicit QueryManager(QObject *parent = nullptr);
24 ~QueryManager() override;
25
26 /** Set the email address used in the User-Agent header.
27 * Setting this is mandatory, queries will not be executred without this.
28 */
29 void setUserAgentEmailAddress(const QString &email);
30
31 /** Execute @p query. */
32 void execute(Query *query);
33
34private:
35 void executeNextSubQuery(Query *query);
36 void subQueryFinished(Query *query, QNetworkReply *reply);
37 [[nodiscard]] QNetworkAccessManager* nam();
38
39 QNetworkAccessManager *m_nam = nullptr;
40 QString m_email;
41};
42
43}
44
45#endif // WIKIDATAQUERYMANAGER_H
Executes wikidata queries.
void setUserAgentEmailAddress(const QString &email)
Set the email address used in the User-Agent header.
void execute(Query *query)
Execute query.
Base class for Wikidata queries.
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 29 2024 11:55:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.