KContacts

geo.h
1 /*
2  This file is part of the KContacts framework.
3  SPDX-FileCopyrightText: 2001 Cornelius Schumacher <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7 
8 #ifndef KCONTACTS_GEO_H
9 #define KCONTACTS_GEO_H
10 
11 #include "kcontacts_export.h"
12 
13 #include <QMetaType>
14 #include <QSharedDataPointer>
15 #include <QString>
16 
17 namespace KContacts {
23 class KCONTACTS_EXPORT Geo
24 {
25  friend KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &, const Geo &);
26  friend KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &, Geo &);
27 
28  Q_GADGET
29  Q_PROPERTY(float latitude READ latitude WRITE setLatitude)
30  Q_PROPERTY(float longitude READ longitude WRITE setLongitude)
31  Q_PROPERTY(bool isValid READ isValid)
32 
33 public:
37  Geo();
38 
45  Geo(float latitude, float longitude);
46 
50  Geo(const Geo &other);
51 
55  ~Geo();
56 
62  void setLatitude(float latitude);
63 
67  Q_REQUIRED_RESULT float latitude() const;
68 
74  void setLongitude(float longitude);
75 
79  Q_REQUIRED_RESULT float longitude() const;
80 
84  Q_REQUIRED_RESULT bool isValid() const;
85 
91  Q_REQUIRED_RESULT bool operator==(const Geo &other) const;
92 
96  bool operator!=(const Geo &other) const;
97 
103  Geo &operator=(const Geo &other);
104 
108  Q_REQUIRED_RESULT QString toString() const;
109 
115  void clear();
116 
117 private:
118  class Private;
120 };
121 
125 KCONTACTS_EXPORT QDataStream &operator<<(QDataStream &stream, const Geo &object);
126 
130 KCONTACTS_EXPORT QDataStream &operator>>(QDataStream &stream, Geo &object);
131 }
132 Q_DECLARE_METATYPE(KContacts::Geo)
133 Q_DECLARE_TYPEINFO(KContacts::Geo, Q_MOVABLE_TYPE);
134 #endif
QDataStream & operator>>(QDataStream &in, KDateTime::Spec &spec)
Geographic position.
Definition: geo.h:23
QDataStream & operator<<(QDataStream &out, const KDateTime::Spec &spec)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 1 2020 22:53:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.