#include <ClientItem.h>
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 ClientItem * | copyItem ()=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. |
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.
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
propertyName | the name of the property |
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.
propertyName | the name of the property |
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.
propertyName | the name of the property | |
propertyValue | the value to store |
References convertPropertyName(), createPropertyMap(), propertyMap, and throwClientException().
Referenced by fillClientItem(), and setRecurrenceExceptions().
std::wstring ClientItem::ID [protected] |
The item entry-ID.
Referenced by ClientItem(), ClientTask::setCOMPtr(), ClientNote::setCOMPtr(), ClientContact::setCOMPtr(), and ClientAppointment::setCOMPtr().
std::wstring ClientItem::itemType [protected] |
The item-type of the item (contact/task/mail.
..)