KItinerary

place.h
1 /*
2  SPDX-FileCopyrightText: 2018 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KITINERARY_PLACE_H
8 #define KITINERARY_PLACE_H
9 
10 #include "kitinerary_export.h"
11 
12 #include "datatypes.h"
13 
14 
15 namespace KItinerary {
16 
17 class GeoCoordinatesPrivate;
18 
22 class KITINERARY_EXPORT GeoCoordinates
23 {
24  KITINERARY_GADGET(GeoCoordinates)
25  KITINERARY_PROPERTY(float, latitude, setLatitude)
26  KITINERARY_PROPERTY(float, longitude, setLongitude)
27 
28  Q_PROPERTY(bool isValid READ isValid STORED false)
29 public:
30  GeoCoordinates(float latitude, float longitude);
31 
35  bool isValid() const;
36 private:
38 };
39 
40 class PostalAddressPrivate;
41 
45 class KITINERARY_EXPORT PostalAddress
46 {
47  KITINERARY_GADGET(PostalAddress)
48  KITINERARY_PROPERTY(QString, streetAddress, setStreetAddress)
49  KITINERARY_PROPERTY(QString, addressLocality, setAddressLocality)
50  KITINERARY_PROPERTY(QString, postalCode, setPostalCode)
51  KITINERARY_PROPERTY(QString, addressRegion, setAddressRegion)
53  KITINERARY_PROPERTY(QString, addressCountry, setAddressCountry)
54 
55  Q_PROPERTY(bool isEmpty READ isEmpty STORED false)
56 public:
58  bool isEmpty() const;
59 private:
60  QExplicitlySharedDataPointer<PostalAddressPrivate> d;
61 };
62 
63 class PlacePrivate;
64 
68 class KITINERARY_EXPORT Place
69 {
70  KITINERARY_BASE_GADGET(Place)
71  KITINERARY_PROPERTY(QString, name, setName)
72  KITINERARY_PROPERTY(KItinerary::PostalAddress, address, setAddress)
73  KITINERARY_PROPERTY(KItinerary::GeoCoordinates, geo, setGeo)
74  KITINERARY_PROPERTY(QString, telephone, setTelephone)
85  KITINERARY_PROPERTY(QString, identifier, setIdentifier)
86 protected:
88  QExplicitlySharedDataPointer<PlacePrivate> d;
90 };
91 
95 class KITINERARY_EXPORT Airport : public Place
96 {
97  KITINERARY_GADGET(Airport)
98  KITINERARY_PROPERTY(QString, iataCode, setIataCode)
99 };
100 
104 class KITINERARY_EXPORT TrainStation : public Place
105 {
106  KITINERARY_GADGET(TrainStation)
107 };
108 
112 class KITINERARY_EXPORT BusStation : public Place
113 {
114  KITINERARY_GADGET(BusStation)
115 };
116 
117 
121 class KITINERARY_EXPORT TouristAttraction : public Place
122 {
123  KITINERARY_GADGET(TouristAttraction)
124 };
125 
126 }
127 
128 Q_DECLARE_METATYPE(KItinerary::Place)
129 Q_DECLARE_METATYPE(KItinerary::GeoCoordinates)
130 Q_DECLARE_METATYPE(KItinerary::PostalAddress)
131 Q_DECLARE_METATYPE(KItinerary::Airport)
132 Q_DECLARE_METATYPE(KItinerary::TrainStation)
133 Q_DECLARE_METATYPE(KItinerary::BusStation)
134 Q_DECLARE_METATYPE(KItinerary::TouristAttraction)
135 
136 #endif // KITINERARY_PLACE_H
Classes for reservation/travel data models, data extraction and data augmentation.
Tourist attraction (e.g.
Definition: place.h:121
Train station.
Definition: place.h:104
Base class for places.
Definition: place.h:68
Geographic coordinates.
Definition: place.h:22
Postal address.
Definition: place.h:45
Airport.
Definition: place.h:95
Bus station.
Definition: place.h:112
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Sep 25 2020 23:14:52 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.