addressee.src.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_ADDRESSEE_H
00022 #define KABC_ADDRESSEE_H
00023
00024 #include <qdatetime.h>
00025 #include <qstring.h>
00026 #include <qstringlist.h>
00027 #include <qvaluelist.h>
00028
00029 #include <ksharedptr.h>
00030 #include <kurl.h>
00031
00032 #include "address.h"
00033 #include "agent.h"
00034 #include "geo.h"
00035 #include "key.h"
00036 #include "phonenumber.h"
00037 #include "picture.h"
00038 #include "secrecy.h"
00039 #include "sound.h"
00040 #include "timezone.h"
00041
00042 namespace KABC {
00043
00044 class Resource;
00045 class Field;
00046
00073 class KABC_EXPORT Addressee
00074 {
00075 friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
00076 friend KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
00077
00078 public:
00079 typedef QValueList<Addressee> List;
00080 typedef QMap<QString, Addressee> Map;
00081
00085 Addressee();
00086 ~Addressee();
00087
00088 Addressee( const Addressee & );
00089 Addressee &operator=( const Addressee & );
00090
00091 bool operator==( const Addressee & ) const;
00092 bool operator!=( const Addressee & ) const;
00093
00097 bool isEmpty() const;
00098
00102 void setUid( const QString &uid );
00106 QString uid() const;
00110 static QString uidLabel();
00111
00112 --DECLARATIONS--
00118 void setNameFromString( const QString & );
00119
00124 QString realName() const;
00125
00129 QString assembledName() const;
00130
00137 QString fullEmail( const QString &email=QString::null ) const;
00138
00147 void insertEmail( const QString &email, bool preferred=false );
00148
00152 void removeEmail( const QString &email );
00153
00158 QString preferredEmail() const;
00159
00163 QStringList emails() const;
00164
00170 void setEmails( const QStringList& list);
00171
00176 void insertPhoneNumber( const PhoneNumber &phoneNumber );
00177
00182 void removePhoneNumber( const PhoneNumber &phoneNumber );
00183
00187 PhoneNumber phoneNumber( int type ) const;
00188
00192 PhoneNumber::List phoneNumbers() const;
00193
00197 PhoneNumber::List phoneNumbers( int type ) const;
00198
00202 PhoneNumber findPhoneNumber( const QString &id ) const;
00203
00208 void insertKey( const Key &key );
00209
00214 void removeKey( const Key &key );
00215
00222 Key key( int type, QString customTypeString = QString::null ) const;
00223
00227 Key::List keys() const;
00228
00233 void setKeys( const Key::List& keys);
00234
00241 Key::List keys( int type, QString customTypeString = QString::null ) const;
00242
00246 Key findKey( const QString &id ) const;
00247
00252 void insertAddress( const Address &address );
00253
00258 void removeAddress( const Address &address );
00259
00263 Address address( int type ) const;
00264
00268 Address::List addresses() const;
00269
00273 Address::List addresses( int type ) const;
00274
00278 Address findAddress( const QString &id ) const;
00279
00283 void insertCategory( const QString & );
00284
00288 void removeCategory( const QString & );
00289
00293 bool hasCategory( const QString & ) const;
00294
00298 void setCategories( const QStringList & );
00299
00303 QStringList categories() const;
00304
00313 void insertCustom( const QString &app, const QString &name,
00314 const QString &value );
00315
00319 void removeCustom( const QString &app, const QString &name );
00320
00324 QString custom( const QString &app, const QString &name ) const;
00325
00329 void setCustoms( const QStringList & );
00330
00334 QStringList customs() const;
00335
00339 static void parseEmailAddress( const QString &rawEmail, QString &fullName,
00340 QString &email );
00341
00345 void dump() const;
00346
00350 QString asString() const;
00351
00355 void setResource( Resource *resource );
00356
00360 Resource *resource() const;
00361
00365 void setChanged( bool value );
00366
00370 bool changed() const;
00371
00372 static void setSortKey( KABC::Field *field );
00373
00374 bool operator< ( const Addressee &addr );
00375
00376 private:
00377 void detach();
00378
00379 struct AddresseeData;
00380 mutable KSharedPtr<AddresseeData> mData;
00381
00382 private:
00383 static AddresseeData* shared_null;
00384 static AddresseeData* makeSharedNull();
00385 static KABC::Field *mSortField;
00386 };
00387
00388 KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
00389 KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
00390
00391 }
00392
00393 #endif
This file is part of the documentation for kabc Library Version 3.3.90.