#include <OutlookConfig.h>
Inheritance diagram for OutlookConfig:
Public Member Functions | |
~OutlookConfig () | |
Destructor. | |
BOOL | read () |
Read the configuration from Windows registry into this object. | |
BOOL | save () |
BOOL | save (SyncReport *report) |
Save the configuration from this object into Windows registry. | |
void | readSourcesTimestamps () |
Read all sources timestamps from win registry. | |
_declspec (dllexport) WindowsSyncSourceConfig *getSyncSourceConfig(const char *name) | |
Replace getSyncSourceConfig() of DMT (return specific winSourceConfig). | |
WindowsSyncSourceConfig * | getSyncSourceConfig (unsigned int i) |
Return a pointer to the internal WindowsSyncSourceConfig object from its index in winSourceConfigs array (must NOT be freed by caller). | |
BOOL | setSyncSourceConfig (WindowsSyncSourceConfig &wsc) |
Set the passed WindowsSyncSourceConfig object into the correspondent object inside 'winSourceConfigs' array. | |
BOOL | addSyncSourceConfig (WindowsSyncSourceConfig &wsc) |
Adds the passed WindowsSyncSourceConfig. | |
void | setWorkingDir (const char *v) |
void | setLogDir (const char *v) |
void | setFullSync (const bool v) |
void | setScheduledSync (const bool v) |
Save the value to win registry (HKCU), because it can be required from a different instance of plugin. | |
void | setAbortSync (const bool v) |
const bool | getScheduledSync () const |
Retrieve from win registry (HKCU). | |
const bool | getAbortSync () const |
_declspec (dllexport) const char *getWorkingDir() const | |
_declspec (dllexport) const char *getLogDir() const | |
_declspec (dllexport) const bool getFullSync() const | |
const TimeZoneInformation * | getCurrentTimezone () const |
Returns a pointer to the currentTimezone internal structure. | |
void | createDefaultConfig () |
Creates a default configuration. | |
bool | checkToUpgrade () |
Checks if the config is to upgrade. | |
void | upgradeConfig () |
Update config with values from HKLM (set by installer). | |
bool | isUpgraded () |
true if config has been upgraded from a previous version | |
int | getOldSwv () |
Returns the old installed swv (for upgrades). '0' if not an upgrade. | |
char * | readCurrentSwv () |
Returns the current software version, read it from HKLM registry. | |
int | setUniqueDevID () |
Creates and set a unique 'devID' property for current configuration. | |
bool | checkPortalBuild () |
Check if it's a normal/portal build (from HKLM keys). | |
void | saveBeginSync () |
Save only "beginSync" property to win registry. | |
void | saveSyncModes () |
Save only "sync" properties of each source, to win registry. | |
_declspec (dllexport) void readSyncModes() | |
Reads only "sync" properties of each source, to win registry. | |
Static Public Member Functions | |
static OutlookConfig * | getInstance () |
Method to get the sole instance of OutlookConfig. | |
static bool | isInstantiated () |
Returns true if static instance is not NULL. | |
Protected Member Functions | |
OutlookConfig () | |
Constructor. | |
Private Member Functions | |
void | readWinSourceConfig (unsigned int i) |
Read client-specific SyncSource properties from Win registry. | |
void | saveWinSourceConfig (unsigned int i) |
Save WindowsSyncSourceConfig properties in DMTree for the desired Source. | |
char * | readPropertyValue (const char *context, const char *propertyName, HKEY rootKey) |
int | decryptPrivateData () |
Decrypt private data (Username/Password/Proxy username/Proxy password). | |
void | encryptPrivateData () |
Encrypt private data (Username/Password/Proxy username/Proxy password). | |
int | readCurrentTimezone () |
Populate 'currentTimezone' structure, reading values from TIME_ZONE_INFORMATION and also directly from Windows Registry. | |
Private Attributes | |
char * | workingDir |
char * | logDir |
bool | fullSync |
bool | abortSync |
bool | upgraded |
int | oldSwv |
TimeZoneInformation | currentTimezone |
The structure with current timezone informations. | |
WindowsSyncSourceConfig * | winSourceConfigs |
Array of specific SSConfig. | |
unsigned int | winSourceConfigsCount |
Counter for winSourceConfigs array. | |
Static Private Attributes | |
static OutlookConfig * | pinstance = NULL |
pointer to OutlookConfig instance |
This class is derivated from DMTClientConfig, which is derivate from SyncMangerConfig.
void OutlookConfig::readWinSourceConfig | ( | unsigned int | i | ) | [private] |
Read client-specific SyncSource properties from Win registry.
i | : the index of node (and syncsource) under 'sourcesNode' node |
void OutlookConfig::saveWinSourceConfig | ( | unsigned int | i | ) | [private] |
Save WindowsSyncSourceConfig properties in DMTree for the desired Source.
Source properties are placed in specific node under sources node. Notes: if the node for the current source is not found, it is created! if we are under a restore sync (slow/refresh), 'sync' property will be skipped (keep previous value from registry)
i | : the index of SyncSource node |
int OutlookConfig::decryptPrivateData | ( | ) | [private] |
Decrypt private data (Username/Password/Proxy username/Proxy password).
Data is stored encrypted (B64(DES(data)) since version 6.0.9. Data must be in clear text into the config, as config is used by API.
void OutlookConfig::encryptPrivateData | ( | ) | [private] |
Encrypt private data (Username/Password/Proxy username/Proxy password).
Data is stored encrypted (B64(DES(data)) since version 6.0.9. Note: Data must be in clear text into the config, as config is used by API, so this method should be called only during save() operation.
int OutlookConfig::readCurrentTimezone | ( | ) | [private] |
Populate 'currentTimezone' structure, reading values from TIME_ZONE_INFORMATION and also directly from Windows Registry.
BOOL OutlookConfig::read | ( | ) | [virtual] |
Read the configuration from Windows registry into this object.
This method overrides 'DMTClientConfigread()'. 'DMTClientConfigread()' is first called to read all common properties, then specific SyncSource properties are retrieved.
A separate 'winSourceConfigs' array is used to store all specific SS config, common props are linked to original 'sourceConfigs' array (no copy!).
Reimplemented from DMTClientConfig.
BOOL OutlookConfig::save | ( | SyncReport * | report | ) |
Save the configuration from this object into Windows registry.
If SyncReport pointer is passed not NULL, each SyncSource configuration will be saved ONLY if that source was successfully synced. This method overrides 'DMTClientConfigsave()'.
A separate 'winSourceConfigs' array is used to store all SS config, so a specific method 'saveWinSourceConfig()' is used to save sources config into the windows registry.
WindowsSyncSourceConfig * OutlookConfig::getSyncSourceConfig | ( | unsigned int | i | ) |
Return a pointer to the internal WindowsSyncSourceConfig object from its index in winSourceConfigs array (must NOT be freed by caller).
This method replaces 'getSyncSourceConfig()' of DMTClientConfig.
NOTE: please use the "getSyncSourceConfig(const char* name)" method, to ensure the correct WindowsSyncSourceConfig* is used!
i | : the index of source in winSourceConfigs array |
BOOL OutlookConfig::setSyncSourceConfig | ( | WindowsSyncSourceConfig & | wsc | ) |
Set the passed WindowsSyncSourceConfig object into the correspondent object inside 'winSourceConfigs' array.
The values are copied into the object that matches the same name of the passed one. This method replaces the 'SyncManagerConfigsetSyncSourceConfig()'. Note: If a WindowsSyncSourceConfig with the same name is not found, the passed object is added at the end of the 'winSourceConfig' array.
wsc | : the WindowsSyncSourceConfig passed by reference |
BOOL OutlookConfig::addSyncSourceConfig | ( | WindowsSyncSourceConfig & | wsc | ) |
Adds the passed WindowsSyncSourceConfig.
It is added at the end of the 'winSourceConfig' array. This method replaces the 'SyncManagerConfigaddSyncSourceConfig()'.
wsc | : the WindowsSyncSourceConfig passed by reference |
void OutlookConfig::createDefaultConfig | ( | ) |
Creates a default configuration.
Uses DefaultWinConfigFactory methods to populate config objects.
bool OutlookConfig::checkToUpgrade | ( | ) |
Checks if the config is to upgrade.
It checks the difference between: swv from HKLM: this is set by installer, current version swv from HKCU: previous version of this config
int OutlookConfig::getOldSwv | ( | ) |
Returns the old installed swv (for upgrades). '0' if not an upgrade.
'0' if not an upgrade.
char * OutlookConfig::readCurrentSwv | ( | ) |
Returns the current software version, read it from HKLM registry.
This value is set and updated ONLY by installer. Returns a new allocated buffer, must be deleted by the caller.
int OutlookConfig::setUniqueDevID | ( | ) |
Creates and set a unique 'devID' property for current configuration.
The devID depends on: 1: the local machine name 2: the Windows current user name 3: the current Outlook profile name (now disabled)
If one of these parameters has changed, the devID generated is different. The devID property is then set into current configuration, in the format "fol-%1:%2:%3" where 1 2 3 are the parameters already described. Parameters are also encoded in base64.
unsigned int OutlookConfig::winSourceConfigsCount [private] |
Counter for winSourceConfigs array.
(internal use, should be equal to 'sourceConfigsCount' member)