00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_VCARDFORMATIMPL_H
00022 #define KABC_VCARDFORMATIMPL_H
00023
00024 #include <qstring.h>
00025 #include <qfile.h>
00026
00027 #include "address.h"
00028 #include "addressee.h"
00029
00030 #ifdef __CYGWIN__
00031 #include <vcard/include/VCard.h>
00032 #else
00033 #include <VCard.h>
00034 #endif
00035
00036 namespace KABC {
00037
00038 class AddressBook;
00039
00043 class KABC_EXPORT_DEPRECATED VCardFormatImpl
00044 {
00045 public:
00046 bool load( Addressee &, QFile *file );
00047 bool loadAll( AddressBook *, Resource *, QFile *file );
00048 void save( const Addressee &, QFile *file );
00049 void saveAll( AddressBook *, Resource *, QFile *file );
00050
00051 bool readFromString( const QString &vcard, Addressee &addr );
00052 bool writeToString( const Addressee &addressee, QString &vcard );
00053
00054 protected:
00055 bool loadAddressee( Addressee &, VCARD::VCard & );
00056 void saveAddressee( const Addressee &, VCARD::VCard *, bool intern );
00057
00058 void addTextValue (VCARD::VCard *, VCARD::EntityType, const QString & );
00059 QString readTextValue( VCARD::ContentLine * );
00060
00061 void addDateValue( VCARD::VCard *, VCARD::EntityType, const QDate & );
00062 QDate readDateValue( VCARD::ContentLine * );
00063
00064 void addDateTimeValue( VCARD::VCard *, VCARD::EntityType, const QDateTime & );
00065 QDateTime readDateTimeValue( VCARD::ContentLine * );
00066
00067 void addAddressValue( VCARD::VCard *, const Address & );
00068 Address readAddressValue( VCARD::ContentLine * );
00069
00070 void addLabelValue( VCARD::VCard *, const Address & );
00071
00072 void addTelephoneValue( VCARD::VCard *, const PhoneNumber & );
00073 PhoneNumber readTelephoneValue( VCARD::ContentLine * );
00074
00075 void addNValue( VCARD::VCard *, const Addressee & );
00076 void readNValue( VCARD::ContentLine *, Addressee & );
00077
00078 void addCustomValue( VCARD::VCard *, const QString & );
00079
00080 void addAddressParam( VCARD::ContentLine *, int );
00081 int readAddressParam( VCARD::ContentLine * );
00082
00083 void addGeoValue( VCARD::VCard *, const Geo & );
00084 Geo readGeoValue( VCARD::ContentLine * );
00085
00086 void addUTCValue( VCARD::VCard *, const TimeZone & );
00087 TimeZone readUTCValue( VCARD::ContentLine * );
00088
00089 void addClassValue( VCARD::VCard *, const Secrecy & );
00090 Secrecy readClassValue( VCARD::ContentLine * );
00091
00092 void addKeyValue( VCARD::VCard *, const Key & );
00093 Key readKeyValue( VCARD::ContentLine * );
00094
00095 void addPictureValue( VCARD::VCard *, VCARD::EntityType, const Picture &, const Addressee &, bool );
00096 Picture readPictureValue( VCARD::ContentLine *, VCARD::EntityType, const Addressee &addr );
00097
00098 void addSoundValue( VCARD::VCard *, const Sound &, const Addressee &, bool );
00099 Sound readSoundValue( VCARD::ContentLine *, const Addressee &addr );
00100
00101 void addAgentValue( VCARD::VCard *, const Agent & );
00102 Agent readAgentValue( VCARD::ContentLine * );
00103 };
00104
00105 }
00106 #endif