Defines | |
#define | SYNCSOURCE_CALENDAR 1 |
Codes used by UI ("0" is the initialization). | |
#define | SYNCSOURCE_CONTACTS 2 |
#define | SYNCSOURCE_NOTES 3 |
#define | SYNCSOURCE_TASKS 4 |
#define | SYNCSOURCE_PICTURES 5 |
#define | TYPE_SKIPPED_ACTION 0 |
Used as mapping for the updates choice for the OpenMessageBox for the UI. | |
#define | TYPE_NOW_LATER_SKIP_OPTIONAL 1 |
#define | TYPE_NOW_LATER_RECCOMENDED 2 |
#define | TYPE_NOW_LATER_MANDATORY 3 |
#define | TYPE_NOW_EXIT_MANDATORY 4 |
Functions | |
int | TimedMessageBox (HWND hwndOwner, LPCTSTR pszMessage, LPCTSTR pszTitle, UINT flags, DWORD dwTimeout) |
TimedMessageBox. | |
int | safeMessageBox (const char *message, const char *title=NULL, unsigned int flags=0) |
Function used to display a message-box with a message for the user. | |
int | wsafeMessageBox (const WCHAR *wmessage, const WCHAR *wtitle=NULL, unsigned int flags=0) |
Function used to display a message-box with a message for the user. | |
_declspec (dllexport) void printLog(const char *msg | |
bool | isSIF (const std::wstring &dataType) |
Returns true if dataType is one of accepted SIF formats. | |
bool | isSIF (const std::string &dataType) |
Returns true if dataType is one of accepted SIF formats. | |
bool | isAcceptedDataType (const std::wstring &dataType) |
Returns true if dataType is one of accepted formats by Outlook plugin. | |
bool | isAcceptedDataType (const std::string &dataType) |
Returns true if dataType is one of accepted formats by Outlook plugin. | |
char * | syncModeName (SyncMode code) |
Returns the syncmode name given its code. | |
bool | isFullSyncMode (SyncMode mode) |
Returns true if the passed sync mode is a 'full sync mode' (slow sync, refresh from client, refresh from server). | |
void | toWindows (char *str) |
Convert the path in Windows format, changing the slashes in back-slashes. | |
WCHAR * | readAppDataPath () |
Returns the path of current user's application data folder. | |
WCHAR * | readDataPath (const WCHAR *itemType) |
Returns the path of file where data files for current user are stored. | |
int | makeDataDirs () |
Create directories for data files under 'application data' dir. | |
int | getWindowsUser (std::wstring &userName) |
Gets the Windows current user (the one now active). | |
int | getWindowsUserEx (std::wstring &userName) |
Gets the Windows current user (the one now active) in the extended format "Machine\User". | |
StringBuffer | getDefaultPicturesPath () |
Returns the default path to store pictures (shell folder 'pictures' for this user). | |
std::wstring | readFromFile (const std::wstring &filePath) |
Reads a file from filesystem and write its content into a string. | |
int | writeToFile (const std::wstring &content, const std::wstring &filePath, const WCHAR *mode=L"w") |
Write the passed string 'content' into a file on filesystem (wstring version). | |
int | writeToFile (const std::string &content, const std::string &filePath, const char *mode="w") |
Write the passed string 'content' into a file on filesystem (string version). | |
std::string | getSyncMutexName () |
Returns the syncMutex unique name: "fol-syncInProgress-xxxxxxx". | |
char * | readSystemErrorMsg (DWORD errorCode=0) |
Utility function to retrieve the correspondant message for a generic System error. | |
std::wstring | getSafeItemName (ClientItem *cItem) |
Returns a smart name of the item passed, used for log/debug or in case of errors. | |
void | printReport (SyncReport *sr, SyncSource **sources) |
Prints a smart synchronization report table into LOG file. | |
char * | friendlyName (const char *sourceName) |
Returns a friendly name for the passed syncsource name. | |
int | getBuildNumberFromVersion (const char *swv) |
Returns an integer value rapresenting the build number read from the string version passed (e.g. | |
long | variantTimeToTimeStamp (const double vTime) |
Variant time (double format) -> Timestamp (long format). | |
int | syncSourceNameToIndex (const StringBuffer &sourceName) |
StringBuffer | syncSourceIndexToName (const int sourceID) |
bool | isSourceVisibleA (const char *sourceName) |
Used to quicky check if a specific source is visible or not. | |
bool | isSourceVisible (const WCHAR *sourceName) |
Used to quicky check if a specific source is visible or not (WCHAR version). | |
int | countSourceVisible () |
Used to check the total number of sources visible. | |
bool | isSourceEnabled (const char *sourceName) |
Used to quicky check if a specific source is enabled or not, checking the configuration. | |
static bool | isErrorStatus (int status) |
Is the given status code an error status code? Error codes are the ones outside the range 200-299. | |
_declspec (dllexport) WindowsSyncSourceConfig *OutlookConfig | |
Return a pointer to the internal WindowsSyncSourceConfig object from its name (must NOT be freed by caller). | |
Variables | |
const char * | level = LOG_INFO) |
#define TYPE_SKIPPED_ACTION 0 |
Used as mapping for the updates choice for the OpenMessageBox for the UI.
With this code type we map the action and the message for the user for the update
_declspec | ( | dllexport | ) |
Return a pointer to the internal WindowsSyncSourceConfig object from its name (must NOT be freed by caller).
This method replaces 'getSyncSourceConfig()' of DMTClientConfig.
name | : the source name |
int countSourceVisible | ( | ) |
Used to check the total number of sources visible.
It checks the sourcesVisible array.
Referenced by CFullSync::adjustCheckboxes().
int getBuildNumberFromVersion | ( | const char * | swv | ) |
Returns an integer value rapresenting the build number read from the string version passed (e.g.
"6.1.12" -> 60112).
Referenced by OutlookConfig::decryptPrivateData(), and OutlookConfig::upgradeConfig().
std::wstring getSafeItemName | ( | ClientItem * | cItem | ) |
Returns a smart name of the item passed, used for log/debug or in case of errors.
Usually the "Subject" is returned (if present).
References ClientException::getErrorMsg(), ClientItem::getID(), and ClientItem::getProperty().
Referenced by WindowsSyncSource::addItem(), WindowsSyncSource::checkBirthdayAnniversary(), ClientTask::clearRecPattern(), ClientAppointment::clearRecPattern(), WindowsSyncSource::deleteItem(), WindowsSyncSource::getFirstItem(), WindowsSyncSource::getFirstNewItem(), WindowsSyncSource::getFirstUpdatedItem(), WindowsSyncSource::getNextItem(), WindowsSyncSource::getNextNewItem(), WindowsSyncSource::getNextUpdatedItem(), WindowsSyncSource::pushAllItemsToList(), WindowsSyncSource::removeAllItems(), setRecurrenceExceptions(), and WindowsSyncSource::updateItem().
std::string getSyncMutexName | ( | ) |
Returns the syncMutex unique name: "fol-syncInProgress-xxxxxxx".
"xxxxxxx" is the BeginSync timestamp, stored in win registry (HKCU). We don't use OutlookConfig object because the mutex name can be asked BEFORE the initialization of client (so config not yet available). So here we directly access to the win registry.
References SYNC_MUTEX_NAME.
Referenced by checkSyncInProgress(), and startSync().
int getWindowsUser | ( | wstring & | userName | ) |
Gets the Windows current user (the one now active).
[OUT] | the Windows current user |
References readSystemErrorMsg().
Referenced by getScheduledTaskName(), and upgradePlugin().
int getWindowsUserEx | ( | wstring & | userName | ) |
Gets the Windows current user (the one now active) in the extended format "Machine\User".
[OUT] | the Windows current user |
References readSystemErrorMsg().
Referenced by setScheduleTask().
bool isAcceptedDataType | ( | const string & | dataType | ) |
Returns true if dataType is one of accepted formats by Outlook plugin.
(string version)
bool isAcceptedDataType | ( | const wstring & | dataType | ) |
Returns true if dataType is one of accepted formats by Outlook plugin.
(wstring version)
Referenced by WindowsSyncSource::addItem(), and WindowsSyncSource::updateItem().
static bool isErrorStatus | ( | int | status | ) | [inline, static] |
Is the given status code an error status code? Error codes are the ones outside the range 200-299.
status | the status code to check |
Referenced by WindowsSyncSource::createOldItems().
bool isSIF | ( | const string & | dataType | ) |
Returns true if dataType is one of accepted SIF formats.
(string version)
bool isSIF | ( | const wstring & | dataType | ) |
Returns true if dataType is one of accepted SIF formats.
(wstring version)
Referenced by WindowsSyncSource::addItem(), convertToSyncItem(), WindowsSyncSource::extractFolder(), fillClientItem(), and WindowsSyncSource::updateItem().
bool isSourceEnabled | ( | const char * | sourceName | ) |
Used to quicky check if a specific source is enabled or not, checking the configuration.
If a source is disabled, it's greyed out in UI.
References OutlookConfig::getInstance(), OutlookConfig::getSyncSourceConfig(), and WindowsSyncSourceConfig::isEnabled().
Referenced by CFullSync::OnBnClickedRefreshS2C().
bool isSourceVisible | ( | const WCHAR * | sourceName | ) |
Used to quicky check if a specific source is visible or not (WCHAR version).
It checks the sourcesVisible array.
References isSourceVisibleA().
Referenced by getMainWindowSize(), and CSyncForm::refreshSource().
bool isSourceVisibleA | ( | const char * | sourceName | ) |
Used to quicky check if a specific source is visible or not.
It checks the sourcesVisible array.
Referenced by isSourceVisible().
int makeDataDirs | ( | ) |
Create directories for data files under 'application data' dir.
Referenced by WindowsSyncSource::endSync(), initLog(), and upgradePlugin().
void printReport | ( | SyncReport * | sr, | |
SyncSource ** | sources | |||
) |
Prints a smart synchronization report table into LOG file.
TODO: use SyncReport::toString() ?
References SyncSourceReport::checkState(), CLIENT, friendlyName(), SyncSource::getConfig(), WindowsSyncSource::getConfig(), WindowsSyncSourceConfig::getIsSynced(), PicturesSyncSource::getIsSynced(), SyncSourceReport::getItemReportAlreadyExistCount(), SyncSourceReport::getItemReportCount(), SyncSourceReport::getItemReportSuccessfulCount(), SyncSourceReport::getLastErrorCode(), SyncReport::getLastErrorCode(), SyncSourceReport::getLastErrorMsg(), SyncReport::getLastErrorMsg(), SyncSourceReport::getSourceName(), AbstractSyncSourceConfig::getSync(), SyncSource::getSyncMode(), SyncReport::getSyncSourceReport(), SyncReport::setLastErrorCode(), SyncReport::setLastErrorMsg(), and syncModeName().
Referenced by startSync().
WCHAR* readAppDataPath | ( | ) |
Returns the path of current user's application data folder.
For example: "C:\Documents And Settings\Settimio\Application Data" The string returned is allocated new, so MUST be freed by caller. Returns NULL in case of errors (set lastErrorMessage).
Referenced by ClientContact::ClientContact(), OutlookConfig::createDefaultConfig(), OutlookConfig::read(), and readDataPath().
WCHAR* readDataPath | ( | const WCHAR * | itemType | ) |
Returns the path of file where data files for current user are stored.
It is located under 'application data' folder. For example: "C:\Documents And Settings\Settimio\Application Data\Funambol\Outlook Client" The string returned is allocated new, so MUST be freed by caller. Returns NULL in case of errors (set lastErrorMessage).
References readAppDataPath().
Referenced by WindowsSyncSource::closeDataFile(), WindowsSyncSource::endSync(), WindowsSyncSource::manageModificationsFromLastSync(), WindowsSyncSource::resetDataFile(), and setRecurrenceExceptions().
std::wstring readFromFile | ( | const wstring & | filePath | ) |
Reads a file from filesystem and write its content into a string.
filePath | : the path of file to read |
Referenced by WindowsSyncSource::manageModificationsFromLastSync().
char* readSystemErrorMsg | ( | DWORD | errorCode | ) |
Utility function to retrieve the correspondant message for a generic System error.
Pointer returned is allocated new, must be freed by caller.
errorCode | : the code of error (obtained by 'getLastError()') |
Referenced by checkSyncInProgress(), deleteScheduleTask(), endSync(), exitSyncThread(), getScheduleTask(), getWindowsUser(), getWindowsUserEx(), hardTerminateSync(), setScheduleTask(), OutlookConfig::setUniqueDevID(), startSync(), and upgradePlugin().
int safeMessageBox | ( | const char * | message, | |
const char * | title, | |||
unsigned int | flags | |||
) |
Function used to display a message-box with a message for the user.
The message-box is displayed only if this is NOT a scheduled sync (otherwise the message will be redirected to LOG file)
message | : the message to display | |
title | : [OPTIONAL] the title of the message box (default = MSGBOX_ERROR_TITLE) | |
flags | : [OPTIONAL] flags for the message-box (default = MB_OK | MB_ICONEXCLAMATION) |
References OutlookConfig::getInstance(), and OutlookConfig::getScheduledSync().
Referenced by OutlookConfig::addWindowsSyncSourceConfig(), OutlookConfig::createDefaultConfig(), initializeClient(), initLog(), manageClientException(), ClientApplication::pickFolder(), and OutlookConfig::read().
int TimedMessageBox | ( | HWND | hwndOwner, | |
LPCTSTR | pszMessage, | |||
LPCTSTR | pszTitle, | |||
UINT | flags, | |||
DWORD | dwTimeout | |||
) |
TimedMessageBox.
The same as the standard MessageBox, except that TimedMessageBox also accepts a timeout. If the user does not respond within the specified timeout, the value 0 is returned instead of one of the ID* values.
Referenced by WindowsSyncClient::continueAfterPrepareSync().
void toWindows | ( | char * | str | ) |
Convert the path in Windows format, changing the slashes in back-slashes.
str | - [IN-OUT] the string to convert |
long variantTimeToTimeStamp | ( | const double | vTime | ) |
Variant time (double format) -> Timestamp (long format).
NOTE: the internal call 'mktime()' adjusts time to UTC... this is OK because timestamps always refer to UTC time.
vTime | : input time in variant format (milliseconds from Jan 1 1900) |
Referenced by WindowsSyncSource::manageModificationsFromLastSync().
int writeToFile | ( | const string & | content, | |
const string & | filePath, | |||
const char * | mode | |||
) |
Write the passed string 'content' into a file on filesystem (string version).
If file not found, it is created.
content | : the string to write | |
filePath | : path of file to write | |
mode | : [OPTIONAL] mode of writing (default = "w" = writing, content destroyed) |
int writeToFile | ( | const wstring & | content, | |
const wstring & | filePath, | |||
const WCHAR * | mode | |||
) |
Write the passed string 'content' into a file on filesystem (wstring version).
If file not found, it is created.
content | : the string to write | |
filePath | : path of file to write | |
mode | : [OPTIONAL] mode of writing (default = "w" = writing, content destroyed) |
Referenced by WindowsSyncSource::closeDataFile(), WindowsSyncSource::endSync(), initLog(), WindowsSyncSource::resetDataFile(), and setRecurrenceExceptions().
int wsafeMessageBox | ( | const WCHAR * | wmessage, | |
const WCHAR * | wtitle, | |||
unsigned int | flags | |||
) |
Function used to display a message-box with a message for the user.
(WCHAR version) The message-box is displayed only if this is NOT a scheduled sync (otherwise the message will be redirected to LOG file)
message | : the message to display | |
title | : [OPTIONAL] the title of the message box (default = MSGBOX_ERROR_TITLE) | |
flags | : [OPTIONAL] flags for the message-box (default = MB_OK | MB_ICONEXCLAMATION) |
References OutlookConfig::getInstance(), and OutlookConfig::getScheduledSync().
Referenced by manageSyncErrorMsg(), and CSyncForm::refreshSource().