Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __BARRY_SYNC_VCARD_H__
00023 #define __BARRY_SYNC_VCARD_H__
00024
00025 #include "dll.h"
00026 #include "vbase.h"
00027 #include "r_contact.h"
00028 #include <stdint.h>
00029 #include <string>
00030
00031 namespace Barry { namespace Sync {
00032
00033
00034
00035
00036
00037
00038
00039 class BXEXPORT vCard : public vBase
00040 {
00041
00042 char *m_gCardData;
00043
00044
00045 std::string m_vCardData;
00046 Barry::Contact m_BarryContact;
00047
00048 protected:
00049 void AddAddress(const char *rfc_type, const Barry::PostalAddress &addr);
00050 void AddCategories(const Barry::CategoryList &categories);
00051 void AddPhoneCond(const std::string &phone);
00052 void AddPhoneCond(const char *rfc_type, const std::string &phone);
00053
00054 void ParseAddress(vAttr &adr, Barry::PostalAddress &address);
00055 void ParseCategories(vAttr &cat, Barry::CategoryList &cats);
00056
00057 public:
00058 vCard();
00059 ~vCard();
00060
00061 const std::string& ToVCard(const Barry::Contact &con);
00062 const Barry::Contact& ToBarry(const char *vcal, uint32_t RecordId);
00063
00064 const std::string& GetVCard() const { return m_vCardData; }
00065 const Barry::Contact& GetBarryContact() const { return m_BarryContact; }
00066
00067 char* ExtractVCard();
00068
00069 void Clear();
00070
00071
00072 static const char* GetVName() { return "VCARD"; }
00073 };
00074
00075 }}
00076
00077 #endif
00078