address.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_ADDRESS_H
00022 #define KABC_ADDRESS_H
00023
00024 #include <qstring.h>
00025 #include <qvaluelist.h>
00026
00027 namespace KABC {
00028
00034 class Address
00035 {
00036 friend QDataStream &operator<<( QDataStream &, const Address & );
00037 friend QDataStream &operator>>( QDataStream &, Address & );
00038
00039 public:
00043 typedef QValueList<Address> List;
00044 typedef QValueList<int> TypeList;
00045
00057 enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32,
00058 Pref = 64 };
00059
00064 Address();
00065
00070 Address( int );
00071
00072 bool operator==( const Address & ) const;
00073 bool operator!=( const Address & ) const;
00074
00078 bool isEmpty() const;
00079
00083 void clear();
00084
00088 void setId( const QString & );
00089
00090
00091
00092
00093 QString id() const;
00094
00100 void setType( int type );
00101
00105 int type() const;
00106
00110 QString typeLabel() const;
00111
00115 void setPostOfficeBox( const QString & );
00116
00120 QString postOfficeBox() const;
00121
00125 static QString postOfficeBoxLabel();
00126
00130 void setExtended( const QString & );
00131
00135 QString extended() const;
00136
00140 static QString extendedLabel();
00141
00145 void setStreet( const QString & );
00146
00150 QString street() const;
00151
00155 static QString streetLabel();
00156
00160 void setLocality( const QString & );
00161
00165 QString locality() const;
00166
00170 static QString localityLabel();
00171
00175 void setRegion( const QString & );
00176
00180 QString region() const;
00181
00185 static QString regionLabel();
00186
00190 void setPostalCode( const QString & );
00191
00195 QString postalCode() const;
00196
00200 static QString postalCodeLabel();
00201
00205 void setCountry( const QString & );
00206
00210 QString country() const;
00211
00215 static QString countryLabel();
00216
00220 void setLabel( const QString & );
00221
00225 QString label() const;
00226
00230 static QString labelLabel();
00231
00235 static TypeList typeList();
00236
00240 static QString typeLabel( int type );
00241
00245 void dump() const;
00246
00247 private:
00248 bool mEmpty;
00249
00250 QString mId;
00251 int mType;
00252
00253 QString mPostOfficeBox;
00254 QString mExtended;
00255 QString mStreet;
00256 QString mLocality;
00257 QString mRegion;
00258 QString mPostalCode;
00259 QString mCountry;
00260 QString mLabel;
00261 };
00262
00263 QDataStream &operator<<( QDataStream &, const Address & );
00264 QDataStream &operator>>( QDataStream &, Address & );
00265
00266 }
00267 #endif
This file is part of the documentation for kdelibs Version 3.1.0.