KPublicTransport

vehiclelayoutrequest.h
1/*
2 SPDX-FileCopyrightText: 2019 Volker Krause <vkrause@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef KPUBLICTRANSPORT_VEHICLELAYOUTREQUEST_H
8#define KPUBLICTRANSPORT_VEHICLELAYOUTREQUEST_H
9
10#include "kpublictransport_export.h"
11
12#include <KPublicTransport/Datatypes>
13
14#include <QDateTime>
15#include <QMetaType>
16#include <QSharedDataPointer>
17
18namespace KPublicTransport {
19
20class Stopover;
21class VehicleLayoutRequestPrivate;
22
23/** Describes a query for vehicle layout information. */
24class KPUBLICTRANSPORT_EXPORT VehicleLayoutRequest
25{
26 KPUBLICTRANSPORT_GADGET(VehicleLayoutRequest)
27
28 /** The stopover vehicle and platform layout information are requested for. */
29 KPUBLICTRANSPORT_PROPERTY(KPublicTransport::Stopover, stopover, setStopover)
30
31public:
32 /** Creates a vehicle layout request for the given stopover. */
33 explicit VehicleLayoutRequest(const Stopover &stopover);
34
35 /** Returns @c true if this is a valid request, that is it has enough parameters set to perform a query. */
36 bool isValid() const;
37
38 /** Unique string representation used for caching results. */
39 QString cacheKey() const;
40
41 /** Identifiers of the backends that should be queried.
42 * @see setBackendIds()
43 */
44 QStringList backendIds() const;
45 /** Set identifiers of backends that should be queried.
46 * Settings this is only needed when you want explicit control over this, leaving
47 * this empty picks suitable backends automatically.
48 */
49 void setBackendIds(const QStringList &backendIds);
50
51 ///@cond internal
52 static QJsonObject toJson(const VehicleLayoutRequest &req);
53 ///@endcond
54};
55
56}
57
58Q_DECLARE_METATYPE(KPublicTransport::VehicleLayoutRequest)
59
60#endif // KPUBLICTRANSPORT_VEHICLELAYOUTREQUEST_H
Information about an arrival and/or departure of a vehicle at a stop area.
Definition stopover.h:26
Describes a query for vehicle layout information.
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.