21 #include <tqdatastream.h> 28 : mLatitude( 91 ), mLongitude( 181 ), mValidLat( false ), mValidLong( false )
40 if ( latitude >= -90 && latitude <= 90 ) {
56 if ( longitude >= -180 && longitude <= 180 ) {
72 return mValidLat && mValidLong;
75 bool Geo::operator==(
const Geo &g )
const 79 if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude )
return true;
83 bool Geo::operator!=(
const Geo &g )
const 87 if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude )
return false;
93 return "(" + TQString::number(mLatitude) +
"," + TQString::number(mLongitude) +
")";
96 TQDataStream &KABC::operator<<( TQDataStream &s,
const Geo &geo )
98 return s << (float)geo.mLatitude << (
float)geo.mLongitude;
101 TQDataStream &KABC::operator>>( TQDataStream &s,
Geo &geo )
103 s >> geo.mLatitude >> geo.mLongitude;
105 geo.mValidLat =
true;
106 geo.mValidLong =
true;
bool isValid() const
Returns, if this object contains a valid geographical position.
TQString asString() const
Returns string representation of geographical position.
void setLongitude(float)
Sets the longitude.
float latitude() const
Returns the latitude.
static data, shared by ALL addressee objects
float longitude() const
Returns the longitude.
Geo()
Construct invalid geographics position object.
void setLatitude(float)
Sets the latitude.