Client DLL
[Outlook Plug-in]

Collaboration diagram for Client DLL:


Modules

 Configuration
 Utility functions
 Scheduler functions
 Data Tranformation functions
 Event listeners

Classes

class  DefaultWinConfigFactory
 This class is a factory of default configurations. More...
class  HwndFunctions
 Contains methods to find the UI window handle. 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...

Defines

#define PLUGIN_UI_TITLE   _T("Funambol Outlook Plug-in")
#define CONFIG_WINDOW_TITLE   _T("Funambol Outlook Plug-in Options")
#define PLUGIN_UI_CLASSNAME   _T("FunambolApp")
#define PROGRAM_NAME   "Funambol Outlook Plug-in"
#define WPROGRAM_NAME   L"Funambol Outlook Plug-in"
#define PROGRAM_NAME_EXE   "OutlookPlugin.exe"
#define OL_PLUGIN_LOG_NAME   "OLPlugin.txt"
#define SYNC_MUTEX_NAME   "fol-SyncInProgress"
#define TIME_OUT_ABORT   8
 8 seconds
#define ASK_SLOW_TIMEOUT   25
 25 seconds
#define SCHED_DEFAULT_REPEAT_MINS   15
 15 minutes
#define SCHED_DURATION_DAYS   1
 1 day
#define SYNC_TIMEOUT   120
 120 minutes
#define MAX_LOG_SIZE   10000000
 10 MB
#define EMPTY_WSTRING   L""
#define SIF_VERSION_SUPPORTED   "1.0"
#define VCARD_VERSION_SUPPORTED   "2.1"
#define ICAL_VERSION_SUPPORTED   "1.0"
#define VCARD_DEFAULT_NAME   L"card"
#define VCALENDAR_DEFAULT_NAME   L"event"
#define SIFC_DEFAULT_NAME   L"scard"
#define SIFE_DEFAULT_NAME   L"scal"
#define FUNAMBOL_DIR_NAME   L"Funambol"
 Data files are stored under 'Doc&Settings Data Plug-in' folder.
#define OLPLUGIN_DIR_NAME   L"Outlook Plug-in"
#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 (int oldVersion)
 Operations to upgrade the plugin from 'oldVersion' to this version.
char * getClientLastErrorMsg ()
int getClientLastErrorCode ()

Function Documentation

void checkAbortedSync (  ) 

Check if synchronization session has been intentionally aborted.

A flag 'abortSync' inside OutlookConfig singleton object is used to indicate that the user wants to abort the sync. The client periodically checks this flag, using this function.

Note:
this is important to correctly close Outlook session, as the logoff must be done by the same thread that logged in... otherwise Outlook may become instable or could not respond.

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.

void endSync (  ) 

Common operations to end the sync process.

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.

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.

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

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

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.

int startSync (  ) 

Entry point to start the synchronization process.

Returns:
0 OK, no errors. 1 generic error. 2 aborted by user (soft termination). 3 Outlook fatal exception. 4 Thread terminated (hard termination). 5 aborted by user to avoid full-sync.

void throwSyncException ( const char *  msg,
DWORD  code 
)

use these functions to throw Client exceptions.

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

void upgradePlugin ( int  oldVersion  ) 

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

Should be called only once during plugin first start.


Generated on Fri Nov 9 12:21:28 2007 for Funambol Outlook Plug-in Library by  doxygen 1.5.2