phonenumber.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef KABC_PHONENUMBER_H
00022 #define KABC_PHONENUMBER_H
00023 
00024 #include <qvaluelist.h>
00025 #include <qstring.h>
00026 
00027 namespace KABC {
00028 
00036 class PhoneNumber
00037 {
00038     friend QDataStream &operator<<( QDataStream &, const PhoneNumber & );
00039     friend QDataStream &operator>>( QDataStream &, PhoneNumber & );
00040 
00041   public:
00042     typedef QValueList<PhoneNumber> List;
00043     typedef QValueList<int> TypeList;
00044 
00061     enum Types { Home = 1, Work = 2, Msg = 4, Pref = 8, Voice = 16, Fax = 32,
00062            Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024,
00063            Isdn = 2048, Pcs = 4096, Pager = 8192 };
00064 
00068     PhoneNumber();
00069 
00077     PhoneNumber( const QString &number, int type = Home );
00078 
00082     ~PhoneNumber();
00083     
00084     bool operator==( const PhoneNumber & ) const;
00085     bool operator!=( const PhoneNumber & ) const;
00086     
00090     void setId( const QString &id );
00091 
00095     QString id() const;
00096     
00100     void setNumber( const QString & );
00101 
00105     QString number() const;
00106     
00111     void setType( int );
00112 
00116     int type() const;
00117 
00121     QString typeLabel() const;
00122 
00126     QString label() const;
00127 
00131     static TypeList typeList();
00132 
00136     static QString typeLabel( int type );
00137 
00142     static QString label( int type );
00143 
00144   private:
00145     void init();
00146   
00147     QString mId;
00148   
00149     int mType;
00150     QString mNumber;
00151 };
00152 
00153 QDataStream &operator<<( QDataStream &, const PhoneNumber & );
00154 QDataStream &operator>>( QDataStream &, PhoneNumber & );
00155 
00156 }
00157 
00158 #endif
 
This file is part of the documentation for kabc Library Version 3.2.0.