kabc
23 #include <QtCore/QDataStream>
24 #include <QtCore/QSharedData>
28 class Geo::Private :
public QSharedData
32 : mLatitude( 91 ), mLongitude( 181 ),
33 mValidLatitude( false ), mValidLongitude( false )
37 Private(
const Private &other )
38 : QSharedData( other )
40 mLatitude = other.mLatitude;
41 mLongitude = other.mLongitude;
42 mValidLatitude = other.mValidLatitude;
43 mValidLongitude = other.mValidLongitude;
78 d->mValidLatitude =
true;
81 d->mValidLatitude =
false;
94 d->mValidLongitude =
true;
97 d->mValidLongitude =
false;
103 return d->mLongitude;
108 return d->mValidLatitude && d->mValidLongitude;
121 if ( other.d->mLatitude == d->mLatitude && other.d->mLongitude == d->mLongitude ) {
130 return !( *
this == other );
135 if (
this != &other ) {
146 str += QLatin1String(
"Geo {\n" );
147 str += QString::fromLatin1(
" Valid: %1\n" ).
148 arg(
isValid() ? QLatin1String(
"true" ) : QLatin1String(
"false" ) );
149 str += QString::fromLatin1(
" Latitude: %1\n" ).arg( d->mLatitude );
150 str += QString::fromLatin1(
" Longitude: %1\n" ).arg( d->mLongitude );
151 str += QLatin1String(
"}\n" );
158 return s << geo.d->mLatitude << geo.d->mValidLatitude
159 << geo.d->mLongitude << geo.d->mValidLongitude;
164 s >> geo.d->mLatitude >> geo.d->mValidLatitude
165 >> geo.d->mLongitude >> geo.d->mValidLongitude;
~Geo()
Destroys the geographics position object.
Geo & operator=(const Geo &other)
Assignment operator.
bool operator!=(const Geo &) const
Not-Equal operator.
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
void setLatitude(float latitude)
Sets the latitude.
float latitude() const
Returns the latitude.
bool isValid() const
Returns, whether this object contains a valid geographical position.
QDataStream & operator>>(QDataStream &stream, Address &address)
Initializes the address object from the stream.
Geo()
Creates an invalid geographics position object.
QString toString() const
Returns string representation of geographical position.
float longitude() const
Returns the longitude.
bool operator==(const Geo &) const
Equality operator.
void setLongitude(float longitude)
Sets the longitude.
QDataStream & operator<<(QDataStream &stream, const Address &address)
Serializes the address object into the stream.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jan 29 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.