D:/develop/v65/clients/outlook/install/output/export/funambol/clients/outlook/mainclientDll/src/include/outlook/ClientContact.h

00001  /*
00002  * Copyright (C) 2006-2007 Funambol, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 2 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
00011  * PURPOSE.  See the GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00016  * 02111-1307  USA
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     // Methods to handle contact's picture.
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     // Returns a reference to the internal COM pointer.
00094     _ContactItemPtr& getCOMPtr();
00095 
00096 
00097     //
00098     // Client operations on the item.
00099     //
00100     int saveItem();
00101     int deleteItem();
00102     ClientItem* copyItem();
00103     //int moveItem(ClientFolder* destFolder);
00104 
00105 
00107     bool createdAnniversaryEvent();
00109     bool createdBirthdayEvent();
00110 };
00111 
00114 #endif

Generated on Fri Nov 9 12:21:26 2007 for Funambol Outlook Plug-in Library by  doxygen 1.5.2