00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef INCL_CLIENTCONTACT
00037 #define INCL_CLIENTCONTACT
00038
00043 #include "outlook/defs.h"
00044
00045 #include <string>
00046
00047
00048 class ClientFolder;
00049
00050
00051 class ClientItem;
00052
00054 #define PICTURE_OUTLOOK_NAME L"ContactPicture.jpg"
00055 #define PICTURE_TMP_NAME L"~pic-tmp.jpg"
00056
00062 class ClientContact : public ClientItem {
00063
00064 private:
00065
00067 _ContactItemPtr pContact;
00068
00070 Redemption::ISafeContactItemPtr pSafeContact;
00071
00073 bool willCreateAnniversaryEvent;
00074 bool willCreateBirthdayEvent;
00075
00077 static std::wstring tmpPicturePath;
00078
00079
00080 void createSafeContactInstance();
00081
00082 bool isSecureProperty (const std::wstring& propertyName);
00083 bool isComplexProperty(const std::wstring& propertyName);
00084
00085 const std::wstring getSafeProperty (const std::wstring& propertyName);
00086 const std::wstring getComplexProperty(const std::wstring& propertyName);
00087
00088 int setComplexProperty(const std::wstring& propertyName, const std::wstring& propertyValue);
00089
00091 const std::wstring getCorrectNameValue(const std::wstring& name, const std::wstring& fullName);
00092
00093
00094 WCHAR* getPictureFromFile(const std::wstring& filename);
00095 char* encodeWithSpaces(const char *msg, int len);
00096 int savePictureToFile(const std::wstring& b64content, const std::wstring& filename);
00097
00098
00099 StringBuffer* addressStreet;
00100 StringBuffer* addressExtended;
00101 bool findAddressStreet;
00102 bool findAddressExtended;
00103
00104 public:
00105
00107 ClientContact();
00108 ClientContact(const ClientContact& c);
00109 ClientContact operator=(const ClientContact& c);
00110
00112 ~ClientContact();
00113
00115 void setCOMPtr(_ContactItemPtr& ptr, const std::wstring& itemID);
00116 void setCOMPtr(_ContactItemPtr& ptr);
00117
00118
00119 _ContactItemPtr& getCOMPtr();
00120
00121
00122
00123
00124
00125 int saveItem();
00126 int deleteItem();
00127 ClientItem* copyItem();
00128 int moveItem(ClientFolder* destFolder);
00129
00130
00132 bool createdAnniversaryEvent();
00134 bool createdBirthdayEvent();
00135 };
00136
00139 #endif