ClientItem Class Reference
[Items]

Wraps the generic Outlook item (could be any of the item types). More...

#include <ClientItem.h>

Inheritance diagram for ClientItem:
[legend]

List of all members.

Public Member Functions

 ClientItem ()
 Constructor.
virtual ~ClientItem ()
 Destructor.
const std::wstring & getID ()
const std::wstring & getType ()
const std::wstring & getParentPath ()
virtual int saveItem ()=0
virtual int deleteItem ()=0
virtual ClientItemcopyItem ()=0
const int getPropertiesCount ()
const int getPropertiesIndex ()
const std::wstring getProperty (const std::wstring &propertyName)
 To retrieve a property value from its name.
int setProperty (const std::wstring &propertyName, const std::wstring &propertyValue)
 To set a property value from its name.

Protected Member Functions

void createPropertyMap ()
 Creates the Property Map: <propertyName, propertyIndex> ----------------------------------------------------------- Creates the corrispondence of each property with the index of the same property stored in Outlook.
const std::wstring convertPropertyName (const std::wstring &SIFName)
 Convert SIF property name into Outlook property name.
virtual bool isSecureProperty (const std::wstring &propertyName)=0
virtual bool isComplexProperty (const std::wstring &propertyName)=0
const std::wstring getSimpleProperty (const std::wstring &propertyName)
 Returns the Item property value from the propertiesIndex (class member).
virtual const std::wstring getSafeProperty (const std::wstring &propertyName)=0
virtual const std::wstring getComplexProperty (const std::wstring &propertyName)=0
int setSimpleProperty (const std::wstring &propertyName, const std::wstring &propertyValue)
virtual int setComplexProperty (const std::wstring &propertyName, const std::wstring &propertyValue)=0

Protected Attributes

std::wstring ID
 The item entry-ID.
std::wstring itemType
 The item-type of the item (contact/task/mail.
std::wstring parentPath
 The full path of parent folder.
std::map< std::wstring, int > propertyMap
 Map of item properties: <name, index>.
int propertiesCount
int propertiesIndex
ItemPropertiesPtr pItemProperties
 Pointers to microsoft outlook objects.
ItemPropertyPtr pItemProperty
HRESULT hr
 Result of COM pointers operations.


Detailed Description

Wraps the generic Outlook item (could be any of the item types).

Methods to get/set simple item properties are defined here, more specific properties are retrieved using the implemented methods in each Client object. Class methods automatically catch and manage COM pointers exceptions. Class methods throw ClientException pointer in case of error.


Member Function Documentation

const wstring ClientItem::convertPropertyName ( const std::wstring &  SIFName  )  [protected]

Convert SIF property name into Outlook property name.

Uses the vector 'diffPropertyNames' with correspondances. If property not found, it means that the name is the same.

Referenced by getProperty(), and setProperty().

void ClientItem::createPropertyMap (  )  [protected]

Creates the Property Map: <propertyName, propertyIndex> ----------------------------------------------------------- Creates the corrispondence of each property with the index of the same property stored in Outlook.

This method should be called only once, when item accessed for the first time.

References pItemProperties, propertyMap, and throwClientFatalException().

Referenced by getProperty(), and setProperty().

const wstring ClientItem::getProperty ( const std::wstring &  propertyName  ) 

To retrieve a property value from its name.

Returns the item property value from the property name.

PropertyMap is used to get the index of selected property, then different methods are called to retrieve the correct property value: 1. getSafeProperty -> for properties with security patch protection 2. getComplexProperty -> for properties that need specific conversion 3. getSimpleProperty -> for all other properties

Parameters:
propertyName the name of the property
Returns:
the value of the property (wstring)

References convertPropertyName(), createPropertyMap(), getSimpleProperty(), propertyMap, and throwClientException().

Referenced by convertToSyncItem(), WindowsSyncSource::deleteAppointment(), DateFilter::execute(), getSafeItemName(), WindowsSyncSource::manageModificationsFromLastSync(), and setRecurrenceExceptions().

const wstring ClientItem::getSimpleProperty ( const std::wstring &  propertyName  )  [protected]

Returns the Item property value from the propertiesIndex (class member).

Used for normal properties, simple copy into a string value.

Parameters:
propertyName the name of the property
Returns:
the value retrieved

References pItemProperties, and throwClientException().

Referenced by getProperty().

int ClientItem::setProperty ( const std::wstring &  propertyName,
const std::wstring &  propertyValue 
)

To set a property value from its name.

Set the item property value for the specific property name.

PropertyMap is used to get the index of selected property.

Parameters:
propertyName the name of the property
propertyValue the value to store
Returns:
0 if no errors, 1 if errors

References convertPropertyName(), createPropertyMap(), propertyMap, and throwClientException().

Referenced by fillClientItem(), and setRecurrenceExceptions().


Member Data Documentation

std::wstring ClientItem::ID [protected]

std::wstring ClientItem::itemType [protected]

The item-type of the item (contact/task/mail.

..)


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