addressee.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KABC_ADDRESSEE_H
00023 #define KABC_ADDRESSEE_H
00024
00025 #include <qdatetime.h>
00026 #include <qstring.h>
00027 #include <qstringlist.h>
00028 #include <qvaluelist.h>
00029
00030 #include <ksharedptr.h>
00031 #include <kurl.h>
00032
00033 #include "address.h"
00034 #include "agent.h"
00035 #include "geo.h"
00036 #include "key.h"
00037 #include "phonenumber.h"
00038 #include "picture.h"
00039 #include "secrecy.h"
00040 #include "sound.h"
00041 #include "timezone.h"
00042
00043 namespace KABC {
00044
00045 class Resource;
00046 class Field;
00047 class SortMode;
00048
00075 class KABC_EXPORT Addressee
00076 {
00077 friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
00078 friend KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
00079
00080 public:
00081 typedef QValueList<Addressee> List;
00082 typedef QMap<QString, Addressee> Map;
00083
00087 Addressee();
00088 ~Addressee();
00089
00090 Addressee( const Addressee & );
00091 Addressee &operator=( const Addressee & );
00092
00093 bool operator==( const Addressee & ) const;
00094 bool operator!=( const Addressee & ) const;
00095
00099 bool isEmpty() const;
00100
00104 void setUid( const QString &uid );
00108 QString uid() const;
00112 static QString uidLabel();
00113
00117 void setName( const QString &name );
00121 QString name() const;
00125 static QString nameLabel();
00126
00130 void setFormattedName( const QString &formattedName );
00134 QString formattedName() const;
00138 static QString formattedNameLabel();
00139
00143 void setFamilyName( const QString &familyName );
00147 QString familyName() const;
00151 static QString familyNameLabel();
00152
00156 void setGivenName( const QString &givenName );
00160 QString givenName() const;
00164 static QString givenNameLabel();
00165
00169 void setAdditionalName( const QString &additionalName );
00173 QString additionalName() const;
00177 static QString additionalNameLabel();
00178
00182 void setPrefix( const QString &prefix );
00186 QString prefix() const;
00190 static QString prefixLabel();
00191
00195 void setSuffix( const QString &suffix );
00199 QString suffix() const;
00203 static QString suffixLabel();
00204
00208 void setNickName( const QString &nickName );
00212 QString nickName() const;
00216 static QString nickNameLabel();
00217
00221 void setBirthday( const QDateTime &birthday );
00225 QDateTime birthday() const;
00229 static QString birthdayLabel();
00230
00234 static QString homeAddressStreetLabel();
00235
00239 static QString homeAddressLocalityLabel();
00240
00244 static QString homeAddressRegionLabel();
00245
00249 static QString homeAddressPostalCodeLabel();
00250
00254 static QString homeAddressCountryLabel();
00255
00259 static QString homeAddressLabelLabel();
00260
00264 static QString businessAddressStreetLabel();
00265
00269 static QString businessAddressLocalityLabel();
00270
00274 static QString businessAddressRegionLabel();
00275
00279 static QString businessAddressPostalCodeLabel();
00280
00284 static QString businessAddressCountryLabel();
00285
00289 static QString businessAddressLabelLabel();
00290
00294 static QString homePhoneLabel();
00295
00299 static QString businessPhoneLabel();
00300
00304 static QString mobilePhoneLabel();
00305
00309 static QString homeFaxLabel();
00310
00314 static QString businessFaxLabel();
00315
00319 static QString carPhoneLabel();
00320
00324 static QString isdnLabel();
00325
00329 static QString pagerLabel();
00330
00334 static QString emailLabel();
00335
00339 void setMailer( const QString &mailer );
00343 QString mailer() const;
00347 static QString mailerLabel();
00348
00352 void setTimeZone( const TimeZone &timeZone );
00356 TimeZone timeZone() const;
00360 static QString timeZoneLabel();
00361
00365 void setGeo( const Geo &geo );
00369 Geo geo() const;
00373 static QString geoLabel();
00374
00378 void setTitle( const QString &title );
00382 QString title() const;
00386 static QString titleLabel();
00387
00391 void setRole( const QString &role );
00395 QString role() const;
00399 static QString roleLabel();
00400
00404 void setOrganization( const QString &organization );
00408 QString organization() const;
00412 static QString organizationLabel();
00413
00417 void setNote( const QString ¬e );
00421 QString note() const;
00425 static QString noteLabel();
00426
00430 void setProductId( const QString &productId );
00434 QString productId() const;
00438 static QString productIdLabel();
00439
00443 void setRevision( const QDateTime &revision );
00447 QDateTime revision() const;
00451 static QString revisionLabel();
00452
00456 void setSortString( const QString &sortString );
00460 QString sortString() const;
00464 static QString sortStringLabel();
00465
00469 void setUrl( const KURL &url );
00473 KURL url() const;
00477 static QString urlLabel();
00478
00482 void setSecrecy( const Secrecy &secrecy );
00486 Secrecy secrecy() const;
00490 static QString secrecyLabel();
00491
00495 void setLogo( const Picture &logo );
00499 Picture logo() const;
00503 static QString logoLabel();
00504
00508 void setPhoto( const Picture &photo );
00512 Picture photo() const;
00516 static QString photoLabel();
00517
00521 void setSound( const Sound &sound );
00525 Sound sound() const;
00529 static QString soundLabel();
00530
00534 void setAgent( const Agent &agent );
00538 Agent agent() const;
00542 static QString agentLabel();
00543
00549 void setNameFromString( const QString & );
00550
00555 QString realName() const;
00556
00560 QString assembledName() const;
00561
00568 QString fullEmail( const QString &email=QString::null ) const;
00569
00578 void insertEmail( const QString &email, bool preferred=false );
00579
00583 void removeEmail( const QString &email );
00584
00589 QString preferredEmail() const;
00590
00594 QStringList emails() const;
00595
00601 void setEmails( const QStringList& list);
00602
00607 void insertPhoneNumber( const PhoneNumber &phoneNumber );
00608
00613 void removePhoneNumber( const PhoneNumber &phoneNumber );
00614
00618 PhoneNumber phoneNumber( int type ) const;
00619
00623 PhoneNumber::List phoneNumbers() const;
00624
00628 PhoneNumber::List phoneNumbers( int type ) const;
00629
00633 PhoneNumber findPhoneNumber( const QString &id ) const;
00634
00639 void insertKey( const Key &key );
00640
00645 void removeKey( const Key &key );
00646
00653 Key key( int type, QString customTypeString = QString::null ) const;
00654
00658 Key::List keys() const;
00659
00664 void setKeys( const Key::List& keys);
00665
00672 Key::List keys( int type, QString customTypeString = QString::null ) const;
00673
00677 Key findKey( const QString &id ) const;
00678
00683 void insertAddress( const Address &address );
00684
00689 void removeAddress( const Address &address );
00690
00694 Address address( int type ) const;
00695
00699 Address::List addresses() const;
00700
00704 Address::List addresses( int type ) const;
00705
00709 Address findAddress( const QString &id ) const;
00710
00714 void insertCategory( const QString & );
00715
00719 void removeCategory( const QString & );
00720
00724 bool hasCategory( const QString & ) const;
00725
00729 void setCategories( const QStringList & );
00730
00734 QStringList categories() const;
00735
00744 void insertCustom( const QString &app, const QString &name,
00745 const QString &value );
00746
00750 void removeCustom( const QString &app, const QString &name );
00751
00755 QString custom( const QString &app, const QString &name ) const;
00756
00760 void setCustoms( const QStringList & );
00761
00765 QStringList customs() const;
00766
00770 static void parseEmailAddress( const QString &rawEmail, QString &fullName,
00771 QString &email );
00772
00776 void dump() const;
00777
00781 QString asString() const;
00782
00786 void setResource( Resource *resource );
00787
00791 Resource *resource() const;
00792
00796 void setChanged( bool value );
00797
00801 bool changed() const;
00802
00803 static void setSortMode( KABC::SortMode *mode );
00804
00805 bool operator< ( const Addressee &addr );
00806
00807 private:
00808 void detach();
00809
00810 struct AddresseeData;
00811 mutable KSharedPtr<AddresseeData> mData;
00812
00813 private:
00814 static AddresseeData* shared_null;
00815 static AddresseeData* makeSharedNull();
00816 static KABC::SortMode *mSortMode;
00817 };
00818
00819 KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
00820 KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
00821
00822 }
00823
00824 #endif
|