Update contrib.
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Various T-classes for client input to scheduler, scheduler output to client
15 // These classes comprise part of the interface (the rest is defined in RScheduler)
19 #if !defined (__SCHINFO_H__)
22 #if !defined (__SCHTIME_H__)
26 #if !defined(__E32BASE_H__)
35 Contains detailed information for a single task.
37 A schedule can have any number of tasks. An object of this type is passed
38 to RScheduler::ScheduleTask(). Objects of this type are also returned by functions
39 within RScheduler that retrieve information about tasks.
41 @see RScheduler::ScheduleTask()
42 @see RScheduler::GetScheduleL()
43 @see RScheduler::GetTaskInfoL()
51 IMPORT_C TTaskInfo (TInt aTaskId, TName& aName, TInt aPriority, TInt aRepeat);
52 IMPORT_C TTaskInfo();//
54 IMPORT_C TTaskInfo& operator=(const TTaskInfo& aTaskInfo);
55 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
56 IMPORT_C void InternalizeL(RReadStream& aStream);
58 //TTaskInfo (TTaskInfo& aTaskInfo);
61 /** Specifies how often the task is to be repeated.
63 This is defined by the client.
65 A value of 1 means once, a value of 2 means twice etc.
67 Note that zero is interpreted to mean once, and a negative value is interpreted
68 to mean that the task will be repeated until it is explicitly deleted. */
71 /** The unique Id for the task.
73 This is generated by the Task Scheduler. Clients should use the generated
74 Id to refer to the task in future transactions. */
77 /** The name of the task.
79 This is defined by the client.
84 /** The priority of the task.
86 This is defined by the client.
88 Determines the order in which a client's tasks are executed. Where a client
89 has two tasks with different priorities, the task with the higher priority
90 will be executed first. */
95 Defines a filter to be used when listing tasks scheduled in a call to RScheduler::GetTaskRefsL().
97 @see RScheduler::GetTaskRefsL()
103 /** Indicates that all tasks are to be selected. */
105 /** Indicates those tasks associated with the executing program with which the
106 calling client is associated, are to be selected. */
112 Defines a filter to be used when listing schedules in a call to RScheduler::GetScheduleRefsL(),
113 and when listing tasks in a call to RScheduler::GetTaskRefsL().
115 @see RScheduler::GetScheduleRefsL()
116 @see RScheduler::GetTaskRefsL()
122 /** Indicates that all schedules are to be selected. */
124 /** Indicates that only pending schedules are to be selected.
126 Note that pending schedules are those that are enabled and have tasks associated
132 Defines the type of interval used by a schedule entry.
134 @see TScheduleEntryInfo
140 /** The interval is based on hours. */
142 /** The interval is based on days. */
144 /** The interval is based on months. */
146 /** The interval is based on years. */
152 Defines the types of schedules supported by the task scheduler API
155 // Not for Client use , only to be used internally
158 /** Indicates a time based schedule. */
160 /** Indicates a conditon based schedule. */
166 Defines, and uniquely identifies a schedule.
168 @see RScheduler::CreatePersistentSchedule()
169 @see RScheduler::ScheduleTask()
170 @see RScheduler::GetScheduleRefsL()
171 @see RScheduler::GetTaskRefsL()
172 @see RScheduler::GetTaskInfoL()
176 class TSchedulerItemRef
179 /** The unique Id for the schedule.
181 This is generated by the Task Scheduler when the schedule is created. Clients
182 should use this Id to refer to the schedule in future transactions. */
185 /** The name of the schedule.
187 This is defined by the client. */
192 Contains detailed information for a single schedule entry.
194 A schedule can have any number of schedule entries. A client passes one or
195 more of these objects, contained within an array, to the RScheduler functions
196 that create or amend a schedule.
198 @see RScheduler::CreatePersistentSchedule()
199 @see RScheduler::EditSchedule()
200 @see RScheduler::ScheduleTask()
201 @see RScheduler::GetScheduleL()
203 @deprecated and replaced by TScheduleEntryInfo2
205 class TScheduleEntryInfo
208 void ExternalizeL(RWriteStream& aStream) const;
209 void InternalizeL(RReadStream& aStream);
211 /** Defines the type of time-frame relative to which execution of tasks is timed;
212 for example, EHourly implies relative to the current hour, EDaily implies
213 relative to the current day.
215 @see TIntervalType */
216 TIntervalType iIntervalType;
218 /** The first time that the entry will cause execution of tasks. */
221 /** The interval between execution of tasks.
223 The way that this value is interpreted depends on the value of iIntervalType.
224 For example, if the interval is 2 and iIntervalType has a value of EMonthly,
225 then the interval is 2 months.
227 The interval must have a minimum value of 1.
230 @see iIntervalType */
233 /** The period for which the entry is valid.
235 After the validity period has expired, tasks associated with the entry will
236 not be eligible for execution.
238 @see TTimeIntervalMinutes */
239 TTimeIntervalMinutes iValidityPeriod;
245 Contains detailed information for a single schedule entry.
247 A schedule can have any number of schedule entries. A client passes one or
248 more of these objects, contained within an array, to the RScheduler functions
249 that create or amend a schedule.
251 @see RScheduler::CreatePersistentSchedule()
252 @see RScheduler::EditSchedule()
253 @see RScheduler::ScheduleTask()
254 @see RScheduler::GetScheduleL()
258 class TScheduleEntryInfo2
262 IMPORT_C TScheduleEntryInfo2();
263 IMPORT_C TScheduleEntryInfo2(const TScheduleEntryInfo2& aEntryInfo);
264 IMPORT_C TScheduleEntryInfo2(const TTsTime& aStartTime, TIntervalType aIntervalType, TInt aInterval, TTimeIntervalMinutes aValidityPeriod);
266 //utility Get and Set methods
267 IMPORT_C TIntervalType IntervalType() const;
268 IMPORT_C void SetIntervalType(TIntervalType aIntervalType);
270 IMPORT_C const TTsTime& StartTime() const;
271 IMPORT_C void SetStartTime(const TTsTime& aStartTime);
273 IMPORT_C TInt Interval() const;
274 IMPORT_C void SetInterval(TInt aInterval);
276 IMPORT_C TTimeIntervalMinutes ValidityPeriod() const;
277 IMPORT_C void SetValidityPeriod(TTimeIntervalMinutes aValidityPeriod);
279 //assignment operator
280 IMPORT_C TScheduleEntryInfo2& operator=(const TScheduleEntryInfo2& aEntryInfo);
284 // APIs for use within the Task Scheduler server
285 TScheduleEntryInfo2(const TScheduleEntryInfo& aEntryInfo);
286 void ProcessOffsetEvent();
288 void ExternalizeL(RWriteStream& aStream) const;
289 void InternalizeL(RReadStream& aStream);
292 /** The interval between execution of tasks.
293 The way that this value is interpreted depends on the value of iIntervalType.
294 For example, if the interval is 2 and iIntervalType has a value of EMonthly,
295 then the interval is 2 months.
296 The interval must have a minimum value of 1.
300 /** Defines the type of interval between the execution of tasks.
301 May be EHourly, EDaily, EMonthly or EYearly.
303 TIntervalType iIntervalType;
305 /** The first time that the entry will cause execution of tasks. */
308 /** The period for which the entry is valid.
309 After the validity period has expired, tasks associated with the entry will
310 not be eligible for execution.
312 TTimeIntervalMinutes iValidityPeriod;
318 // Declare the test accessor as a friend
319 friend class TScheduleEntryInfo2_StateAccessor;
324 Defines the state of a schedule.
326 An object of this type is passed to, and populated by, a call to RScheduler::GetScheduleL().
328 @see RScheduler::GetScheduleL()
332 class TScheduleState2
337 IMPORT_C TScheduleState2();
338 IMPORT_C TScheduleState2(const TScheduleState2& aScheduleState);
339 IMPORT_C TScheduleState2(const TName& aName, const TTsTime& aDueTime, TBool aPersists, TBool aEnabled);
342 IMPORT_C const TName& Name() const;
343 IMPORT_C void SetName(const TName& aName);
345 IMPORT_C const TTsTime& DueTime() const;
346 IMPORT_C void SetDueTime(const TTsTime& aDueTime);
348 IMPORT_C TBool Persists() const;
349 IMPORT_C void SetPersists(TBool aPersists);
351 IMPORT_C TBool Enabled() const;
352 IMPORT_C void SetEnabled(TBool aEnabled);
354 IMPORT_C TScheduleState2& operator=(const TScheduleState2& aScheduleState);
357 /** The name of the schedule. */
360 /** The time when the schedule is next due.
361 This only has meaning if the schedule is pending, i.e. it is enabled and has
362 tasks associated with it. */
365 /** Flags used to indicate:
366 1. Whether the schedule is enabled or not. (bit 0)
367 2. Whether the schedule is persistent or not. (bit 1)
368 If a schedule is persistent, its lifetime is not limited to the lifetime of
369 the tasks associated with it .
370 If a schedule is transient, it is created together with a new scheduled task,
371 and is destroyed when the task is destroyed.
373 Bits 2-31 reserved for future use
381 // Declare the test accessor as a friend
382 friend class TScheduleState2_StateAccessor;
386 Defines the state of a schedule.
388 An object of this type is passed to, and populated by, a call to RScheduler::GetScheduleL().
390 @see RScheduler::GetScheduleL()
392 @deprecated and replaced by TScheduleState2.
397 //constructor for use with the deprecated APIs
398 TScheduleState(const TScheduleState2& aScheduleState2);
403 /** The name of the schedule. */
406 /** The time when the schedule is next due.
408 This only has meaning if the schedule is pending, i.e. it is enabled and has
409 tasks associated with it. */
412 /** Indicates whether the schedule is persistent or not.
414 If a schedule is persistent, its lifetime is not limited to the lifetime of
415 the tasks associated with it .
417 If a schedule is transient, it is created together with a new scheduled task,
418 and is destroyed when the task is destroyed. */
421 /** Indicates whether the schedule is enabled or not. */
425 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
426 #include <schinfointernal.h>