kabc
addressee.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KABC_ADDRESSEE_SRC_H
00023 #define KABC_ADDRESSEE_SRC_H
00024
00025 #include <QtCore/QDateTime>
00026 #include <QtCore/QStringList>
00027 #include <QtCore/QSharedDataPointer>
00028
00029 #include <kurl.h>
00030
00031 #include "address.h"
00032 #include "geo.h"
00033 #include "key.h"
00034 #include "phonenumber.h"
00035 #include "picture.h"
00036 #include "secrecy.h"
00037 #include "sound.h"
00038 #include "timezone.h"
00039 #include "addresseelist.h"
00040
00041 namespace KABC {
00042
00043 class Resource;
00044 class SortMode;
00045
00072 class KABC_EXPORT Addressee
00073 {
00074 friend KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
00075 friend KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
00076
00077 public:
00081 typedef AddresseeList List;
00087 typedef QMap<QString, Addressee> Map;
00088
00092 Addressee();
00093
00097 ~Addressee();
00098
00102 Addressee( const Addressee & );
00103
00109 Addressee &operator=( const Addressee & );
00110
00117 bool operator==( const Addressee & ) const;
00118
00125 bool operator!=( const Addressee & ) const;
00126
00130 bool isEmpty() const;
00131
00137 void setUid( const QString &uid );
00141 QString uid() const;
00145 static QString uidLabel();
00146
00150 void setName( const QString &name );
00154 QString name() const;
00158 static QString nameLabel();
00159
00163 void setFormattedName( const QString &formattedName );
00167 QString formattedName() const;
00171 static QString formattedNameLabel();
00172
00176 void setFamilyName( const QString &familyName );
00180 QString familyName() const;
00184 static QString familyNameLabel();
00185
00189 void setGivenName( const QString &givenName );
00193 QString givenName() const;
00197 static QString givenNameLabel();
00198
00202 void setAdditionalName( const QString &additionalName );
00206 QString additionalName() const;
00210 static QString additionalNameLabel();
00211
00215 void setPrefix( const QString &prefix );
00219 QString prefix() const;
00223 static QString prefixLabel();
00224
00228 void setSuffix( const QString &suffix );
00232 QString suffix() const;
00236 static QString suffixLabel();
00237
00241 void setNickName( const QString &nickName );
00245 QString nickName() const;
00249 static QString nickNameLabel();
00250
00254 void setBirthday( const QDateTime &birthday );
00258 QDateTime birthday() const;
00262 static QString birthdayLabel();
00263
00267 static QString homeAddressStreetLabel();
00268
00272 static QString homeAddressPostOfficeBoxLabel();
00273
00277 static QString homeAddressLocalityLabel();
00278
00282 static QString homeAddressRegionLabel();
00283
00287 static QString homeAddressPostalCodeLabel();
00288
00292 static QString homeAddressCountryLabel();
00293
00297 static QString homeAddressLabelLabel();
00298
00302 static QString businessAddressStreetLabel();
00303
00307 static QString businessAddressPostOfficeBoxLabel();
00308
00312 static QString businessAddressLocalityLabel();
00313
00317 static QString businessAddressRegionLabel();
00318
00322 static QString businessAddressPostalCodeLabel();
00323
00327 static QString businessAddressCountryLabel();
00328
00332 static QString businessAddressLabelLabel();
00333
00337 static QString homePhoneLabel();
00338
00342 static QString businessPhoneLabel();
00343
00347 static QString mobilePhoneLabel();
00348
00352 static QString homeFaxLabel();
00353
00357 static QString businessFaxLabel();
00358
00362 static QString carPhoneLabel();
00363
00367 static QString isdnLabel();
00368
00372 static QString pagerLabel();
00373
00377 static QString emailLabel();
00378
00382 void setMailer( const QString &mailer );
00386 QString mailer() const;
00390 static QString mailerLabel();
00391
00395 void setTimeZone( const TimeZone &timeZone );
00399 TimeZone timeZone() const;
00403 static QString timeZoneLabel();
00404
00408 void setGeo( const Geo &geo );
00412 Geo geo() const;
00416 static QString geoLabel();
00417
00421 void setTitle( const QString &title );
00425 QString title() const;
00429 static QString titleLabel();
00430
00434 void setRole( const QString &role );
00438 QString role() const;
00442 static QString roleLabel();
00443
00447 void setOrganization( const QString &organization );
00451 QString organization() const;
00455 static QString organizationLabel();
00456
00460 void setDepartment( const QString &department );
00464 QString department() const;
00468 static QString departmentLabel();
00469
00473 void setNote( const QString ¬e );
00477 QString note() const;
00481 static QString noteLabel();
00482
00486 void setProductId( const QString &productId );
00490 QString productId() const;
00494 static QString productIdLabel();
00495
00499 void setRevision( const QDateTime &revision );
00503 QDateTime revision() const;
00507 static QString revisionLabel();
00508
00512 void setSortString( const QString &sortString );
00516 QString sortString() const;
00520 static QString sortStringLabel();
00521
00525 void setUrl( const KUrl &url );
00529 KUrl url() const;
00533 static QString urlLabel();
00534
00538 void setSecrecy( const Secrecy &secrecy );
00542 Secrecy secrecy() const;
00546 static QString secrecyLabel();
00547
00551 void setLogo( const Picture &logo );
00555 Picture logo() const;
00559 static QString logoLabel();
00560
00564 void setPhoto( const Picture &photo );
00568 Picture photo() const;
00572 static QString photoLabel();
00573
00577 void setSound( const Sound &sound );
00581 Sound sound() const;
00585 static QString soundLabel();
00586
00592 void setNameFromString( const QString & );
00593
00598 QString realName() const;
00599
00603 QString assembledName() const;
00604
00611 QString fullEmail( const QString &email=QString() ) const;
00612
00621 void insertEmail( const QString &email, bool preferred=false );
00622
00628 void removeEmail( const QString &email );
00629
00634 QString preferredEmail() const;
00635
00639 QStringList emails() const;
00640
00646 void setEmails( const QStringList& list);
00647
00654 void insertPhoneNumber( const PhoneNumber &phoneNumber );
00655
00662 void removePhoneNumber( const PhoneNumber &phoneNumber );
00663
00669 PhoneNumber phoneNumber( PhoneNumber::Type type ) const;
00670
00674 PhoneNumber::List phoneNumbers() const;
00675
00681 PhoneNumber::List phoneNumbers( PhoneNumber::Type type ) const;
00682
00689 PhoneNumber findPhoneNumber( const QString &id ) const;
00690
00697 void insertKey( const Key &key );
00698
00705 void removeKey( const Key &key );
00706
00717 Key key( Key::Type type, QString customTypeString = QString() ) const;
00718
00722 Key::List keys() const;
00723
00728 void setKeys( const Key::List& keys);
00729
00740 Key::List keys( Key::Type type, QString customTypeString = QString() ) const;
00741
00747 Key findKey( const QString &id ) const;
00748
00755 void insertAddress( const Address &address );
00756
00763 void removeAddress( const Address &address );
00764
00770 Address address( Address::Type type ) const;
00771
00775 Address::List addresses() const;
00776
00782 Address::List addresses( Address::Type type ) const;
00783
00789 Address findAddress( const QString &id ) const;
00790
00794 void insertCategory( const QString & );
00795
00799 void removeCategory( const QString & );
00800
00804 bool hasCategory( const QString & ) const;
00805
00809 void setCategories( const QStringList & );
00810
00814 QStringList categories() const;
00815
00828 void insertCustom( const QString &app, const QString &name,
00829 const QString &value );
00830
00837 void removeCustom( const QString &app, const QString &name );
00838
00845 QString custom( const QString &app, const QString &name ) const;
00846
00850 void setCustoms( const QStringList & );
00851
00855 QStringList customs() const;
00856
00864 static void parseEmailAddress( const QString &rawEmail, QString &fullName,
00865 QString &email );
00866
00870 QString toString() const;
00871
00877 void setResource( Resource *resource );
00878
00882 Resource *resource() const;
00883
00889 void setChanged( bool value );
00890
00894 bool changed() const;
00895
00904 static void setSortMode( KABC::SortMode *mode );
00905
00913 bool operator< ( const Addressee &addr ) const;
00914
00918 static QString mimeType();
00919
00920 private:
00921 class Private;
00922 QSharedDataPointer<Private> d;
00923 };
00924 #ifdef MAKE_KABC_LIB
00925 KDE_DUMMY_QHASH_FUNCTION(Addressee)
00926 #endif
00927
00928 KABC_EXPORT QDataStream &operator<<( QDataStream &, const Addressee & );
00929 KABC_EXPORT QDataStream &operator>>( QDataStream &, Addressee & );
00930
00931 }
00932
00933 #endif