KPublicTransport

equipment.h
1 /*
2  SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KPUBLICTRANSPORT_EQUIPMENT_H
8 #define KPUBLICTRANSPORT_EQUIPMENT_H
9 
10 #include "kpublictransport_export.h"
11 
12 #include "datatypes.h"
13 #include "disruption.h"
14 
15 #include <QStringList>
16 
17 class QJsonObject;
18 
19 namespace KPublicTransport {
20 
21 class EquipmentPrivate;
22 
23 /** Status information about equipment such as elevators or escalators. */
24 class KPUBLICTRANSPORT_EXPORT Equipment
25 {
26  KPUBLICTRANSPORT_GADGET(Equipment)
27 public:
28  /** Type of equipment. */
29  enum Type {
30  Unknown,
31  Elevator,
32  Escalator,
33  };
34  Q_ENUM(Type)
35  KPUBLICTRANSPORT_PROPERTY(Type, type, setType)
36 
37  /** Disruption effect on this section, if any. */
38  KPUBLICTRANSPORT_PROPERTY(KPublicTransport::Disruption::Effect, disruptionEffect, setDisruptionEffect)
39  /** General human-readable notes on this service, e.g. details about a disruption. */
40  KPUBLICTRANSPORT_PROPERTY(QStringList, notes, setNotes)
41 
42 public:
43  /** Adds a note. This will check for duplicates and normalize the notes. */
44  void addNote(const QString &note);
45 
46  /** Serializes one object to JSON. */
47  static QJsonObject toJson(const Equipment &equipment);
48  /** Deserialize an object from JSON. */
49  static Equipment fromJson(const QJsonObject &obj);
50 };
51 
52 }
53 
54 Q_DECLARE_METATYPE(KPublicTransport::Equipment)
55 
56 #endif // KPUBLICTRANSPORT_EQUIPMENT_H
Status information about equipment such as elevators or escalators.
Definition: equipment.h:24
Query operations and data types for accessing realtime public transport information from online servi...
Definition: attribution.cpp:16
Type
Type of equipment.
Definition: equipment.h:29
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.