#include <csch_cli.h>
class RScheduler : public RSessionBase, public RSessionBase |
Inherited Attributes | |
---|---|
RHandleBase::iHandle |
Inherited Enumerations | |
---|---|
RHandleBase:TAttributes | |
RSessionBase:TAttachMode |
Client side interface to the Task Scheduler.
IMPORT_C TInt | Connect | ( | ) |
Connects a client to the Task Scheduler server, creating a session with that server.
IMPORT_C TInt | CreatePersistentSchedule | ( | TSchedulerItemRef & | aRef, |
const CArrayFixFlat< TScheduleEntryInfo2 > & | aEntryList | |||
) |
Creates a persistent time based schedule.
This schedule has no tasks associated with it but merely contains information about start and finish times.
See also: TScheduleEntryInfo2
Parameters | |
---|---|
aRef | Definition of the new schedule. On return this contains a valid handle to the newly created schedule. |
aEntryList | The set of schedule entries that make up the new schedule. |
Capability | |
---|---|
WriteDeviceData |
IMPORT_C TInt | CreatePersistentSchedule | ( | TSchedulerItemRef & | aRef, |
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTsTime & | aDefaultRunTime | |||
) |
Creates a persistent condition based schedule.
This schedule has no tasks associated with it but merely contains information about conditions that must be satified to complete this schedule.
See also: TTaskSchedulerCondition
Parameters | |
---|---|
aRef | Definition of the new schedule. On return this contains a valid handle to the newly created schedule. |
aConditions | An array of system agent conditons that make up the schedule. |
aDefaultRunTime | The time at which the schedule with run if no conditions are met. If this is a local time based value, the schedule will remain at that local time regardless of timezone and DST changes (ie. it will float) If the value is UTC based, the schedule will remain at that UTC time (will not float). |
Capability | |
---|---|
WriteDeviceData |
IMPORT_C TInt | CreatePersistentSchedule | ( | TSchedulerItemRef & | aRef, |
const CArrayFixFlat< TScheduleEntryInfo > & | aEntryList | |||
) |
Creates a persistent time based schedule.
This schedule has no tasks associated with it but merely contains information about start and finish times.
See also: TScheduleEntryInfo
See note in CSch_Cli.h
Parameters | |
---|---|
aRef | Definition of the new schedule. On return this contains a valid handle to the newly created schedule. |
aEntryList | The set of schedule entries that make up the new schedule. Start times of all entries are assumed to be local time based. |
Capability | |
---|---|
WriteDeviceData |
IMPORT_C TInt | CreatePersistentSchedule | ( | TSchedulerItemRef & | aRef, |
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTime & | aDefaultRunTime | |||
) |
Creates a persistent condition based schedule.
This schedule has no tasks associated with it but merely contains information about conditions that must be satified to complete this schedule.
See also: TTaskSchedulerCondition
See note in CSch_Cli.h
Parameters | |
---|---|
aRef | Definition of the new schedule. On return this contains a valid handle to the newly created schedule. |
aConditions | An array of system agent conditons that make up the schedule. |
aDefaultRunTime | The time at which the schedule with run if no conditions are met. Default run times of all schedules created using this API are assumed to be local time based. |
Capability | |
---|---|
WriteDeviceData |
Deletes the specified schedule.
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
Deletes the specified task.
Parameters | |
---|---|
aTaskId | The Id that identifies the task. |
Capability | |
---|---|
Note | Only clients with the same SID as the relevant schedule creator, or WriteDeviceData capability can sucessfully call this API. |
Disables the specified schedule.
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | EditSchedule | ( | const TInt | aScheduleHandle, |
const CArrayFixFlat< TScheduleEntryInfo2 > & | aEntryList | |||
) |
Changes a time based schedule.
Note that changing a schedule is implemented by supplying a replacement set of schedule entries.
See also: TScheduleEntryInfo2
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aEntryList | The set of schedule entries that will make up the new schedule. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | EditSchedule | ( | TInt | aScheduleHandle, |
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTsTime & | aDefaultRunTime | |||
) |
Changes a condition based schedule.
Note that changing a schedule is implemented by supplying a replacement set of schedule conditons and time.
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aConditions | An array of system agent conditons that make up the schedule. |
aDefaultRunTime | The time at which the schedule with run if no conditions are met. If this is a local time based value, the schedule will remain at that local time regardless of timezone and DST changes (ie. it will float) If the value is UTC based, the schedule will remain at that UTC time (will not float). |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | EditSchedule | ( | const TInt | aScheduleHandle, |
const CArrayFixFlat< TScheduleEntryInfo > & | aEntryList | |||
) |
Changes a time based schedule.
Note that changing a schedule is implemented by supplying a replacement set of schedule entries.
See also: TScheduleEntryInfo
See note in CSch_Cli.h
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aEntryList | The set of schedule entries that will make up the new schedule. Start times of all entries are assumed to be local time based. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | EditSchedule | ( | TInt | aScheduleHandle, |
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTime & | aDefaultRunTime | |||
) |
Changes a condition based schedule.
Note that changing a schedule is implemented by supplying a replacement set of schedule conditons and time.
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aConditions | An array of system agent conditons that make up the schedule. |
aDefaultRunTime | The time at which the schedule with run if no conditions are met. Note that this parameter is assumed to be local time based. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
Enables the specified schedule.
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetScheduleL | ( | const TInt | aScheduleHandle, |
TScheduleState2 & | aState, | |||
CArrayFixFlat< TScheduleEntryInfo2 > & | aEntries, | |||
CArrayFixFlat< TTaskInfo > & | aTasks, | |||
TTsTime & | aDueTime | |||
) |
Gets information relating to a specified time based schedule.
See also: TScheduleEntryInfo2 TTaskInfo
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aState | On return, the state of the specified schedule. |
aEntries | On return, a populated array of schedule entries that make up the schedule. Note that populating the array could cause this function to leave because of an out of memory condition. |
aTasks | On return, a populated array of tasks associated with the schedule. Note that populating the array could cause this function to leave because of an out of memory condition. |
aDueTime | On return, the time that the schedule is next due. This value may be local time or UTC based,dependent on the type of time used for schedule entries. Comparisons used within the scheduler to find the next due time are UTC based. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetScheduleL | ( | TInt | aScheduleHandle, |
TScheduleState2 & | aState, | |||
CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
TTsTime & | aDefaultRunTime, | |||
CArrayFixFlat< TTaskInfo > & | aTasks | |||
) |
Gets information relating to a specified condition based schedule.
See also: TTaskSchedulerCondition TTaskInfo
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aState | On return, the state of the specified schedule. |
aConditions | On return, a populated array of schedule conditons that make up the schedule. Note that populating the array could cause this function to leave because of an out of memory condition. |
aDefaultRunTime | On return, the time at which the schedule with run if no conditions are met. If this is a local time based value, the schedule will remain at that local time regardless of timezone and DST changes (ie. it will float) If the value is UTC based, the schedule will remain at that UTC time (will not float). |
aTasks | On return, a populated array of tasks associated with the schedule. Note that populating the array could cause this function to leave because of an out of memory condition. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetScheduleL | ( | const TInt | aScheduleHandle, |
TScheduleState & | aState, | |||
CArrayFixFlat< TScheduleEntryInfo > & | aEntries, | |||
CArrayFixFlat< TTaskInfo > & | aTasks, | |||
TTime & | aDueTime | |||
) |
Gets information relating to a specified time based schedule.
See also: TScheduleEntryInfo TTaskInfo
See note in CSch_Cli.h
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aState | On return, the state of the specified schedule. On return, aState will have a local time based iDueTime member, regardless of whether the schedule is UTC or local time based. If the schedule is UTC based, the due time will be converted to a local time based value before returning. |
aEntries | On return, a populated array of schedule entries that make up the schedule. All entry start times returned will be local time based, though they may be UTC or local time based within the scheduler. The scheduler will convert any UTC based times to local time before returning. Note that populating the array could cause this function to leave because of an out of memory condition. |
aTasks | On return, a populated array of tasks associated with the schedule. Note that populating the array could cause this function to leave because of an out of memory condition. |
aDueTime | On return, the time that the schedule is next due. This value will be local time based, regardless of whether the schedule is UTC or local time based. If the schedule is UTC based, the due time will be converted to a local time based value before returning. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetScheduleL | ( | TInt | aScheduleHandle, |
TScheduleState & | aState, | |||
CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
TTime & | aDefaultRunTime, | |||
CArrayFixFlat< TTaskInfo > & | aTasks | |||
) |
Gets information relating to a specified condition based schedule.
See also: TTaskSchedulerCondition TTaskInfo
See note in CSch_Cli.h
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule. |
aState | On return, the state of the specified schedule. On return, aState will have a local time based iDueTime member, regardless of whether the schedule is UTC or local time based. If the schedule is UTC based, the due time will be converted to a local time based value before returning. |
aConditions | On return, a populated array of schedule conditons that make up the schedule. Note that populating the array could cause this function to leave because of an out of memory condition. |
aDefaultRunTime | On return, the time at which the schedule with run if no conditions are met. This value will be local time based, regardless of whether the schedule is UTC or local time based. If the schedule is UTC based, the due time will be converted to a local time based value before returning. |
aTasks | On return, a populated array of tasks associated with the schedule. Note that populating the array could cause this function to leave because of an out of memory condition. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetScheduleRefsL | ( | CArrayFixFlat< TSchedulerItemRef > & | aScheduleRefArray, |
const TScheduleFilter | aFilter | |||
) |
Parameters | |
---|---|
aScheduleRefArray | On return, a populated array of schedule definitions. Note that populating the array could cause this function to leave because of an out of memory condition. |
aFilter | The schedule filter. |
Capability | |
---|---|
Note | A call to this API will only retrieve schedules created with the caller's SID. If the caller has WriteDeviceData capability all schedules will be retrieved. |
Gets the schedule type.
Parameters | |
---|---|
aScheduleHandle | The Id that identifies the schedule |
aScheduleType | On return the type of schedule relating to the handle. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
Gets the size of the data to be passed to the task's program.
This function should be called before calling GetTaskInfoL() so that a descriptor of the correct size can be set up.
Parameters | |
---|---|
aTaskId | The Id that identifies the task. |
aSize | The size of the task's data. |
Capability | |
---|---|
Note | Only clients with the same SID as the relevant schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetTaskInfoL | ( | const TInt | aTaskId, |
TTaskInfo & | aTaskInfo, | |||
TPtr & | aTaskData, | |||
TSchedulerItemRef & | aRef, | |||
TTsTime & | aNextDue | |||
) |
Gets information relating to a specified task.
Parameters | |
---|---|
aTaskId | The Id that identifies the task. |
aTaskInfo | On return, information about the task. |
aTaskData | On return, a pointer descriptor representing the data that is passed to the program to be executed. The caller must set up this pointer descriptor before calling the function. The required length of the descriptor can be found by calling GetTaskDataSize(). |
aRef | On return, the associated schedule definition. |
aNextDue | On return, the time that the task is next due. This value may be local time or UTC based. Comparisons used to find the next due time are based on UTC. |
Capability | |
---|---|
Note | Only clients with the same SID as the relevant schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetTaskInfoL | ( | const TInt | aTaskId, |
TTaskInfo & | aTaskInfo, | |||
TPtr & | aTaskData, | |||
TSchedulerItemRef & | aRef, | |||
TTime & | aNextDue | |||
) |
Gets information relating to a specified task.
Parameters | |
---|---|
aTaskId | The Id that identifies the task. |
aTaskInfo | On return, information about the task. |
aTaskData | On return, a pointer descriptor representing the data that is passed to the program to be executed. The caller must set up this pointer descriptor before calling the function. The required length of the descriptor can be found by calling GetTaskDataSize(). |
aRef | On return, the associated schedule definition. |
aNextDue | On return, the time that the task is next due. This value will be local time based, regardless of whether the schedule is UTC or local time based. If the schedule is UTC based, the due time will be converted to a local time based value before returning. |
Capability | |
---|---|
Note | Only clients with the same SID as the relevant schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | GetTaskRefsL | ( | CArrayFixFlat< TSchedulerItemRef > & | aTasks, |
const TScheduleFilter | aScheduleFilter, | |||
const TTaskFilter | aTaskFilter | |||
) |
Gets a list of all tasks, or a subset of tasks.
Note that if more than one client has supplied the same information when registering, then it is possible for a list of tasks to be returned, which the calling client has not scheduled.
See also: TSchedulerItemRef
Parameters | |
---|---|
aTasks | On return, a populated array of schedule definitions. The schedule definitions are those whose associated tasks satisfy the selection criteria. Note that populating the array could cause this function to leave because of an out of memory condition. |
aScheduleFilter | The schedule filter. |
aTaskFilter | The task filter. |
Capability | |
---|---|
Note | A call to this API will only retrieve tasks created with the caller's SID. If the caller has WriteDeviceData capability all tasks will be retrieved. |
Registers a client with the Task Scheduler.
A client must register with the Task Scheduler before scheduling any tasks, but does not need to register just to create and edit schedules.
Parameters | |
---|---|
aFileName | The name and full path of a program that encapsulates the client-specific knowledge for implementing tasks. On the emulator, the program should be a DLL; on an ARM processor, it should be an executable. |
aPriority | A priority value. |
Adds a task to an existing persistent schedule.
Behaviour of execution after a Backup and Restore operation should be considered when adding tasks to a persistent schedule. Persistent schedules might be backed up when a one-off task might be pending, and become due and executed some time after the backup operation. When the backup is restored, the tasks might be executed again if they are still valid (restore done during the validation period for time-based schedules, or conditions satisfied after restore for condition-based schedules). Clients should refrain from creating tasks that might have undesired effects under these conditions (e.g. by incurring a cost to the user by sending an SMS twice).
Parameters | |
---|---|
aTaskInfo | Information about the task to be added to the schedule. On return the task Id is written into this class. |
aTaskData | Data that is passed to the task on execution. |
aScheduleHandle | The Id that identifies the schedule to be used. |
Panic Codes | |
---|---|
CTaskScheduler | 0 The client has not registered. The client must register before adding tasks to the schedule. |
Capability | |
---|---|
Note | Only clients with the same SID as the schedule creator, or WriteDeviceData capability can sucessfully call this API. |
IMPORT_C TInt | ScheduleTask | ( | TTaskInfo & | aTaskInfo, |
HBufC & | aTaskData, | |||
TSchedulerItemRef & | aRef, | |||
const CArrayFixFlat< TScheduleEntryInfo2 > & | aEntryList | |||
) |
Creates a new, transient, time based schedule and adds a task to it.
Note that a transient schedule is destroyed when the task is destroyed or power is lost.
See also: TScheduleEntryInfo2
Parameters | |
---|---|
aTaskInfo | Information about the task to be added to the transient schedule. On return the task Id is written into this class. |
aTaskData | Data that is passed to the task on execution. |
aRef | Definition of the new transient schedule. |
aEntryList | The set of schedule entries that make up the new transient schedule. |
Panic Codes | |
---|---|
CTaskScheduler | 0 The client has not registered. The client must register before adding tasks to the schedule. |
IMPORT_C TInt | ScheduleTask | ( | TTaskInfo & | aTaskInfo, |
HBufC & | aTaskData, | |||
TSchedulerItemRef & | aRef, | |||
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTsTime & | aDefaultRunTime | |||
) |
Creates a new, transient, condition based schedule and adds a task to it.
Note that a transient schedule is destroyed when the task is destroyed or power is lost.
Parameters | |
---|---|
aTaskInfo | Information about the task to be added to the transient schedule. On return the task Id is written into this class. |
aTaskData | Data that is passed to the task on execution. |
aRef | Definition of the new transient schedule. |
aConditions | An array of schedule conditons that make up the schedule. |
aDefaultRunTime | The time at which the schedule will run if no conditions are met. If this is a local time based value, the schedule will remain at that local time regardless of timezone and DST changes (ie. it will float) If the value is UTC based, the schedule will remain at that UTC time (will not float). |
Panic Codes | |
---|---|
CTaskScheduler | 0 The client has not registered. The client must register before adding tasks to the schedule. |
IMPORT_C TInt | ScheduleTask | ( | TTaskInfo & | aTaskInfo, |
HBufC & | aTaskData, | |||
TSchedulerItemRef & | aRef, | |||
const CArrayFixFlat< TScheduleEntryInfo > & | aEntryList | |||
) |
Creates a new, transient, time based schedule and adds a task to it.
Note that a transient schedule is destroyed when the task is destroyed or power is lost.
See also: TScheduleEntryInfo
See note in CSch_Cli.h
Parameters | |
---|---|
aTaskInfo | Information about the task to be added to the transient schedule. On return the task Id is written into this class. |
aTaskData | Data that is passed to the task on execution. |
aRef | Definition of the new transient schedule. |
aEntryList | The set of schedule entries that make up the new transient schedule. All entry start times are assumed to be local time based. |
Panic Codes | |
---|---|
CTaskScheduler | 0 The client has not registered. The client must register before adding tasks to the schedule. |
IMPORT_C TInt | ScheduleTask | ( | TTaskInfo & | aTaskInfo, |
HBufC & | aTaskData, | |||
TSchedulerItemRef & | aRef, | |||
const CArrayFixFlat< TTaskSchedulerCondition > & | aConditions, | |||
const TTime & | aDefaultRunTime | |||
) |
Creates a new, transient, condition based schedule and adds a task to it.
Note that a transient schedule is destroyed when the task is destroyed or power is lost.
Parameters | |
---|---|
aTaskInfo | Information about the task to be added to the transient schedule. On return the task Id is written into this class. |
aTaskData | Data that is passed to the task on execution. |
aRef | Definition of the new transient schedule. |
aConditions | An array of schedule conditons that make up the schedule. |
aDefaultRunTime | The time at which the schedule with run if no conditions are met. aDefaultRunTime is assumed to be local time based. |
Panic Codes | |
---|---|
CTaskScheduler | 0 The client has not registered. The client must register before adding tasks to the schedule. |
IMPORT_C TVersion | Version | ( | ) | const |
Gets the client side version number.