Client DLL
[Outlook Plug-in]

Collaboration diagram for Client DLL:

Classes

class  DateFilter
 Rapresents the filter entity on the start/end dates, for appointments. More...
class  DefaultWinConfigFactory
 This class is a factory of default configurations. More...
class  HwndFunctions
 Contains methods to find the UI window handle. More...
class  PicturesSyncSource
 This class extends the FileSyncSource class, it's specialized for pictures items. More...
class  SyncException
 Defines exceptions for sync process. More...
class  WindowsSyncClient
 Derivate from SyncClient, implements only continueAfterPrepareSync method. More...
class  WindowsSyncSource
 This class is the extension of SyncSource class for specific Client objects. More...
class  WindowsSyncSourceConfig
 This class groups all configuration properties for a WindowsSyncSource. More...

Modules

 Configuration
 Utility functions
 Scheduler functions
 Data Tranformation functions
 Event listeners

Defines

#define PLUGIN_UI_CLASSNAME   _T("FunambolApp")
#define SYNC_MUTEX_NAME   "fol-SyncInProgress"
#define EMPTY_WSTRING   L""
#define VCARD_DEFAULT_NAME   L"card"
#define VCALENDAR_DEFAULT_NAME   L"event"
#define VTODO_DEFAULT_NAME   L"task"
#define VNOTE_DEFAULT_NAME   L"note"
#define SIFC_DEFAULT_NAME   L"scard"
#define SIFE_DEFAULT_NAME   L"scal"
#define SIFT_DEFAULT_NAME   L"stask"
#define SIFN_DEFAULT_NAME   L"snote"
#define MAX_PATH_LENGTH   512

Typedefs

typedef std::list< std::wstring > itemKeyList
typedef itemKeyList::iterator itemKeyIterator

Functions

void throwSyncException (const char *msg, DWORD code=NULL)
 use these functions to throw Client exceptions.
int initializeClient (bool isScheduled)
 Initialize the client: open configuration, open LOG.
int initLog (bool isScheduled)
 Initialize the LOG.
int startSync ()
 Entry point to start the synchronization process.
int closeClient ()
 Closing operation before exiting client DLL.
void closeOutlook ()
 If Outlook session is active, close it and clean-up shared objects.
void checkAbortedSync ()
 Check if synchronization session has been intentionally aborted.
bool checkSyncInProgress ()
 Check if a synchronization process is already running.
void softTerminateSync ()
 This function is called to terminate the sync session (soft way).
int hardTerminateSync (HANDLE hSyncThread)
 This function is called to terminate the sync session (hard way).
int exitSyncThread (int code)
 This function is called to terminate the sync thread.
void endSync ()
 Common operations to end the sync process.
void upgradePlugin (const int oldVersion, const int oldFunambolVersion)
 Operations to upgrade the plugin from 'oldVersion' to this version.
const char * getClientLastErrorMsg ()
const int getClientLastErrorCode ()
int OpenMessageBox (HWND hwnd, UINT type, UINT msg)
int updateProcedure (HWND hwnd, bool manual=false)
 Starts the whole update procedure.
bool isNewSwVersionAvailable ()
 Returns true if a new version is known to be available for upgrade.
int checkUpdate ()
 It is called to check if there is a new version available.
bool checkForMandatoryUpdateBeforeStartingSync ()

Define Documentation

#define SYNC_MUTEX_NAME   "fol-SyncInProgress"

Referenced by getSyncMutexName().


Typedef Documentation

typedef std::list<std::wstring> itemKeyList


Function Documentation

void checkAbortedSync (  ) 

bool checkSyncInProgress (  ) 

Check if a synchronization process is already running.

This is obtained checking the correspondent mutex, which is created during the sync process.

Returns:
true if a sync is already running.

References getSyncMutexName(), and readSystemErrorMsg().

int checkUpdate (  ) 

It is called to check if there is a new version available.

If there is one, it sets a parameter into the reigistry. If necessary, will request via http the updated information.

References UpdateManager::checkIsToUpdate().

Referenced by startSync().

void endSync (  ) 

Common operations to end the sync process.

  • Close Outlook instance
  • Release mutex on sync
  • Unset Listeners

References closeOutlook(), and readSystemErrorMsg().

Referenced by checkAbortedSync(), manageClientException(), and startSync().

int exitSyncThread ( int  code  ) 

This function is called to terminate the sync thread.

Like 'hardTerminateSync' but used internally by client to terminate the syncThread (HANDLE set during startSync).

Parameters:
code the exit code for the sync thread
Returns:
0 if sync thread terminated successfully. 1 if could not terminate the sync thread.

References readSystemErrorMsg(), and syncThread().

int hardTerminateSync ( HANDLE  hSyncThread  ) 

This function is called to terminate the sync session (hard way).

If softTerminateSync() did not work, use this function to terminate the thread of synchronization.

Parameters:
hSyncThread the handle of sync thread to terminate
Returns:
0 if sync aborted successfully. 1 if could not terminate the sync thread.

References readSystemErrorMsg().

Referenced by syncThreadKiller().

int initializeClient ( bool  isScheduled  ) 

Initialize the client: open configuration, open LOG.

Configuration is a singleton object that MUST remain active during all program life. Will be released with close() method.

Parameters:
isScheduled true if it's a scheduled sync
Returns:
0 if no errors

References OutlookConfig::checkToUpgrade(), OutlookConfig::createDefaultConfig(), OutlookConfig::getFunambolSwv(), OutlookConfig::getInstance(), OutlookConfig::getOldFunambolSwv(), OutlookConfig::getOldSwv(), SyncManagerConfig::getSwv(), initLog(), OutlookConfig::read(), safeMessageBox(), OutlookConfig::save(), OutlookConfig::upgradeConfig(), and upgradePlugin().

Referenced by __declspec().

int initLog ( bool  isScheduled  ) 

Initialize the LOG.

Log File is placed under 'app data' directory for current user, if directories not found they will be created. Log file is reset and set level with this call.

Parameters:
reset if scheduled, we don't reset the log
Returns:
0 if no errors

References SyncManagerConfig::getClientConfig(), OutlookConfig::getInstance(), makeDataDirs(), safeMessageBox(), and writeToFile().

Referenced by initializeClient().

bool isNewSwVersionAvailable (  ) 

Returns true if a new version is known to be available for upgrade.

This method does not query the upgrade server, but it uses the information available in the config.

References UpdateManager::isNewVersionAvailable().

Referenced by CMainSyncFrame::OnInitMenuPopup().

void softTerminateSync (  ) 

This function is called to terminate the sync session (soft way).

We first try to "soft" terminate the thread, setting the correspondent flag inside OutlookConfig. This is to correctly close the session.

References OutlookConfig::setAbortSync().

int startSync (  ) 

void throwSyncException ( const char *  msg,
DWORD  code 
)

use these functions to throw Client exceptions.

use these functions to throw Client exceptions.

Get the instance of SyncException, set the data and throw it.

References SyncException::getInstance(), and SyncException::setExceptionData().

Referenced by checkAbortedSync(), and manageClientException().

int updateProcedure ( HWND  hwnd,
bool  manual = false 
)

Starts the whole update procedure.

Parameters:
hwnd the handle of the main window from the UI. It is set by the when the method is called by the UI form
manual parameter indicates that the user is starting from UI It returns a value indicating the UI have to show the "Update Software" menu item to start the update procedure manually. ret 1,2 the UI must show the item ret -1,0 the UI hides the item

References UpdateManager::checkForUpdates(), UpdateManager::isNewVersionAvailable(), UpdateManager::manualCheckForUpdates(), and UpdateManager::setHwnd().

Referenced by startSync().

void upgradePlugin ( const int  oldVersion,
const int  oldFunambolVersion 
)

Operations to upgrade the plugin from 'oldVersion' to this version.

Should be called only once during plugin first start.

References OutlookConfig::getInstance(), getScheduledTaskName(), getWindowsUser(), makeDataDirs(), and readSystemErrorMsg().

Referenced by initializeClient().


Generated on Tue Apr 6 13:00:40 2010 for Funambol Outlook Plug-in Library by  doxygen 1.5.7.1