kabc Library API Documentation

address.h

00001 /*
00002     This file is part of libkabc.
00003     Copyright (c) 2001 Cornelius Schumacher <schumacher@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., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
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       Returns the unique id.
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
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:22:07 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001