#include <ClientAppException.h>
Public Member Functions | |
ClientAppException () | |
Constructor. | |
~ClientAppException () | |
Destructor. | |
void | setCOMPtr (ExceptionPtr &ptr) |
Set COM pointers to this object. | |
void | setCOMPtr (_AppointmentItemPtr &ptr) |
int | read () |
Read ALL properties from Outlook. | |
int | saveOccurrence () |
Save the exception to Outlook: save the modified occurrence. | |
int | deleteOccurrence () |
Save the exception to Outlook: delete the occurrence. | |
bool | isSaved () |
Returns true if this exception has already been saved. | |
const BOOL | getDeleted () |
Returns TRUE if this exception is deleted (occurrence deleted). | |
const DATE | getOriginalDate () |
void | setDeleted (const BOOL) |
void | setOriginalDate (DATE val) |
const std::wstring | getAppProperty (const std::wstring &propertyName) |
To quickly get occurrence properties defined in 'exAppointmentFields[]'. | |
int | setAppProperty (const std::wstring &propertyName, const std::wstring &propertyValue) |
To quickly set occurrence properties defined in 'exAppointmentFields[]'. | |
const std::wstring | getSubject () |
const std::wstring | getBody () |
const std::wstring | getLocation () |
const std::wstring | getStart () |
const std::wstring | getEnd () |
const std::wstring | getAllDayEvent () |
const std::wstring | getBusyStatus () |
const std::wstring | getReminderSet () |
const std::wstring | getReminderMinutesBeforeStart () |
const std::wstring | getImportance () |
void | setSubject (const std::wstring &val) |
void | setBody (const std::wstring &val) |
void | setLocation (const std::wstring &val) |
void | setStart (const std::wstring &val) |
void | setEnd (const std::wstring &val) |
void | setAllDayEvent (const std::wstring &val) |
void | setBusyStatus (const std::wstring &val) |
void | setReminderSet (const std::wstring &val) |
void | setReminderMinutesBeforeStart (const std::wstring &val) |
void | setImportance (const std::wstring &val) |
const std::wstring | formatOriginalDate (BOOL isAllDay, const std::wstring &start) |
Returns "OriginalDate" property in string format. | |
const std::wstring | formatOriginalDate () |
Returns the 'OriginalDate' property of this exception in string format. | |
Private Attributes | |
ExceptionPtr | pException |
the exception | |
_AppointmentItemPtr | pAppointment |
the occurrence of the exception (an appointment item) | |
std::wstring | subject |
std::wstring | body |
std::wstring | location |
std::wstring | start |
std::wstring | end |
std::wstring | allDayEvent |
std::wstring | busyStatus |
std::wstring | reminderSet |
std::wstring | reminderMinutesBeforeStart |
std::wstring | importance |
DATE | originalDate |
BOOL | deleted |
bool | isUpdated |
Internal use: true if values are updated with Outlook. | |
bool | saved |
Internal use: true if this exception has been saved to Outlook. |
To get appointment exceptions (READ) call 'read()' and use 'getException(index)' methods of ClientRecurrence and browse through the list of exceptions. To set an appointment exception (WRITE) set all properties and then call 'saveAllExceptions()' method of ClientRecurrence.
int ClientAppException::deleteOccurrence | ( | ) |
Save the exception to Outlook: delete the occurrence.
Deletes the occurrence from Outlook appointment.
Make sure the 'pAppointment' pointer has been correctly set before calling this method.
References pAppointment, and saved.
Referenced by ClientRecurrence::saveException().
const wstring ClientAppException::formatOriginalDate | ( | ) |
Returns the 'OriginalDate' property of this exception in string format.
Uses by default ALLDAY = TRUE.
const wstring ClientAppException::formatOriginalDate | ( | BOOL | isAllDay, | |
const std::wstring & | start | |||
) |
Returns "OriginalDate" property in string format.
Returns the 'OriginalDate' property of this exception in string format.
Uses the pException COM pointer (must be previously set). Throws a ClientException in case of errors.
isAllDay | : flag to know if the current appointment is an all-day event 0 -> NO ALL-DAY -> "YYYYMMDDThhmmssZ" (we use the specific date&time) 1 -> ALL-DAY -> "yyyyMMdd" (only the date is used) | |
start | : the "Start" property of current appointment this is necessary to correct the OriginalDate in case occurrence is deleted |
References doubleToSystemTime(), getDeleted(), systemTimeToDouble(), and USE_UTC.
Referenced by convertToSyncItem(), and ClientRecurrence::saveException().
const wstring ClientAppException::getAppProperty | ( | const std::wstring & | propertyName | ) |
To quickly get occurrence properties defined in 'exAppointmentFields[]'.
Returns the value of 'propertyName' of this exception.
These properties are retrieved from stored buffers (attributes of object).
propertyName | : the property name requested |
int ClientAppException::read | ( | ) |
Read ALL properties from Outlook.
Reads all properties from Outlook.
All data is stored into this object. First gets the exception properties ("OriginalDate" and "Deleted") if the exception already exist (already saved, or reading from Outlook). Then reads all occurrence properties from client (if the occurrence exists).
References doubleToSystemTime(), exAppointmentFields, isUpdated, pAppointment, pException, throwClientException(), throwClientFatalException(), USE_UTC, vBoolToBool(), and vBoolToBOOL().
Referenced by getDeleted().
int ClientAppException::saveOccurrence | ( | ) |
Save the exception to Outlook: save the modified occurrence.
Saves the occurrence into Outlook.
Makes sure the 'pAppointment' pointer has been correctly set before calling this method. All occurrence properties are retrieved from internal attributes.
References BOOLToVBool(), exAppointmentFields, pAppointment, saved, systemTimeToDouble(), and throwClientException().
int ClientAppException::setAppProperty | ( | const std::wstring & | propertyName, | |
const std::wstring & | propertyValue | |||
) |
To quickly set occurrence properties defined in 'exAppointmentFields[]'.
Sets the value of field 'propertyName' of this exception.
These properties are stored to buffers (object attributes). Properties will be put to Outlook when calling 'saveOccurrence()' method.
propertyName | : the property name to be set | |
propertyValue | : the property value |
void ClientAppException::setCOMPtr | ( | ExceptionPtr & | ptr | ) |
Set COM pointers to this object.
One of these two method MUST be called before using the class
References pAppointment, pException, and throwClientException().
Referenced by ClientRecurrence::getExceptionOnClient(), and ClientRecurrence::saveException().
bool ClientAppException::isUpdated [private] |
Internal use: true if values are updated with Outlook.
Used because all values need to be retrieved together, so this flag notifies when it's necessary to update properties.
Referenced by ClientAppException(), getDeleted(), and read().