Modules | |
Static SIF Fields tables | |
VObject conversion functions | |
Functions | |
WinItem * | createWinItem (bool useSIF, const std::wstring itemType) |
Creates an empty WinItem object of the desired type (Client to Server). | |
WinItem * | createWinItem (bool useSIF, const std::wstring itemType, const std::wstring &data, const WCHAR **sifFields) |
Creates and fills a WinItem object of the desired type (Server to Client). | |
SyncItem * | convertToSyncItem (ClientItem *cItem, const char *dataType, const std::wstring &defaultFolder) |
ClientItem object -> SyncItem object (client to server). | |
int | fillClientItem (const std::wstring &sif, ClientItem *cItem, const std::wstring &itemType, const WCHAR *dataType) |
data string (SIF/VCard/. | |
WCHAR ** | getProperSifArray (const std::wstring &type) |
Utility to return the right pointer to the static WCHAR** array of SIF fields, given the 'type' itemType. | |
int | normalizeExceptions (ClientItem *cItem, itemKeyList &allItems, itemKeyList &allItemsPaths) |
int | deleteOccurrencesInInterval (const DATE startDate, const DATE originalDate, ClientRecurrence *cRec) |
Deletes all existing occurrences in the interval [startDate - originalDate[ , from ClientRecurrence object 'cRec'. | |
int | setRecurrenceExceptions (ClientItem *cItem, std::list< std::wstring > &excludeDates, std::list< std::wstring > &includeDates) |
Sets the appointment exceptions for the item passed (server to client). | |
int | checkIllegalXMLChars (char *data) |
Check for illegal XML chars inside 'data'. | |
std::wstring | getVPropertyValue (const std::wstring &dataString, const std::wstring &propertyName) |
Get a property value from a string formatted vCard / vCalendar. | |
void | replaceDefaultPath (std::wstring &path, const std::wstring &defaultFolder) |
Replaces the 'defaultFolder' string with "DEFAULT_FOLDER" inside 'path'. |
int checkIllegalXMLChars | ( | char * | data | ) |
Check for illegal XML chars inside 'data'.
Chars < 0x20 are converted to 0x20 (space) - preserved '' '
' ''.
data | [IN/OUT] the buffer to analyze |
Referenced by convertToSyncItem().
SyncItem* convertToSyncItem | ( | ClientItem * | cItem, | |
const char * | dataType, | |||
const wstring & | defaultFolder | |||
) |
ClientItem object -> SyncItem object (client to server).
SyncItem data is the string generated from all ClientItem properties. Data is converted into SIF or other mime types, based on 'dataType' parameter.
cItem | [INPUT] pointer to ClientItem | |
dataType | the mime type of data we want into the SyncItem (SIF/VCard/...) | |
defaultFolder | the default folder path for this syncsource |
References checkIllegalXMLChars(), createWinItem(), ClientAppException::formatOriginalDate(), ClientRecurrence::getException(), ClientRecurrence::getExceptionsCount(), WinEvent::getExcludeDates(), ClientItem::getID(), ClientApplication::getInstance(), ClientItem::getParentPath(), getProperSifArray(), ClientRecurrence::getProperty(), ClientItem::getProperty(), WinTask::getRecPattern(), ClientTask::getRecPattern(), WinEvent::getRecPattern(), ClientAppointment::getRecPattern(), ClientApplication::getTimezone(), ClientItem::getType(), ClientApplication::getVersion(), ClientAppointment::isAllDayEvent(), isSIF(), recurrenceFields, WinItem::removeElement(), replaceDefaultPath(), WinContact::setPhotoType(), WinItem::setProperty(), WinEvent::setTimezone(), and WinItem::toString().
Referenced by WindowsSyncSource::getFirstItem(), WindowsSyncSource::getFirstNewItem(), WindowsSyncSource::getFirstUpdatedItem(), WindowsSyncSource::getNextItem(), WindowsSyncSource::getNextNewItem(), and WindowsSyncSource::getNextUpdatedItem().
WinItem* createWinItem | ( | bool | useSIF, | |
const wstring | itemType, | |||
const wstring & | data, | |||
const WCHAR ** | sifFields | |||
) |
Creates and fills a WinItem object of the desired type (Server to Client).
Fills the WinItem map parsing the passed 'data' wstring.
useSIF | true if we use SIF data | |
itemType | the item type ("contact", "task", ...) | |
data | the data input string to parse | |
sifFields | pointer to the static array of SIF fields used |
References recurrenceFields.
WinItem* createWinItem | ( | bool | useSIF, | |
const wstring | itemType | |||
) |
Creates an empty WinItem object of the desired type (Client to Server).
useSIF | true if we use SIF data | |
itemType | the item type ("contact", "task", ...) |
Referenced by convertToSyncItem(), WindowsSyncSource::extractFolder(), and fillClientItem().
int deleteOccurrencesInInterval | ( | const DATE | startDate, | |
const DATE | originalDate, | |||
ClientRecurrence * | cRec | |||
) |
Deletes all existing occurrences in the interval [startDate - originalDate[ , from ClientRecurrence object 'cRec'.
When an occurrence is found in the given interval, a proper exception is added to 'cRec' (a 'deleted occurrence' exception).
startDate | : the start date (included in interval) | |
originalDate | : the original date (excluded from interval) | |
cRec | : the ClientRecurrence pointer to work on |
References ClientRecurrence::addException(), ClientRecurrence::getOccurrence(), ClientAppException::setDeleted(), and ClientAppException::setOriginalDate().
int fillClientItem | ( | const wstring & | data, | |
ClientItem * | cItem, | |||
const wstring & | itemType, | |||
const WCHAR * | dataType | |||
) |
data string (SIF/VCard/.
..) -> ClientItem (server to client). Fill the passed ClientItem object with all properties from 'data' string. Data is parsed from SIF or other mime types, based on 'dataType' parameter.
data | : the input string to read from | |
cItem | : [IN-OUT] the ClientItem object to fill | |
itemType | : the type of item (contact/task/...) | |
dataType | : the mime type of data sent by server |
References createWinItem(), WinEvent::getExcludeDates(), WinEvent::getIncludeDates(), getProperSifArray(), WinItem::getProperty(), WinTask::getRecPattern(), ClientTask::getRecPattern(), WinEvent::getRecPattern(), ClientAppointment::getRecPattern(), WinEvent::getTimezone(), WinEvent::hasTimezone(), isSIF(), recurrenceFields, ClientRecurrence::setHasTimezone(), ClientRecurrence::setProperty(), ClientItem::setProperty(), setRecurrenceExceptions(), ClientRecurrence::setRecurringTimezone(), and ClientAppointment::setRecurringTimezone().
Referenced by WindowsSyncSource::addItem(), and WindowsSyncSource::updateItem().
std::wstring getVPropertyValue | ( | const wstring & | dataString, | |
const wstring & | propertyName | |||
) |
Get a property value from a string formatted vCard / vCalendar.
Parses the string, and returns the property value from the passed name.
dataString | the input string (vCard/vCalendar) | |
propertyName | the name of property to retrieve |
void replaceDefaultPath | ( | wstring & | path, | |
const wstring & | defaultFolder | |||
) |
Replaces the 'defaultFolder' string with "DEFAULT_FOLDER" inside 'path'.
We need to temporary add a "\" char at the end, to avoid replacing folders names such as "\\Personal Folder\Contacts2" into "DEFAULT_FOLDER2".
path | the wstring to search (IN/OUT: it can be modified here) | |
defaultFolder | the wstring to search for |
Referenced by convertToSyncItem().
int setRecurrenceExceptions | ( | ClientItem * | cItem, | |
list< wstring > & | excludeDates, | |||
list< wstring > & | includeDates | |||
) |
Sets the appointment exceptions for the item passed (server to client).
Exceptions dates are passed with 2 lists 'escludeDates' and 'includeDates'. Each exception found is set into a ClientAppException object. Each ClientRecurrence object can have a list of ClientAppExceptions. All exceptions are finally saved to Outlook when calling the method 'save()' of the corrispondent ClientAppointment object.
cItem | : the ClientItem object to modify (it's an appointment) | |
excludeDates | : a list of exclude-dates (occurrences to delete) | |
includeDates | : a list of include-dates (occurrences to add) |
References ClientRecurrence::addException(), ClientItem::copyItem(), ClientItem::getID(), ClientItem::getParentPath(), ClientItem::getProperty(), ClientAppointment::getRecPattern(), getSafeItemName(), readDataPath(), ClientRecurrence::resetExceptions(), ClientItem::saveItem(), ClientAppException::setDeleted(), ClientAppException::setOriginalDate(), ClientItem::setProperty(), systemTimeToDouble(), and writeToFile().
Referenced by fillClientItem().