williamr@2
|
1 |
// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@2
|
4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@2
|
6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
// Various T-classes for client input to scheduler, scheduler output to client
|
williamr@2
|
15 |
// These classes comprise part of the interface (the rest is defined in RScheduler)
|
williamr@2
|
16 |
//
|
williamr@2
|
17 |
//
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#if !defined (__SCHINFO_H__)
|
williamr@2
|
20 |
#define __SCHINFO_H__
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#if !defined (__SCHTIME_H__)
|
williamr@2
|
23 |
#include <schtime.h>
|
williamr@2
|
24 |
#endif
|
williamr@2
|
25 |
|
williamr@2
|
26 |
#if !defined(__E32BASE_H__)
|
williamr@2
|
27 |
#include <e32base.h>
|
williamr@2
|
28 |
#endif
|
williamr@2
|
29 |
|
williamr@2
|
30 |
#include <s32strm.h>
|
williamr@2
|
31 |
|
williamr@2
|
32 |
/**
|
williamr@2
|
33 |
Contains detailed information for a single task.
|
williamr@2
|
34 |
|
williamr@2
|
35 |
A schedule can have any number of tasks. An object of this type is passed
|
williamr@2
|
36 |
to RScheduler::ScheduleTask(). Objects of this type are also returned by functions
|
williamr@2
|
37 |
within RScheduler that retrieve information about tasks.
|
williamr@2
|
38 |
|
williamr@2
|
39 |
@see RScheduler::ScheduleTask()
|
williamr@2
|
40 |
@see RScheduler::GetScheduleL()
|
williamr@2
|
41 |
@see RScheduler::GetTaskInfoL()
|
williamr@2
|
42 |
@publishedAll
|
williamr@2
|
43 |
@released
|
williamr@2
|
44 |
*/
|
williamr@2
|
45 |
class TTaskInfo
|
williamr@2
|
46 |
{
|
williamr@2
|
47 |
public:
|
williamr@2
|
48 |
//ctors
|
williamr@2
|
49 |
IMPORT_C TTaskInfo (TInt aTaskId, TName& aName, TInt aPriority, TInt aRepeat);
|
williamr@2
|
50 |
IMPORT_C TTaskInfo();//
|
williamr@2
|
51 |
//assignment
|
williamr@2
|
52 |
IMPORT_C TTaskInfo& operator=(const TTaskInfo& aTaskInfo);
|
williamr@2
|
53 |
IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
54 |
IMPORT_C void InternalizeL(RReadStream& aStream);
|
williamr@2
|
55 |
//needs a copy ctor
|
williamr@2
|
56 |
//TTaskInfo (TTaskInfo& aTaskInfo);
|
williamr@2
|
57 |
|
williamr@2
|
58 |
//data
|
williamr@2
|
59 |
/** Specifies how often the task is to be repeated.
|
williamr@2
|
60 |
|
williamr@2
|
61 |
This is defined by the client.
|
williamr@2
|
62 |
|
williamr@2
|
63 |
A value of 1 means once, a value of 2 means twice etc.
|
williamr@2
|
64 |
|
williamr@2
|
65 |
Note that zero is interpreted to mean once, and a negative value is interpreted
|
williamr@2
|
66 |
to mean that the task will be repeated until it is explicitly deleted. */
|
williamr@2
|
67 |
TInt iRepeat;
|
williamr@2
|
68 |
|
williamr@2
|
69 |
/** The unique Id for the task.
|
williamr@2
|
70 |
|
williamr@2
|
71 |
This is generated by the Task Scheduler. Clients should use the generated
|
williamr@2
|
72 |
Id to refer to the task in future transactions. */
|
williamr@2
|
73 |
TInt iTaskId;
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/** The name of the task.
|
williamr@2
|
76 |
|
williamr@2
|
77 |
This is defined by the client.
|
williamr@2
|
78 |
|
williamr@2
|
79 |
@see TName */
|
williamr@2
|
80 |
TName iName;
|
williamr@2
|
81 |
|
williamr@2
|
82 |
/** The priority of the task.
|
williamr@2
|
83 |
|
williamr@2
|
84 |
This is defined by the client.
|
williamr@2
|
85 |
|
williamr@2
|
86 |
Determines the order in which a client's tasks are executed. Where a client
|
williamr@2
|
87 |
has two tasks with different priorities, the task with the higher priority
|
williamr@2
|
88 |
will be executed first. */
|
williamr@2
|
89 |
TInt iPriority;
|
williamr@2
|
90 |
};
|
williamr@2
|
91 |
|
williamr@2
|
92 |
/**
|
williamr@2
|
93 |
Defines a filter to be used when listing tasks scheduled in a call to RScheduler::GetTaskRefsL().
|
williamr@2
|
94 |
|
williamr@2
|
95 |
@see RScheduler::GetTaskRefsL()
|
williamr@2
|
96 |
@publishedAll
|
williamr@2
|
97 |
@released
|
williamr@2
|
98 |
*/
|
williamr@2
|
99 |
enum TTaskFilter
|
williamr@2
|
100 |
{
|
williamr@2
|
101 |
/** Indicates that all tasks are to be selected. */
|
williamr@2
|
102 |
EAllTasks,
|
williamr@2
|
103 |
/** Indicates those tasks associated with the executing program with which the
|
williamr@2
|
104 |
calling client is associated, are to be selected. */
|
williamr@2
|
105 |
EMyTasks
|
williamr@2
|
106 |
};
|
williamr@2
|
107 |
|
williamr@2
|
108 |
|
williamr@2
|
109 |
/**
|
williamr@2
|
110 |
Defines a filter to be used when listing schedules in a call to RScheduler::GetScheduleRefsL(),
|
williamr@2
|
111 |
and when listing tasks in a call to RScheduler::GetTaskRefsL().
|
williamr@2
|
112 |
|
williamr@2
|
113 |
@see RScheduler::GetScheduleRefsL()
|
williamr@2
|
114 |
@see RScheduler::GetTaskRefsL()
|
williamr@2
|
115 |
@publishedAll
|
williamr@2
|
116 |
@released
|
williamr@2
|
117 |
*/
|
williamr@2
|
118 |
enum TScheduleFilter
|
williamr@2
|
119 |
{
|
williamr@2
|
120 |
/** Indicates that all schedules are to be selected. */
|
williamr@2
|
121 |
EAllSchedules,
|
williamr@2
|
122 |
/** Indicates that only pending schedules are to be selected.
|
williamr@2
|
123 |
|
williamr@2
|
124 |
Note that pending schedules are those that are enabled and have tasks associated
|
williamr@2
|
125 |
with them. */
|
williamr@2
|
126 |
EPendingSchedules
|
williamr@2
|
127 |
};
|
williamr@2
|
128 |
|
williamr@2
|
129 |
/**
|
williamr@2
|
130 |
Defines the type of interval used by a schedule entry.
|
williamr@2
|
131 |
|
williamr@2
|
132 |
@see TScheduleEntryInfo
|
williamr@2
|
133 |
@publishedAll
|
williamr@2
|
134 |
@released
|
williamr@2
|
135 |
*/
|
williamr@2
|
136 |
enum TIntervalType
|
williamr@2
|
137 |
{
|
williamr@2
|
138 |
/** The interval is based on hours. */
|
williamr@2
|
139 |
EHourly,
|
williamr@2
|
140 |
/** The interval is based on days. */
|
williamr@2
|
141 |
EDaily,
|
williamr@2
|
142 |
/** The interval is based on months. */
|
williamr@2
|
143 |
EMonthly,
|
williamr@2
|
144 |
/** The interval is based on years. */
|
williamr@2
|
145 |
EYearly
|
williamr@2
|
146 |
};
|
williamr@2
|
147 |
|
williamr@2
|
148 |
/**
|
williamr@2
|
149 |
Defines the types of schedules supported by the task scheduler API
|
williamr@2
|
150 |
@internalAll
|
williamr@2
|
151 |
*/
|
williamr@2
|
152 |
enum TScheduleType
|
williamr@2
|
153 |
{
|
williamr@2
|
154 |
/** Indicates a time based schedule. */
|
williamr@2
|
155 |
ETimeSchedule,
|
williamr@2
|
156 |
/** Indicates a conditon based schedule. */
|
williamr@2
|
157 |
EConditionSchedule
|
williamr@2
|
158 |
};
|
williamr@2
|
159 |
|
williamr@2
|
160 |
|
williamr@2
|
161 |
/**
|
williamr@2
|
162 |
Defines a condition which a Publish and Subscribe Uid must satisfy.
|
williamr@2
|
163 |
|
williamr@2
|
164 |
A condition encapsulates three pieces of information:
|
williamr@2
|
165 |
|
williamr@2
|
166 |
the UID identifying the P&S variable against which a test is to be made.
|
williamr@2
|
167 |
|
williamr@2
|
168 |
the value against which that P&S variable is to be tested.
|
williamr@2
|
169 |
|
williamr@2
|
170 |
the type of test to be made.
|
williamr@2
|
171 |
|
williamr@2
|
172 |
@see RScheduler::CreatePersistentSchedule
|
williamr@2
|
173 |
@see RScheduler::EditSchedule
|
williamr@2
|
174 |
@see RScheduler::ScheduleTask
|
williamr@2
|
175 |
@see RScheduler::GetScheduleL
|
williamr@2
|
176 |
@see RProperty
|
williamr@2
|
177 |
|
williamr@2
|
178 |
@internalAll
|
williamr@2
|
179 |
*/
|
williamr@2
|
180 |
class TTaskSchedulerCondition
|
williamr@2
|
181 |
{
|
williamr@2
|
182 |
public:
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
An enumeration defining the type of test to be made against
|
williamr@2
|
185 |
a Publish and Subscribe property.
|
williamr@2
|
186 |
*/
|
williamr@2
|
187 |
enum TConditionType
|
williamr@2
|
188 |
{
|
williamr@2
|
189 |
/** Tests that a value is equal to a state variable value. */
|
williamr@2
|
190 |
EEquals,
|
williamr@2
|
191 |
/** Tests that a value is unequal to a state variable value. */
|
williamr@2
|
192 |
ENotEquals,
|
williamr@2
|
193 |
/** Tests that a value is greater than a state variable value. */
|
williamr@2
|
194 |
EGreaterThan,
|
williamr@2
|
195 |
/** Tests that a value is less than a state variable value. */
|
williamr@2
|
196 |
ELessThan
|
williamr@2
|
197 |
};
|
williamr@2
|
198 |
inline TTaskSchedulerCondition();
|
williamr@2
|
199 |
inline TTaskSchedulerCondition(TUid aCategory,
|
williamr@2
|
200 |
TUint aKey,
|
williamr@2
|
201 |
TInt aState,
|
williamr@2
|
202 |
TConditionType aType);
|
williamr@2
|
203 |
public:
|
williamr@2
|
204 |
/** P&S category.*/
|
williamr@2
|
205 |
TUid iCategory;
|
williamr@2
|
206 |
/** P&S key.*/
|
williamr@2
|
207 |
TUint iKey;
|
williamr@2
|
208 |
/** Integer state of corresponding P&S variable to be tested against*/
|
williamr@2
|
209 |
TInt iState;
|
williamr@2
|
210 |
/** type of test to be performed */
|
williamr@2
|
211 |
TConditionType iType;
|
williamr@2
|
212 |
};
|
williamr@2
|
213 |
|
williamr@2
|
214 |
|
williamr@2
|
215 |
/**
|
williamr@2
|
216 |
Constructs the object with default values.
|
williamr@2
|
217 |
|
williamr@2
|
218 |
The UID identifying the P&S category against which a test is to be made
|
williamr@2
|
219 |
is set to KNullUid. The sub key is set to zero.
|
williamr@2
|
220 |
|
williamr@2
|
221 |
The value against which that P&S variable is to be tested is set to zero.
|
williamr@2
|
222 |
|
williamr@2
|
223 |
The type of test to be made is set to EEquals.
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
inline TTaskSchedulerCondition::TTaskSchedulerCondition()
|
williamr@2
|
226 |
: iCategory(KNullUid),
|
williamr@2
|
227 |
iKey(0),
|
williamr@2
|
228 |
iState(0),
|
williamr@2
|
229 |
iType(EEquals)
|
williamr@2
|
230 |
{
|
williamr@2
|
231 |
}
|
williamr@2
|
232 |
|
williamr@2
|
233 |
/**
|
williamr@2
|
234 |
Constructs the object with the specified values.
|
williamr@2
|
235 |
|
williamr@2
|
236 |
Note that the RProperty variable identified by the aCategory/aKey pair
|
williamr@2
|
237 |
must be of integer type for this to be a valid task scheduler condition.
|
williamr@2
|
238 |
|
williamr@2
|
239 |
@param aCategory The publish and subscribe category to be tested.
|
williamr@2
|
240 |
@param aKey The publish and suscribe sub-key to be tested.
|
williamr@2
|
241 |
@param aState The value against which the P&S variable identified by the
|
williamr@2
|
242 |
specified UID is to be tested.
|
williamr@2
|
243 |
@param aType The type of test to be made.
|
williamr@2
|
244 |
|
williamr@2
|
245 |
@see RProperty
|
williamr@2
|
246 |
*/
|
williamr@2
|
247 |
inline TTaskSchedulerCondition::TTaskSchedulerCondition(TUid aCategory,
|
williamr@2
|
248 |
TUint aKey,
|
williamr@2
|
249 |
TInt aState,
|
williamr@2
|
250 |
TConditionType aType)
|
williamr@2
|
251 |
: iCategory(aCategory),
|
williamr@2
|
252 |
iKey(aKey),
|
williamr@2
|
253 |
iState(aState),
|
williamr@2
|
254 |
iType(aType)
|
williamr@2
|
255 |
{
|
williamr@2
|
256 |
}
|
williamr@2
|
257 |
|
williamr@2
|
258 |
/**
|
williamr@2
|
259 |
Defines, and uniquely identifies a schedule.
|
williamr@2
|
260 |
|
williamr@2
|
261 |
@see RScheduler::CreatePersistentSchedule()
|
williamr@2
|
262 |
@see RScheduler::ScheduleTask()
|
williamr@2
|
263 |
@see RScheduler::GetScheduleRefsL()
|
williamr@2
|
264 |
@see RScheduler::GetTaskRefsL()
|
williamr@2
|
265 |
@see RScheduler::GetTaskInfoL()
|
williamr@2
|
266 |
@publishedAll
|
williamr@2
|
267 |
@released
|
williamr@2
|
268 |
*/
|
williamr@2
|
269 |
class TSchedulerItemRef
|
williamr@2
|
270 |
{
|
williamr@2
|
271 |
public:
|
williamr@2
|
272 |
/** The unique Id for the schedule.
|
williamr@2
|
273 |
|
williamr@2
|
274 |
This is generated by the Task Scheduler when the schedule is created. Clients
|
williamr@2
|
275 |
should use this Id to refer to the schedule in future transactions. */
|
williamr@2
|
276 |
TInt iHandle;
|
williamr@2
|
277 |
|
williamr@2
|
278 |
/** The name of the schedule.
|
williamr@2
|
279 |
|
williamr@2
|
280 |
This is defined by the client. */
|
williamr@2
|
281 |
TName iName;
|
williamr@2
|
282 |
};
|
williamr@2
|
283 |
|
williamr@2
|
284 |
/**
|
williamr@2
|
285 |
Contains detailed information for a single schedule entry.
|
williamr@2
|
286 |
|
williamr@2
|
287 |
A schedule can have any number of schedule entries. A client passes one or
|
williamr@2
|
288 |
more of these objects, contained within an array, to the RScheduler functions
|
williamr@2
|
289 |
that create or amend a schedule.
|
williamr@2
|
290 |
|
williamr@2
|
291 |
@see RScheduler::CreatePersistentSchedule()
|
williamr@2
|
292 |
@see RScheduler::EditSchedule()
|
williamr@2
|
293 |
@see RScheduler::ScheduleTask()
|
williamr@2
|
294 |
@see RScheduler::GetScheduleL()
|
williamr@2
|
295 |
@publishedAll
|
williamr@2
|
296 |
@deprecated and replaced by TScheduleEntryInfo2
|
williamr@2
|
297 |
*/
|
williamr@2
|
298 |
class TScheduleEntryInfo
|
williamr@2
|
299 |
{
|
williamr@2
|
300 |
public:
|
williamr@2
|
301 |
void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
302 |
void InternalizeL(RReadStream& aStream);
|
williamr@2
|
303 |
|
williamr@2
|
304 |
/** Defines the type of time-frame relative to which execution of tasks is timed;
|
williamr@2
|
305 |
for example, EHourly implies relative to the current hour, EDaily implies
|
williamr@2
|
306 |
relative to the current day.
|
williamr@2
|
307 |
|
williamr@2
|
308 |
@see TIntervalType */
|
williamr@2
|
309 |
TIntervalType iIntervalType;
|
williamr@2
|
310 |
|
williamr@2
|
311 |
/** The first time that the entry will cause execution of tasks. */
|
williamr@2
|
312 |
TTime iStartTime;
|
williamr@2
|
313 |
|
williamr@2
|
314 |
/** The interval between execution of tasks.
|
williamr@2
|
315 |
|
williamr@2
|
316 |
The way that this value is interpreted depends on the value of iIntervalType.
|
williamr@2
|
317 |
For example, if the interval is 2 and iIntervalType has a value of EMonthly,
|
williamr@2
|
318 |
then the interval is 2 months.
|
williamr@2
|
319 |
|
williamr@2
|
320 |
The interval must have a minimum value of 1.
|
williamr@2
|
321 |
|
williamr@2
|
322 |
@see TIntervalType
|
williamr@2
|
323 |
@see iIntervalType */
|
williamr@2
|
324 |
TInt iInterval;
|
williamr@2
|
325 |
|
williamr@2
|
326 |
/** The period for which the entry is valid.
|
williamr@2
|
327 |
|
williamr@2
|
328 |
After the validity period has expired, tasks associated with the entry will
|
williamr@2
|
329 |
not be eligible for execution.
|
williamr@2
|
330 |
|
williamr@2
|
331 |
@see TTimeIntervalMinutes */
|
williamr@2
|
332 |
TTimeIntervalMinutes iValidityPeriod;
|
williamr@2
|
333 |
};
|
williamr@2
|
334 |
|
williamr@2
|
335 |
|
williamr@2
|
336 |
|
williamr@2
|
337 |
/**
|
williamr@2
|
338 |
Contains detailed information for a single schedule entry.
|
williamr@2
|
339 |
|
williamr@2
|
340 |
A schedule can have any number of schedule entries. A client passes one or
|
williamr@2
|
341 |
more of these objects, contained within an array, to the RScheduler functions
|
williamr@2
|
342 |
that create or amend a schedule.
|
williamr@2
|
343 |
|
williamr@2
|
344 |
@see RScheduler::CreatePersistentSchedule()
|
williamr@2
|
345 |
@see RScheduler::EditSchedule()
|
williamr@2
|
346 |
@see RScheduler::ScheduleTask()
|
williamr@2
|
347 |
@see RScheduler::GetScheduleL()
|
williamr@2
|
348 |
@publishedAll
|
williamr@2
|
349 |
@released
|
williamr@2
|
350 |
*/
|
williamr@2
|
351 |
class TScheduleEntryInfo2
|
williamr@2
|
352 |
{
|
williamr@2
|
353 |
public:
|
williamr@2
|
354 |
//constructors
|
williamr@2
|
355 |
IMPORT_C TScheduleEntryInfo2();
|
williamr@2
|
356 |
IMPORT_C TScheduleEntryInfo2(const TScheduleEntryInfo2& aEntryInfo);
|
williamr@2
|
357 |
IMPORT_C TScheduleEntryInfo2(const TTsTime& aStartTime, TIntervalType aIntervalType, TInt aInterval, TTimeIntervalMinutes aValidityPeriod);
|
williamr@2
|
358 |
|
williamr@2
|
359 |
//utility Get and Set methods
|
williamr@2
|
360 |
IMPORT_C TIntervalType IntervalType() const;
|
williamr@2
|
361 |
IMPORT_C void SetIntervalType(TIntervalType aIntervalType);
|
williamr@2
|
362 |
|
williamr@2
|
363 |
IMPORT_C const TTsTime& StartTime() const;
|
williamr@2
|
364 |
IMPORT_C void SetStartTime(const TTsTime& aStartTime);
|
williamr@2
|
365 |
|
williamr@2
|
366 |
IMPORT_C TInt Interval() const;
|
williamr@2
|
367 |
IMPORT_C void SetInterval(TInt aInterval);
|
williamr@2
|
368 |
|
williamr@2
|
369 |
IMPORT_C TTimeIntervalMinutes ValidityPeriod() const;
|
williamr@2
|
370 |
IMPORT_C void SetValidityPeriod(TTimeIntervalMinutes aValidityPeriod);
|
williamr@2
|
371 |
|
williamr@2
|
372 |
//assignment operator
|
williamr@2
|
373 |
IMPORT_C TScheduleEntryInfo2& operator=(const TScheduleEntryInfo2& aEntryInfo);
|
williamr@2
|
374 |
|
williamr@2
|
375 |
|
williamr@2
|
376 |
public:
|
williamr@2
|
377 |
// APIs for use within the Task Scheduler server
|
williamr@2
|
378 |
TScheduleEntryInfo2(const TScheduleEntryInfo& aEntryInfo);
|
williamr@2
|
379 |
void ProcessOffsetEvent();
|
williamr@2
|
380 |
|
williamr@2
|
381 |
void ExternalizeL(RWriteStream& aStream) const;
|
williamr@2
|
382 |
void InternalizeL(RReadStream& aStream);
|
williamr@2
|
383 |
|
williamr@2
|
384 |
private:
|
williamr@2
|
385 |
/** The interval between execution of tasks.
|
williamr@2
|
386 |
The way that this value is interpreted depends on the value of iIntervalType.
|
williamr@2
|
387 |
For example, if the interval is 2 and iIntervalType has a value of EMonthly,
|
williamr@2
|
388 |
then the interval is 2 months.
|
williamr@2
|
389 |
The interval must have a minimum value of 1.
|
williamr@2
|
390 |
*/
|
williamr@2
|
391 |
TInt iInterval;
|
williamr@2
|
392 |
|
williamr@2
|
393 |
/** Defines the type of interval between the execution of tasks.
|
williamr@2
|
394 |
May be EHourly, EDaily, EMonthly or EYearly.
|
williamr@2
|
395 |
*/
|
williamr@2
|
396 |
TIntervalType iIntervalType;
|
williamr@2
|
397 |
|
williamr@2
|
398 |
/** The first time that the entry will cause execution of tasks. */
|
williamr@2
|
399 |
TTsTime iStartTime;
|
williamr@2
|
400 |
|
williamr@2
|
401 |
/** The period for which the entry is valid.
|
williamr@2
|
402 |
After the validity period has expired, tasks associated with the entry will
|
williamr@2
|
403 |
not be eligible for execution.
|
williamr@2
|
404 |
*/
|
williamr@2
|
405 |
TTimeIntervalMinutes iValidityPeriod;
|
williamr@2
|
406 |
|
williamr@2
|
407 |
/** For future use
|
williamr@2
|
408 |
*/
|
williamr@2
|
409 |
TAny* iReserved;
|
williamr@2
|
410 |
|
williamr@2
|
411 |
// Declare the test accessor as a friend
|
williamr@2
|
412 |
friend class TScheduleEntryInfo2_StateAccessor;
|
williamr@2
|
413 |
};
|
williamr@2
|
414 |
|
williamr@2
|
415 |
|
williamr@2
|
416 |
/**
|
williamr@2
|
417 |
Defines the state of a schedule.
|
williamr@2
|
418 |
|
williamr@2
|
419 |
An object of this type is passed to, and populated by, a call to RScheduler::GetScheduleL().
|
williamr@2
|
420 |
|
williamr@2
|
421 |
@see RScheduler::GetScheduleL()
|
williamr@2
|
422 |
@publishedAll
|
williamr@2
|
423 |
@released
|
williamr@2
|
424 |
*/
|
williamr@2
|
425 |
class TScheduleState2
|
williamr@2
|
426 |
{
|
williamr@2
|
427 |
public:
|
williamr@2
|
428 |
|
williamr@2
|
429 |
//constructors
|
williamr@2
|
430 |
IMPORT_C TScheduleState2();
|
williamr@2
|
431 |
IMPORT_C TScheduleState2(const TScheduleState2& aScheduleState);
|
williamr@2
|
432 |
IMPORT_C TScheduleState2(const TName& aName, const TTsTime& aDueTime, TBool aPersists, TBool aEnabled);
|
williamr@2
|
433 |
|
williamr@2
|
434 |
//get, set methods
|
williamr@2
|
435 |
IMPORT_C const TName& Name() const;
|
williamr@2
|
436 |
IMPORT_C void SetName(const TName& aName);
|
williamr@2
|
437 |
|
williamr@2
|
438 |
IMPORT_C const TTsTime& DueTime() const;
|
williamr@2
|
439 |
IMPORT_C void SetDueTime(const TTsTime& aDueTime);
|
williamr@2
|
440 |
|
williamr@2
|
441 |
IMPORT_C TBool Persists() const;
|
williamr@2
|
442 |
IMPORT_C void SetPersists(TBool aPersists);
|
williamr@2
|
443 |
|
williamr@2
|
444 |
IMPORT_C TBool Enabled() const;
|
williamr@2
|
445 |
IMPORT_C void SetEnabled(TBool aEnabled);
|
williamr@2
|
446 |
|
williamr@2
|
447 |
IMPORT_C TScheduleState2& operator=(const TScheduleState2& aScheduleState);
|
williamr@2
|
448 |
|
williamr@2
|
449 |
private:
|
williamr@2
|
450 |
/** The name of the schedule. */
|
williamr@2
|
451 |
TName iName;
|
williamr@2
|
452 |
|
williamr@2
|
453 |
/** The time when the schedule is next due.
|
williamr@2
|
454 |
This only has meaning if the schedule is pending, i.e. it is enabled and has
|
williamr@2
|
455 |
tasks associated with it. */
|
williamr@2
|
456 |
TTsTime iDueTime;
|
williamr@2
|
457 |
|
williamr@2
|
458 |
/** Flags used to indicate:
|
williamr@2
|
459 |
1. Whether the schedule is enabled or not. (bit 0)
|
williamr@2
|
460 |
2. Whether the schedule is persistent or not. (bit 1)
|
williamr@2
|
461 |
If a schedule is persistent, its lifetime is not limited to the lifetime of
|
williamr@2
|
462 |
the tasks associated with it .
|
williamr@2
|
463 |
If a schedule is transient, it is created together with a new scheduled task,
|
williamr@2
|
464 |
and is destroyed when the task is destroyed.
|
williamr@2
|
465 |
|
williamr@2
|
466 |
Bits 2-31 reserved for future use
|
williamr@2
|
467 |
*/
|
williamr@2
|
468 |
TUint32 iFlags;
|
williamr@2
|
469 |
|
williamr@2
|
470 |
/** For future use
|
williamr@2
|
471 |
*/
|
williamr@2
|
472 |
TAny* iReserved;
|
williamr@2
|
473 |
|
williamr@2
|
474 |
// Declare the test accessor as a friend
|
williamr@2
|
475 |
friend class TScheduleState2_StateAccessor;
|
williamr@2
|
476 |
};
|
williamr@2
|
477 |
|
williamr@2
|
478 |
/**
|
williamr@2
|
479 |
Defines the state of a schedule.
|
williamr@2
|
480 |
|
williamr@2
|
481 |
An object of this type is passed to, and populated by, a call to RScheduler::GetScheduleL().
|
williamr@2
|
482 |
|
williamr@2
|
483 |
@see RScheduler::GetScheduleL()
|
williamr@2
|
484 |
@publishedAll
|
williamr@2
|
485 |
@deprecated and replaced by TScheduleState2.
|
williamr@2
|
486 |
*/
|
williamr@2
|
487 |
class TScheduleState
|
williamr@2
|
488 |
{
|
williamr@2
|
489 |
public:
|
williamr@2
|
490 |
//constructor for use with the deprecated APIs
|
williamr@2
|
491 |
TScheduleState(const TScheduleState2& aScheduleState2);
|
williamr@2
|
492 |
TScheduleState()
|
williamr@2
|
493 |
{
|
williamr@2
|
494 |
}
|
williamr@2
|
495 |
|
williamr@2
|
496 |
/** The name of the schedule. */
|
williamr@2
|
497 |
TName iName;
|
williamr@2
|
498 |
|
williamr@2
|
499 |
/** The time when the schedule is next due.
|
williamr@2
|
500 |
|
williamr@2
|
501 |
This only has meaning if the schedule is pending, i.e. it is enabled and has
|
williamr@2
|
502 |
tasks associated with it. */
|
williamr@2
|
503 |
TTime iDueTime;
|
williamr@2
|
504 |
|
williamr@2
|
505 |
/** Indicates whether the schedule is persistent or not.
|
williamr@2
|
506 |
|
williamr@2
|
507 |
If a schedule is persistent, its lifetime is not limited to the lifetime of
|
williamr@2
|
508 |
the tasks associated with it .
|
williamr@2
|
509 |
|
williamr@2
|
510 |
If a schedule is transient, it is created together with a new scheduled task,
|
williamr@2
|
511 |
and is destroyed when the task is destroyed. */
|
williamr@2
|
512 |
TBool iPersists;
|
williamr@2
|
513 |
|
williamr@2
|
514 |
/** Indicates whether the schedule is enabled or not. */
|
williamr@2
|
515 |
TBool iEnabled;
|
williamr@2
|
516 |
};
|
williamr@2
|
517 |
|
williamr@2
|
518 |
/**
|
williamr@2
|
519 |
@internalComponent
|
williamr@2
|
520 |
*/
|
williamr@2
|
521 |
class TScheduleInfo // Move to cschcode.h when appropriate
|
williamr@2
|
522 |
{
|
williamr@2
|
523 |
public:
|
williamr@2
|
524 |
TScheduleState2 iState;
|
williamr@2
|
525 |
TInt iEntryCount;
|
williamr@2
|
526 |
TInt iTaskCount;
|
williamr@2
|
527 |
};
|
williamr@2
|
528 |
|
williamr@2
|
529 |
/**
|
williamr@2
|
530 |
@internalAll
|
williamr@2
|
531 |
@deprecated replaced with TScheduleSettings2
|
williamr@2
|
532 |
*/
|
williamr@2
|
533 |
class TScheduleSettings // Move to cschcode.h when appropriate
|
williamr@2
|
534 |
{
|
williamr@2
|
535 |
public:
|
williamr@2
|
536 |
TBool iPersists;
|
williamr@2
|
537 |
TInt iEntryCount;
|
williamr@2
|
538 |
};
|
williamr@2
|
539 |
|
williamr@2
|
540 |
#endif
|