13using namespace KContacts;
21 , mValidLatitude(false)
22 , mValidLongitude(false)
26 Private(
const Private &other)
29 mLatitude = other.mLatitude;
30 mLongitude = other.mLongitude;
31 mValidLatitude = other.mValidLatitude;
32 mValidLongitude = other.mValidLongitude;
65 if (latitude >= -90 && latitude <= 90) {
66 d->mLatitude = latitude;
67 d->mValidLatitude =
true;
70 d->mValidLatitude =
false;
74float Geo::latitude()
const
81 if (longitude >= -180 && longitude <= 180) {
82 d->mLongitude = longitude;
83 d->mValidLongitude =
true;
86 d->mValidLongitude =
false;
90float Geo::longitude()
const
95bool Geo::isValid()
const
97 return d->mValidLatitude && d->mValidLongitude;
102 if (!other.isValid() && !isValid()) {
106 if (!other.isValid() || !isValid()) {
110 if (other.d->mLatitude == d->mLatitude && other.d->mLongitude == d->mLongitude) {
119 return !(*
this == other);
124 if (
this != &other) {
134 str += QStringLiteral(
" Valid: %1\n").
arg(isValid() ? QStringLiteral(
"true") : QStringLiteral(
"false"));
135 str += QStringLiteral(
" Latitude: %1\n").
arg(d->mLatitude);
136 str += QStringLiteral(
" Longitude: %1\n").
arg(d->mLongitude);
144 d->mValidLatitude =
false;
145 d->mValidLongitude =
false;
151 return s << geo.d->mLatitude << geo.d->mValidLatitude
152 << geo.d->mLongitude << geo.d->mValidLongitude;
157 s >> geo.d->mLatitude >> geo.d->mValidLatitude
158 >> geo.d->mLongitude >> geo.d->mValidLongitude;
164#include "moc_geo.cpp"
QString arg(Args &&... args) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:58:37 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.