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{
25public:
26 ~StopoverReply() override;
27
28 /** The request this is the reply for. */
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 */
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 */
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
Query response base class.
Definition reply.h:25
Error
Error types.
Definition reply.h:33
StopoverRequest previousRequest() const
Returns a request object for querying departures preceding the ones returned by this reply.
StopoverRequest nextRequest() const
Returns a request object for querying departures following the ones returned by this reply.
StopoverRequest request() const
The request this is the reply for.
std::vector< Stopover > && takeResult()
Returns the found arrival or departure information for moving elsewhere.
const std::vector< Stopover > & result() const
Returns the found arrival or departure information.
Describes an arrival or departure search.
Information about an arrival and/or departure of a vehicle at a stop area.
Definition stopover.h:26
Query operations and data types for accessing realtime public transport information from online servi...
QObject(QObject *parent)
Q_OBJECTQ_OBJECT
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:50:52 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.