ClientContact Class Reference
[Items]

Wraps the Outlook contact object. More...

#include <ClientContact.h>

Inheritance diagram for ClientContact:
[legend]
Collaboration diagram for ClientContact:
[legend]

List of all members.

Public Member Functions

 ClientContact ()
 Constructor.
 ClientContact (const ClientContact &c)
ClientContact operator= (const ClientContact &c)
 ~ClientContact ()
 Destructor.
void setCOMPtr (_ContactItemPtr &ptr, const std::wstring &itemID)
 Set a COM pointer to this object: refresh all members.
void setCOMPtr (_ContactItemPtr &ptr)
_ContactItemPtr & getCOMPtr ()
 Returns a reference to the internal COM pointer.
int saveItem ()
int deleteItem ()
ClientItemcopyItem ()
 Returns a (new allocated) copy of this item.
bool createdAnniversaryEvent ()
 Returns true if a Anniversary event has been created silently by Outlook during saveItem().
bool createdBirthdayEvent ()
 Returns true if a Birthday event has been created silently by Outlook during saveItem().

Private Member Functions

void createSafeContactInstance ()
bool isSecureProperty (const std::wstring &propertyName)
 Moves this ClientContact into the passed destination folder.
bool isComplexProperty (const std::wstring &propertyName)
const std::wstring getSafeProperty (const std::wstring &propertyName)
const std::wstring getComplexProperty (const std::wstring &propertyName)
int setComplexProperty (const std::wstring &propertyName, const std::wstring &propertyValue)
const std::wstring getCorrectNameValue (const std::wstring &name, const std::wstring &fullName)
 Internal utility: get the correct format of firstName and lastName fields.
WCHAR * getPictureFromFile (const std::wstring &filename)
 Reads the picture file from disk (path = filename) and returns the file content encoded in base64, already splitted in lines of 72 chars.
char * encodeWithSpaces (const char *msg, int len)
 Encode the message in base64, splitting the result in lines of 72 columns each.
int savePictureToFile (const std::wstring &b64content, const std::wstring &filename)
 Save picture content to a file 'filename' on disk.

Private Attributes

_ContactItemPtr pContact
 Pointer to microsoft outlook objects.
Redemption::ISafeContactItemPtr pSafeContact
 Pointer to Redemption safe objects.
bool willCreateAnniversaryEvent
 Used to know if Outlook will automatically create events during saveItem().
bool willCreateBirthdayEvent
StringBuffer * addressStreet
StringBuffer * addressExtended
bool findAddressStreet
bool findAddressExtended

Static Private Attributes

static std::wstring tmpPicturePath = L""
 Where the picture is temporary saved.


Detailed Description

Wraps the Outlook contact object.

Implements methods to get/set specific properties for this object type.


Member Function Documentation

ClientItem * ClientContact::copyItem (  )  [virtual]

Returns a (new allocated) copy of this item.

Returns:
: a pointer to the new ClientItem object (must bee deleted by the caller). NULL in case of errors.

Implements ClientItem.

References ClientContact(), pContact, and setCOMPtr().

char * ClientContact::encodeWithSpaces ( const char *  msg,
int  len 
) [private]

Encode the message in base64, splitting the result in lines of 72 columns each.

Returns:
a new allocated char* buffer

Referenced by getPictureFromFile().

WCHAR * ClientContact::getPictureFromFile ( const std::wstring &  filename  )  [private]

Reads the picture file from disk (path = filename) and returns the file content encoded in base64, already splitted in lines of 72 chars.

Parameters:
filename the path of file to read from disk
Returns:
the b64 file content (a new allocated WCHAR* buffer)

References encodeWithSpaces().

bool ClientContact::isSecureProperty ( const std::wstring &  propertyName  )  [private, virtual]

Moves this ClientContact into the passed destination folder.

The move operation changes only the item location in Outlook, so the item's ID is preserved.

Parameters:
destFolder the destination ClientFolder to move this object to
Returns:
0 if no errors

Implements ClientItem.

References safeContactProps.

int ClientContact::savePictureToFile ( const std::wstring &  b64content,
const std::wstring &  filename 
) [private]

Save picture content to a file 'filename' on disk.

Picture content is passed in b64 format, will be trimmed and decoded.

Parameters:
b64content the file content in base64
filename the path of file to be saved
Returns:
0 if picture saved without errors


The documentation for this class was generated from the following files:

Generated on Tue Apr 6 13:00:41 2010 for Funambol Outlook Plug-in Library by  doxygen 1.5.7.1