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 SCHED_PARAM L"schedule" |
Referenced by setScheduleTask().
int deleteScheduleTask | ( | ) |
Delete the schedule task.
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.
taskName | [OUT] the name of task |
References getWindowsUser().
Referenced by deleteScheduleTask(), getScheduleTask(), setScheduleTask(), and upgradePlugin().
bool getScheduler | ( | int * | minutes | ) |
Get information about scheduled task of plugin.
minutes | [OUT] the repeating minutes of task |
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.
active | : [OUT] true if task is active | |
dayNum | : [OUT] repeating every 'dayNum' days | |
minNum | : [OUT] repeating every 'minNum' minutes |
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.
pITS,: | pointer to ITaskScheduler interface |
Referenced by deleteScheduleTask(), getScheduleTask(), and setScheduleTask().
int setScheduler | ( | const bool | enable, | |
const int | minutes | |||
) |
Set the scheduled task of plugin.
enable | true = activate the scheduler false = disable the scheduler (delete the task) | |
minutes | the repeating minutes of task |
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).
frequency | : NEVER or EVERY_DAY | |
dayNum | : repeate the task every 'dayNum' | |
minNum | : repeate the task every 'minNum' |
References OutlookConfig::getInstance(), getScheduledTaskName(), getWindowsUserEx(), initScheduleInstance(), readSystemErrorMsg(), and SCHED_PARAM.
Referenced by setScheduler().