epoc32/include/schinfo.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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@4
     4
// under the terms of "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.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@4
    32
williamr@4
    33
williamr@2
    34
/** 
williamr@2
    35
Contains detailed information for a single task.
williamr@2
    36
williamr@2
    37
A schedule can have any number of tasks. An object of this type is passed 
williamr@2
    38
to RScheduler::ScheduleTask(). Objects of this type are also returned by functions 
williamr@2
    39
within RScheduler that retrieve information about tasks.
williamr@2
    40
williamr@2
    41
@see RScheduler::ScheduleTask()
williamr@2
    42
@see RScheduler::GetScheduleL()
williamr@2
    43
@see RScheduler::GetTaskInfoL() 
williamr@2
    44
@publishedAll
williamr@2
    45
@released
williamr@2
    46
*/
williamr@2
    47
class TTaskInfo
williamr@2
    48
	{
williamr@2
    49
public:
williamr@2
    50
	//ctors
williamr@2
    51
	IMPORT_C TTaskInfo (TInt aTaskId, TName& aName, TInt aPriority, TInt aRepeat);
williamr@2
    52
	IMPORT_C TTaskInfo();//
williamr@2
    53
	//assignment
williamr@2
    54
	IMPORT_C TTaskInfo& operator=(const TTaskInfo& aTaskInfo);
williamr@2
    55
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
    56
	IMPORT_C void InternalizeL(RReadStream& aStream);
williamr@2
    57
	//needs a copy ctor
williamr@2
    58
	//TTaskInfo (TTaskInfo& aTaskInfo);
williamr@2
    59
	
williamr@2
    60
	//data
williamr@2
    61
	/** Specifies how often the task is to be repeated.
williamr@2
    62
	
williamr@2
    63
	This is defined by the client.
williamr@2
    64
	
williamr@2
    65
	A value of 1 means once, a value of 2 means twice etc.
williamr@2
    66
	
williamr@2
    67
	Note that zero is interpreted to mean once, and a negative value is interpreted 
williamr@2
    68
	to mean that the task will be repeated until it is explicitly deleted. */
williamr@2
    69
	TInt iRepeat;
williamr@2
    70
	
williamr@2
    71
	/** The unique Id for the task.
williamr@2
    72
	
williamr@2
    73
	This is generated by the Task Scheduler. Clients should use the generated 
williamr@2
    74
	Id to refer to the task in future transactions. */
williamr@2
    75
	TInt iTaskId;
williamr@2
    76
	
williamr@2
    77
	/** The name of the task.
williamr@2
    78
	
williamr@2
    79
	This is defined by the client.
williamr@2
    80
	
williamr@2
    81
	@see TName */
williamr@2
    82
	TName iName;
williamr@2
    83
	
williamr@2
    84
	/** The priority of the task.
williamr@2
    85
	
williamr@2
    86
	This is defined by the client.
williamr@2
    87
	
williamr@2
    88
	Determines the order in which a client's tasks are executed. Where a client 
williamr@2
    89
	has two tasks with different priorities, the task with the higher priority 
williamr@2
    90
	will be executed first. */
williamr@2
    91
	TInt iPriority;
williamr@2
    92
	};
williamr@2
    93
williamr@2
    94
/** 
williamr@2
    95
Defines a filter to be used when listing tasks scheduled in a call to RScheduler::GetTaskRefsL().
williamr@2
    96
williamr@2
    97
@see RScheduler::GetTaskRefsL()
williamr@2
    98
@publishedAll
williamr@2
    99
@released
williamr@2
   100
*/
williamr@2
   101
enum TTaskFilter
williamr@2
   102
	{
williamr@2
   103
	/** Indicates that all tasks are to be selected. */
williamr@2
   104
	EAllTasks,
williamr@2
   105
	/** Indicates those tasks associated with the executing program with which the 
williamr@2
   106
	calling client is associated, are to be selected. */
williamr@2
   107
	EMyTasks
williamr@2
   108
	};
williamr@2
   109
williamr@2
   110
williamr@2
   111
/** 
williamr@2
   112
Defines a filter to be used when listing schedules in a call to RScheduler::GetScheduleRefsL(), 
williamr@2
   113
and when listing tasks in a call to RScheduler::GetTaskRefsL().
williamr@2
   114
williamr@2
   115
@see RScheduler::GetScheduleRefsL()
williamr@2
   116
@see RScheduler::GetTaskRefsL() 
williamr@2
   117
@publishedAll
williamr@2
   118
@released
williamr@2
   119
*/
williamr@2
   120
enum TScheduleFilter
williamr@2
   121
	{
williamr@2
   122
	/** Indicates that all schedules are to be selected. */
williamr@2
   123
	EAllSchedules,
williamr@2
   124
	/** Indicates that only pending schedules are to be selected.
williamr@2
   125
	
williamr@2
   126
	Note that pending schedules are those that are enabled and have tasks associated 
williamr@2
   127
	with them. */
williamr@2
   128
	EPendingSchedules
williamr@2
   129
	};
williamr@2
   130
williamr@2
   131
/** 
williamr@2
   132
Defines the type of interval used by a schedule entry.
williamr@2
   133
williamr@2
   134
@see TScheduleEntryInfo
williamr@2
   135
@publishedAll
williamr@2
   136
@released
williamr@2
   137
*/
williamr@2
   138
enum TIntervalType
williamr@2
   139
	{
williamr@2
   140
	/** The interval is based on hours. */
williamr@2
   141
	EHourly,
williamr@2
   142
	/** The interval is based on days. */
williamr@2
   143
	EDaily,
williamr@2
   144
	/** The interval is based on months. */
williamr@2
   145
	EMonthly,
williamr@2
   146
	/** The interval is based on years. */
williamr@2
   147
	EYearly
williamr@2
   148
	};
williamr@2
   149
williamr@4
   150
williamr@2
   151
/**
williamr@2
   152
Defines the types of schedules supported by the task scheduler API
williamr@2
   153
@internalAll
williamr@2
   154
*/
williamr@4
   155
// Not for Client use , only to be used internally 
williamr@2
   156
enum TScheduleType
williamr@2
   157
	{
williamr@2
   158
	/** Indicates a time based schedule. */
williamr@2
   159
	ETimeSchedule,
williamr@2
   160
	/** Indicates a conditon based schedule. */
williamr@2
   161
	EConditionSchedule
williamr@2
   162
	};
williamr@2
   163
williamr@2
   164
	
williamr@2
   165
/** 
williamr@2
   166
Defines, and uniquely identifies a schedule.
williamr@2
   167
williamr@2
   168
@see RScheduler::CreatePersistentSchedule()
williamr@2
   169
@see RScheduler::ScheduleTask()
williamr@2
   170
@see RScheduler::GetScheduleRefsL()
williamr@2
   171
@see RScheduler::GetTaskRefsL()
williamr@2
   172
@see RScheduler::GetTaskInfoL()
williamr@2
   173
@publishedAll
williamr@2
   174
@released
williamr@2
   175
*/
williamr@2
   176
class TSchedulerItemRef
williamr@2
   177
	{
williamr@2
   178
public:
williamr@2
   179
	/** The unique Id for the schedule.
williamr@2
   180
	
williamr@2
   181
	This is generated by the Task Scheduler when the schedule is created. Clients 
williamr@2
   182
	should use this Id to refer to the schedule in future transactions. */
williamr@2
   183
	TInt iHandle;
williamr@2
   184
	
williamr@2
   185
	/** The name of the schedule.
williamr@2
   186
	
williamr@2
   187
	This is defined by the client. */
williamr@2
   188
	TName iName;
williamr@2
   189
	};
williamr@2
   190
williamr@2
   191
/** 
williamr@2
   192
Contains detailed information for a single schedule entry.
williamr@2
   193
williamr@2
   194
A schedule can have any number of schedule entries. A client passes one or 
williamr@2
   195
more of these objects, contained within an array, to the RScheduler functions 
williamr@2
   196
that create or amend a schedule.
williamr@2
   197
williamr@2
   198
@see RScheduler::CreatePersistentSchedule()
williamr@2
   199
@see RScheduler::EditSchedule()
williamr@2
   200
@see RScheduler::ScheduleTask()
williamr@2
   201
@see RScheduler::GetScheduleL() 
williamr@2
   202
@publishedAll
williamr@2
   203
@deprecated and replaced by TScheduleEntryInfo2
williamr@2
   204
*/
williamr@2
   205
class TScheduleEntryInfo
williamr@2
   206
	{
williamr@2
   207
public:
williamr@2
   208
	void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   209
	void InternalizeL(RReadStream& aStream);
williamr@2
   210
williamr@2
   211
	/** Defines the type of time-frame relative to which execution of tasks is timed; 
williamr@2
   212
	for example, EHourly implies relative to the current hour, EDaily implies 
williamr@2
   213
	relative to the current day.
williamr@2
   214
	
williamr@2
   215
	@see TIntervalType */
williamr@2
   216
	TIntervalType iIntervalType;
williamr@2
   217
	
williamr@2
   218
	/** The first time that the entry will cause execution of tasks. */
williamr@2
   219
	TTime iStartTime;
williamr@2
   220
	
williamr@2
   221
	/** The interval between execution of tasks.
williamr@2
   222
	
williamr@2
   223
	The way that this value is interpreted depends on the value of iIntervalType. 
williamr@2
   224
	For example, if the interval is 2 and iIntervalType has a value of EMonthly, 
williamr@2
   225
	then the interval is 2 months.
williamr@2
   226
	
williamr@2
   227
	The interval must have a minimum value of 1.
williamr@2
   228
	
williamr@2
   229
	@see TIntervalType
williamr@2
   230
	@see iIntervalType */
williamr@2
   231
	TInt iInterval;
williamr@2
   232
	
williamr@2
   233
	/** The period for which the entry is valid.
williamr@2
   234
	
williamr@2
   235
	After the validity period has expired, tasks associated with the entry will 
williamr@2
   236
	not be eligible for execution.
williamr@2
   237
	
williamr@2
   238
	@see TTimeIntervalMinutes */
williamr@2
   239
	TTimeIntervalMinutes iValidityPeriod;
williamr@2
   240
	};
williamr@2
   241
	
williamr@2
   242
	
williamr@2
   243
	
williamr@2
   244
/** 
williamr@2
   245
Contains detailed information for a single schedule entry.
williamr@2
   246
williamr@2
   247
A schedule can have any number of schedule entries. A client passes one or 
williamr@2
   248
more of these objects, contained within an array, to the RScheduler functions 
williamr@2
   249
that create or amend a schedule.
williamr@2
   250
williamr@2
   251
@see RScheduler::CreatePersistentSchedule()
williamr@2
   252
@see RScheduler::EditSchedule()
williamr@2
   253
@see RScheduler::ScheduleTask()
williamr@2
   254
@see RScheduler::GetScheduleL() 
williamr@2
   255
@publishedAll
williamr@2
   256
@released
williamr@2
   257
*/
williamr@2
   258
class TScheduleEntryInfo2
williamr@2
   259
	{
williamr@2
   260
public:
williamr@2
   261
	//constructors
williamr@2
   262
	IMPORT_C TScheduleEntryInfo2();
williamr@2
   263
	IMPORT_C TScheduleEntryInfo2(const TScheduleEntryInfo2& aEntryInfo);
williamr@2
   264
	IMPORT_C TScheduleEntryInfo2(const TTsTime& aStartTime, TIntervalType aIntervalType, TInt aInterval, TTimeIntervalMinutes aValidityPeriod);
williamr@2
   265
	 
williamr@2
   266
	//utility Get and Set methods
williamr@2
   267
	IMPORT_C TIntervalType IntervalType() const;
williamr@2
   268
	IMPORT_C void SetIntervalType(TIntervalType aIntervalType);
williamr@2
   269
williamr@2
   270
	IMPORT_C const TTsTime& StartTime() const;
williamr@2
   271
	IMPORT_C void SetStartTime(const TTsTime& aStartTime);
williamr@2
   272
williamr@2
   273
	IMPORT_C TInt Interval() const;
williamr@2
   274
	IMPORT_C void SetInterval(TInt aInterval);
williamr@2
   275
williamr@2
   276
	IMPORT_C TTimeIntervalMinutes ValidityPeriod() const;
williamr@2
   277
	IMPORT_C void SetValidityPeriod(TTimeIntervalMinutes aValidityPeriod);
williamr@2
   278
williamr@2
   279
	//assignment operator	
williamr@2
   280
	IMPORT_C TScheduleEntryInfo2& operator=(const TScheduleEntryInfo2& aEntryInfo);
williamr@2
   281
williamr@2
   282
williamr@2
   283
public:
williamr@2
   284
	// APIs for use within the Task Scheduler server
williamr@2
   285
	TScheduleEntryInfo2(const TScheduleEntryInfo& aEntryInfo);
williamr@2
   286
	void ProcessOffsetEvent();
williamr@2
   287
williamr@2
   288
	void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   289
	void InternalizeL(RReadStream& aStream);
williamr@2
   290
williamr@2
   291
private:
williamr@2
   292
	/** The interval between execution of tasks.
williamr@2
   293
	The way that this value is interpreted depends on the value of iIntervalType. 
williamr@2
   294
	For example, if the interval is 2 and iIntervalType has a value of EMonthly, 
williamr@2
   295
	then the interval is 2 months.
williamr@2
   296
	The interval must have a minimum value of 1.
williamr@2
   297
	 */
williamr@2
   298
	TInt iInterval;
williamr@2
   299
	
williamr@2
   300
	/** Defines the type of interval between the execution of tasks. 
williamr@2
   301
	May be EHourly, EDaily, EMonthly or EYearly.
williamr@2
   302
	 */
williamr@2
   303
	TIntervalType iIntervalType;
williamr@2
   304
	
williamr@2
   305
	/** The first time that the entry will cause execution of tasks. */
williamr@2
   306
	TTsTime iStartTime;
williamr@2
   307
	
williamr@2
   308
	/** The period for which the entry is valid.
williamr@2
   309
	After the validity period has expired, tasks associated with the entry will 
williamr@2
   310
	not be eligible for execution.
williamr@2
   311
	*/
williamr@2
   312
	TTimeIntervalMinutes iValidityPeriod;
williamr@2
   313
williamr@2
   314
	/** For future use
williamr@2
   315
	*/
williamr@2
   316
	TAny* iReserved;	
williamr@2
   317
	
williamr@2
   318
	// Declare the test accessor as a friend
williamr@2
   319
	friend class TScheduleEntryInfo2_StateAccessor;
williamr@2
   320
	};
williamr@2
   321
williamr@2
   322
williamr@2
   323
/** 
williamr@2
   324
Defines the state of a schedule.
williamr@2
   325
williamr@2
   326
An object of this type is passed to, and populated by, a call to RScheduler::GetScheduleL().
williamr@2
   327
williamr@2
   328
@see RScheduler::GetScheduleL()
williamr@2
   329
@publishedAll
williamr@2
   330
@released
williamr@2
   331
*/
williamr@2
   332
class TScheduleState2
williamr@2
   333
	{
williamr@2
   334
public:
williamr@2
   335
williamr@2
   336
	//constructors
williamr@2
   337
	IMPORT_C TScheduleState2();
williamr@2
   338
	IMPORT_C TScheduleState2(const TScheduleState2& aScheduleState);
williamr@2
   339
	IMPORT_C TScheduleState2(const TName& aName, const TTsTime& aDueTime, TBool aPersists, TBool aEnabled);
williamr@2
   340
		
williamr@2
   341
	//get, set methods
williamr@2
   342
	IMPORT_C const TName& Name() const;
williamr@2
   343
	IMPORT_C void SetName(const TName& aName);
williamr@2
   344
williamr@2
   345
	IMPORT_C const TTsTime& DueTime() const;
williamr@2
   346
	IMPORT_C void SetDueTime(const TTsTime& aDueTime);
williamr@2
   347
williamr@2
   348
	IMPORT_C TBool Persists() const;
williamr@2
   349
	IMPORT_C void SetPersists(TBool aPersists);
williamr@2
   350
williamr@2
   351
	IMPORT_C TBool Enabled() const;
williamr@2
   352
	IMPORT_C void SetEnabled(TBool aEnabled);
williamr@2
   353
	
williamr@2
   354
	IMPORT_C TScheduleState2& operator=(const TScheduleState2& aScheduleState);
williamr@2
   355
williamr@2
   356
private:
williamr@2
   357
	/** The name of the schedule. */
williamr@2
   358
	TName iName;
williamr@2
   359
	
williamr@2
   360
	/** The time when the schedule is next due.
williamr@2
   361
	This only has meaning if the schedule is pending, i.e. it is enabled and has 
williamr@2
   362
	tasks associated with it. */
williamr@2
   363
	TTsTime iDueTime;
williamr@2
   364
	
williamr@2
   365
	/** Flags used to indicate:
williamr@2
   366
	1.  Whether the schedule is enabled or not. (bit 0)
williamr@2
   367
	2.	Whether the schedule is persistent or not. (bit 1)
williamr@2
   368
		If a schedule is persistent, its lifetime is not limited to the lifetime of 
williamr@2
   369
		the tasks associated with it .
williamr@2
   370
		If a schedule is transient, it is created together with a new scheduled task, 
williamr@2
   371
		and is destroyed when the task is destroyed.
williamr@2
   372
		
williamr@2
   373
		Bits 2-31 reserved for future use
williamr@2
   374
	*/
williamr@2
   375
	TUint32 iFlags;
williamr@2
   376
	
williamr@2
   377
	/** For future use
williamr@2
   378
	*/
williamr@2
   379
	TAny* iReserved;
williamr@2
   380
	
williamr@2
   381
	// Declare the test accessor as a friend
williamr@2
   382
	friend class TScheduleState2_StateAccessor;
williamr@2
   383
	};
williamr@2
   384
williamr@2
   385
/** 
williamr@2
   386
Defines the state of a schedule.
williamr@2
   387
williamr@2
   388
An object of this type is passed to, and populated by, a call to RScheduler::GetScheduleL().
williamr@2
   389
williamr@2
   390
@see RScheduler::GetScheduleL()
williamr@2
   391
@publishedAll
williamr@2
   392
@deprecated and replaced by TScheduleState2.
williamr@2
   393
*/
williamr@2
   394
class TScheduleState
williamr@2
   395
	{
williamr@2
   396
public:
williamr@2
   397
	//constructor for use with the deprecated APIs
williamr@2
   398
	TScheduleState(const TScheduleState2& aScheduleState2);
williamr@2
   399
	TScheduleState()
williamr@2
   400
		{		
williamr@2
   401
		}
williamr@2
   402
	
williamr@2
   403
	/** The name of the schedule. */
williamr@2
   404
	TName iName;
williamr@2
   405
	
williamr@2
   406
	/** The time when the schedule is next due.
williamr@2
   407
	
williamr@2
   408
	This only has meaning if the schedule is pending, i.e. it is enabled and has 
williamr@2
   409
	tasks associated with it. */
williamr@2
   410
	TTime iDueTime;
williamr@2
   411
	
williamr@2
   412
	/** Indicates whether the schedule is persistent or not.
williamr@2
   413
	
williamr@2
   414
	If a schedule is persistent, its lifetime is not limited to the lifetime of 
williamr@2
   415
	the tasks associated with it .
williamr@2
   416
	
williamr@2
   417
	If a schedule is transient, it is created together with a new scheduled task, 
williamr@2
   418
	and is destroyed when the task is destroyed. */
williamr@2
   419
	TBool iPersists;
williamr@2
   420
	
williamr@2
   421
	/** Indicates whether the schedule is enabled or not. */
williamr@2
   422
	TBool iEnabled;
williamr@2
   423
	};
williamr@2
   424
williamr@4
   425
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@4
   426
#include <schinfointernal.h>
williamr@2
   427
williamr@2
   428
#endif
williamr@4
   429
williamr@4
   430
#endif