KPublicTransport

stopoverreply.h
1/*
2 SPDX-FileCopyrightText: 2018 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KPUBLICTRANSPORT_STOPOVERREPLY_H
8#define KPUBLICTRANSPORT_STOPOVERREPLY_H
9
10#include "reply.h"
11
12#include <vector>
13
14namespace KPublicTransport {
15
16class AbstractBackend;
17class Stopover;
18class StopoverReplyPrivate;
19class StopoverRequest;
20
21/** Departure or arrival query reply. */
22class KPUBLICTRANSPORT_EXPORT StopoverReply : public Reply
23{
24 Q_OBJECT
25public:
26 ~StopoverReply() override;
27
28 /** The request this is the reply for. */
29 StopoverRequest request() const;
30
31 /** Returns the found arrival or departure information. */
32 const std::vector<Stopover>& result() const;
33 /** Returns the found arrival or departure information for moving elsewhere. */
34 std::vector<Stopover>&& takeResult();
35
36 /** Returns a request object for querying departures following the ones returned by this reply.
37 * The returned request is empty if querying later departures is not possible/supported.
38 */
39 StopoverRequest nextRequest() const;
40 /** Returns a request object for querying departures preceding the ones returned by this reply.
41 * The returned request is empty if querying earlier departures is not possible/supported.
42 */
43 StopoverRequest previousRequest() const;
44
45private:
46 friend class Manager;
47 friend class ManagerPrivate;
48 explicit StopoverReply(const StopoverRequest &req, QObject *parent = nullptr);
49
50 friend class AbstractBackend;
51 Q_DECL_HIDDEN void addResult(const AbstractBackend *backend, std::vector<Stopover> &&res);
52 using Reply::addError;
53 Q_DECL_HIDDEN void addError(const AbstractBackend *backend, Reply::Error error, const QString &errorMsg);
54
55 Q_DECL_HIDDEN void setNextContext(const AbstractBackend *backend, const QVariant &data);
56 Q_DECL_HIDDEN void setPreviousContext(const AbstractBackend *backend, const QVariant &data);
57
58 Q_DECLARE_PRIVATE(StopoverReply)
59};
60
61}
62
63#endif // KPUBLICTRANSPORT_STOPOVERREPLY_H
Entry point for starting public transport queries.
Definition manager.h:42
Query response base class.
Definition reply.h:25
Error
Error types.
Definition reply.h:31
Departure or arrival query reply.
Describes an arrival or departure search.
Query operations and data types for accessing realtime public transport information from online servi...
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:07:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.