00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef INCL_CLIENTCONTACT
00020 #define INCL_CLIENTCONTACT
00021
00026 #include "outlook/defs.h"
00027 #include "outlook/ClientItem.h"
00028
00029 #include <string>
00030
00031
00033 #define PICTURE_OUTLOOK_NAME L"ContactPicture.jpg"
00034 #define PICTURE_TMP_NAME L"~pic-tmp.jpg"
00035
00036
00037
00043 class ClientContact : public ClientItem {
00044
00045 private:
00046
00048 _ContactItemPtr pContact;
00049
00051 Redemption::ISafeContactItemPtr pSafeContact;
00052
00054 bool willCreateAnniversaryEvent;
00055 bool willCreateBirthdayEvent;
00056
00058 static std::wstring tmpPicturePath;
00059
00060
00061 void createSafeContactInstance();
00062
00063 bool isSecureProperty (const std::wstring& propertyName);
00064 bool isComplexProperty(const std::wstring& propertyName);
00065
00066 const std::wstring getSafeProperty (const std::wstring& propertyName);
00067 const std::wstring getComplexProperty(const std::wstring& propertyName);
00068
00069 int setComplexProperty(const std::wstring& propertyName, const std::wstring& propertyValue);
00070
00072 const std::wstring getCorrectNameValue(const std::wstring& name, const std::wstring& fullName);
00073
00074
00075 WCHAR* getPictureFromFile(const std::wstring& filename);
00076 char* encodeWithSpaces(const char *msg, int len);
00077 int savePictureToFile(const std::wstring& b64content, const std::wstring& filename);
00078
00079 public:
00080
00082 ClientContact();
00083 ClientContact(const ClientContact& c);
00084 ClientContact operator=(const ClientContact& c);
00085
00087 ~ClientContact();
00088
00090 void setCOMPtr(_ContactItemPtr& ptr, const std::wstring& itemID);
00091 void setCOMPtr(_ContactItemPtr& ptr);
00092
00093
00094 _ContactItemPtr& getCOMPtr();
00095
00096
00097
00098
00099
00100 int saveItem();
00101 int deleteItem();
00102 ClientItem* copyItem();
00103
00104
00105
00107 bool createdAnniversaryEvent();
00109 bool createdBirthdayEvent();
00110 };
00111
00114 #endif