23#include <QtCore/QDataStream>
24#include <QtCore/QSharedData>
28class 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.
bool operator!=(const Geo &) const
Not-Equal operator.
Geo()
Creates an invalid geographics position object.
bool isValid() const
Returns, whether this object contains a valid geographical position.
void setLatitude(float latitude)
Sets the latitude.
Geo & operator=(const Geo &other)
Assignment operator.
float longitude() const
Returns the longitude.
float latitude() const
Returns the latitude.
QString toString() const
Returns string representation of geographical position.
void setLongitude(float longitude)
Sets the longitude.
bool operator==(const Geo &) const
Equality operator.
Class that holds a Calendar Url (FBURL/CALADRURI/CALURI)
QDataStream & operator<<(QDataStream &stream, const Address &address)
Serializes the address object into the stream.
QDataStream & operator>>(QDataStream &stream, Address &address)
Initializes the address object from the stream.