KPublicTransport

vehiclelayoutrequest.h
1 /*
2  SPDX-FileCopyrightText: 2019 Volker Krause <[email protected]>
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 
18 namespace KPublicTransport {
19 
20 class Stopover;
21 class JourneySection;
22 class VehicleLayoutRequestPrivate;
23 
24 /** Describes a query for vehicle layout information. */
25 class KPUBLICTRANSPORT_EXPORT VehicleLayoutRequest
26 {
27  KPUBLICTRANSPORT_GADGET(VehicleLayoutRequest)
28 
29  /** The stopover vehicle and platform layout information are requested for. */
30  KPUBLICTRANSPORT_PROPERTY(KPublicTransport::Stopover, stopover, setStopover)
31 
32 public:
33  /** Creates a vehicle layout request for the given stopover. */
34  explicit VehicleLayoutRequest(const Stopover &stopover);
35 
36  /** Returns @c true if this is a valid request, that is it has enough parameters set to perform a query. */
37  bool isValid() const;
38 
39  /** Unique string representation used for caching results. */
40  QString cacheKey() const;
41 
42  /** Identifiers of the backends that should be queried.
43  * @see setBackendIds()
44  */
45  QStringList backendIds() const;
46  /** Set identifiers of backends that should be queried.
47  * Settings this is only needed when you want explicit control over this, leaving
48  * this empty picks suitable backends automatically.
49  */
50  void setBackendIds(const QStringList &backendIds);
51 
52  ///@cond internal
53  static QJsonObject toJson(const VehicleLayoutRequest &req);
54  ///@endcond
55 };
56 
57 }
58 
59 Q_DECLARE_METATYPE(KPublicTransport::VehicleLayoutRequest)
60 
61 #endif // KPUBLICTRANSPORT_VEHICLELAYOUTREQUEST_H
Query operations and data types for accessing realtime public transport information from online servi...
Definition: attribution.cpp:16
Describes a query for vehicle layout information.
Information about an arrival and/or departure of a vehicle at a stop area.
Definition: stopover.h:25
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:05:21 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.