KPublicTransport

journeyreply.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_JOURNEYREPLY_H
8#define KPUBLICTRANSPORT_JOURNEYREPLY_H
9
10#include "reply.h"
11
12#include <vector>
13
14namespace KPublicTransport {
15
16class Journey;
17class JourneyReplyPrivate;
18class JourneyRequest;
19
20/** Journey query response. */
21class KPUBLICTRANSPORT_EXPORT JourneyReply : public Reply
22{
23 Q_OBJECT
24public:
25 ~JourneyReply() override;
26
27 /** The request this is the reply for. */
28 JourneyRequest request() const;
29
30 /** Returns the retrieved journeys. */
31 const std::vector<Journey>& result() const;
32 /** Returns the retrieved journeys for moving elsewhere. */
33 std::vector<Journey>&& takeResult();
34
35 /** Returns a request object for querying journeys following the ones returned by this reply.
36 * The returned request is empty if querying later journeys is not possible/supported.
37 */
38 JourneyRequest nextRequest() const;
39 /** Returns a request object for querying journeys preceding the ones returned by this reply.
40 * The returned request is empty if querying earlier journeys is not possible/supported.
41 */
42 JourneyRequest previousRequest() const;
43
44private:
45 friend class Manager;
46 friend class ManagerPrivate;
47 explicit JourneyReply(const JourneyRequest &req, QObject *parent = nullptr);
48
49 friend class AbstractBackend;
50 Q_DECL_HIDDEN void addResult(const AbstractBackend *backend, std::vector<Journey> &&res);
51 using Reply::addError;
52 Q_DECL_HIDDEN void addError(const AbstractBackend *backend, Reply::Error error, const QString &errorMsg);
53
54 Q_DECL_HIDDEN void setNextContext(const AbstractBackend *backend, const QVariant &data);
55 Q_DECL_HIDDEN void setPreviousContext(const AbstractBackend *backend, const QVariant &data);
56
57 Q_DECLARE_PRIVATE(JourneyReply)
58};
59
60}
61
62#endif // KPUBLICTRANSPORT_JOURNEYREPLY_H
Journey query response.
Describes a journey search.
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
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.