Scheduler functions
[Client DLL]

Collaboration diagram for Scheduler functions:

Defines

#define SCHED_PARAM   L"schedule"
#define NEVER   "Never"
#define EVERY_DAY   "Every day"

Functions

int setScheduler (const bool enable, const int minutes)
 Set the scheduled task of plugin.
bool getScheduler (int *minutes)
 Get information about scheduled task of plugin.
int setScheduleTask (const char *frequency, const int dayNum, const int minNum)
 Set a Task into task scheduler.
int getScheduleTask (bool *active, int *dayNum, int *minNum)
 Get task info from Task scheduler.
int deleteScheduleTask ()
 Delete the schedule task.
ITaskScheduler * initScheduleInstance ()
 Call CoInitialize to initialize the COM library and then CoCreateInstance to get the Task Scheduler object.
int getScheduledTaskName (std::wstring &taskName)
 Used to create the scheduled task name: "Funambol Outlook Sync Client - <UserName>".

Define Documentation

#define SCHED_PARAM   L"schedule"

Referenced by setScheduleTask().


Function Documentation

int deleteScheduleTask (  ) 

Delete the schedule task.

Returns:
0 if no errors

References getScheduledTaskName(), initScheduleInstance(), and readSystemErrorMsg().

Referenced by setScheduler().

int getScheduledTaskName ( wstring &  taskName  ) 

Used to create the scheduled task name: "Funambol Outlook Sync Client - <UserName>".

'Username' is the current Windows user, so each user has a different task.

Parameters:
taskName [OUT] the name of task
Returns:
0 if no errors

References getWindowsUser().

Referenced by deleteScheduleTask(), getScheduleTask(), setScheduleTask(), and upgradePlugin().

bool getScheduler ( int *  minutes  ) 

Get information about scheduled task of plugin.

Parameters:
minutes [OUT] the repeating minutes of task
Returns:
true if task is active. false if task is disabled or not existing.

References getScheduleTask().

int getScheduleTask ( bool *  active,
int *  dayNum,
int *  minNum 
)

Get task info from Task scheduler.

Returns 0 if task found and no errors, -1 if task not found. If task found: frequency, dayNum, minNum and statusCode are set.

Parameters:
active : [OUT] true if task is active
dayNum : [OUT] repeating every 'dayNum' days
minNum : [OUT] repeating every 'minNum' minutes
Returns:
0 = task found, status correct. 1 = task found, status incorrect. 2 = task found but manually changed. -1 = task not found. -2 = errors occurred.

References getScheduledTaskName(), initScheduleInstance(), and readSystemErrorMsg().

Referenced by getScheduler().

ITaskScheduler* initScheduleInstance (  ) 

Call CoInitialize to initialize the COM library and then CoCreateInstance to get the Task Scheduler object.

Sets the lastErrorMsg in case of errors.

Parameters:
pITS,: pointer to ITaskScheduler interface
Returns:
0 if no errors

Referenced by deleteScheduleTask(), getScheduleTask(), and setScheduleTask().

int setScheduler ( const bool  enable,
const int  minutes 
)

Set the scheduled task of plugin.

Parameters:
enable true = activate the scheduler false = disable the scheduler (delete the task)
minutes the repeating minutes of task
Returns:
0 if no errors

References deleteScheduleTask(), and setScheduleTask().

int setScheduleTask ( const char *  frequency,
const int  dayNum,
const int  minNum 
)

Set a Task into task scheduler.

It takes values to insert from Schedule form. If task already exists, it is updated with passed parameters. Starting time is always set to current time (task starts now).

Parameters:
frequency : NEVER or EVERY_DAY
dayNum : repeate the task every 'dayNum'
minNum : repeate the task every 'minNum'
Returns:
0 if no errors.

References OutlookConfig::getInstance(), getScheduledTaskName(), getWindowsUserEx(), initScheduleInstance(), readSystemErrorMsg(), and SCHED_PARAM.

Referenced by setScheduler().


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