VCardGeoValue.h
00001 /* 00002 This file is part of libvcard. 00003 Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef GEOVALUE_H 00022 #define GEOVALUE_H 00023 00024 #include <VCardValue.h> 00025 00026 namespace VCARD 00027 { 00028 00029 class KVCARD_EXPORT GeoValue : public Value 00030 { 00031 public: 00032 GeoValue(); 00033 GeoValue(const GeoValue&); 00034 GeoValue(const TQCString&); 00035 GeoValue & operator = (GeoValue&); 00036 GeoValue & operator = (const TQCString&); 00037 bool operator ==(GeoValue&); 00038 bool operator !=(GeoValue& x) {return !(*this==x);} 00039 bool operator ==(const TQCString& s) {GeoValue a(s);return(*this==a);} 00040 bool operator != (const TQCString& s) {return !(*this == s);} 00041 00042 virtual ~GeoValue(); 00043 void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} 00044 00045 void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} 00046 00047 void _parse(); 00048 void _assemble(); 00049 const char * className() const { return "GeoValue"; } 00050 00051 GeoValue *clone(); 00052 00053 void setLatitude( float lat ) { latitude_ = lat; assembled_ = false; } 00054 void setLongitude( float lon ) { longitude_ = lon; assembled_ = false; } 00055 00056 float latitude() { parse(); return latitude_; } 00057 float longitude() { parse(); return longitude_; } 00058 00059 private: 00060 float latitude_; 00061 float longitude_; 00062 }; 00063 00064 } 00065 00066 #endif