epoc32/include/csch_cli.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
// RScheduler class
williamr@2
    15
// Client Interface to Scheduler
williamr@2
    16
// 
williamr@2
    17
//
williamr@2
    18
williamr@2
    19
#if !defined(__CSCH_CLI_H__)
williamr@2
    20
#define __CSCH_CLI_H__
williamr@2
    21
williamr@2
    22
#if !defined(__E32BASE_H__)
williamr@2
    23
#include <e32base.h>
williamr@2
    24
#endif
williamr@2
    25
williamr@2
    26
#if !defined(__E32STD_H__)
williamr@2
    27
#include <e32std.h>
williamr@2
    28
#endif
williamr@2
    29
williamr@2
    30
#if !defined(__SCHINFO_H__)
williamr@2
    31
#include <schinfo.h>
williamr@2
    32
#endif
williamr@2
    33
williamr@2
    34
#include <e32cons.h>
williamr@2
    35
williamr@4
    36
williamr@2
    37
class TTaskSchedulerCondition;
williamr@2
    38
class TScheduleSettings2;
williamr@4
    39
class TScheduleInfo;
williamr@4
    40
williamr@2
    41
williamr@2
    42
/** 
williamr@2
    43
Constants
williamr@2
    44
@publishedAll
williamr@2
    45
@deprecated
williamr@2
    46
*/
williamr@2
    47
const TUint KESchMajorVersionNumber=1;
williamr@2
    48
const TUint KESchMinorVersionNumber=0;
williamr@2
    49
const TUint KESchBuildVersionNumber=50;
williamr@2
    50
williamr@2
    51
williamr@2
    52
williamr@2
    53
/**
williamr@2
    54
Client side interface to the Task Scheduler.
williamr@2
    55
@publishedAll	
williamr@2
    56
@released
williamr@2
    57
*/
williamr@2
    58
class RScheduler : public RSessionBase
williamr@2
    59
	{
williamr@2
    60
public:
williamr@2
    61
	IMPORT_C RScheduler();
williamr@2
    62
	IMPORT_C TInt Connect();
williamr@2
    63
	IMPORT_C TVersion Version() const;
williamr@2
    64
	
williamr@2
    65
	// client registration
williamr@2
    66
	IMPORT_C TInt Register(const TFileName& aFileName,const TInt aPriority);
williamr@2
    67
	
williamr@2
    68
	// schedule editing
williamr@2
    69
	IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef, 
williamr@2
    70
							const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList);
williamr@2
    71
williamr@2
    72
	IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef, 
williamr@2
    73
							const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
    74
							const TTsTime& aDefaultRunTime);
williamr@2
    75
williamr@2
    76
	IMPORT_C TInt DeleteSchedule(const TInt aScheduleHandle) const;
williamr@2
    77
williamr@2
    78
	IMPORT_C TInt DisableSchedule(const TInt aScheduleHandle) const;
williamr@2
    79
williamr@2
    80
	IMPORT_C TInt EnableSchedule(const TInt aScheduleHandle) const;
williamr@2
    81
williamr@2
    82
	// This will return KErrArgument if the schedule is not a time based one.
williamr@2
    83
	// (consistent behaviour with GetScheduleL below).
williamr@2
    84
	IMPORT_C TInt EditSchedule(const TInt aScheduleHandle, 
williamr@2
    85
							const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList);
williamr@2
    86
williamr@2
    87
	// This will return KErrArgument if the schedule is not a condition based one.
williamr@2
    88
	// (consistent behaviour with GetScheduleL below).
williamr@2
    89
	IMPORT_C TInt EditSchedule(TInt aScheduleHandle, 
williamr@2
    90
							const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
    91
							const TTsTime& aDefaultRunTime);	
williamr@2
    92
williamr@2
    93
	//task funtions
williamr@2
    94
	// Schedule a task based on a persistent schedule.  Will return KErrArgument
williamr@2
    95
	// if schedule is a condition based one and task repeat is not 0.
williamr@2
    96
	IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo, 
williamr@2
    97
							HBufC& aTaskData, 
williamr@2
    98
							const TInt aScheduleHandle);
williamr@2
    99
williamr@2
   100
	//creates a transient schedule
williamr@2
   101
	IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo, 
williamr@2
   102
							HBufC& aTaskData, 
williamr@2
   103
							TSchedulerItemRef& aRef,
williamr@2
   104
							const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList);
williamr@2
   105
williamr@2
   106
	// creates a transient schedule based on conditions.  Will return KErrArgument
williamr@2
   107
	// if schedule is a condition based one and task repeat is not 0.
williamr@2
   108
	IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo, 
williamr@2
   109
							HBufC& aTaskData, 
williamr@2
   110
							TSchedulerItemRef& aRef, 
williamr@2
   111
							const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   112
							const TTsTime& aDefaultRunTime);
williamr@2
   113
williamr@2
   114
	IMPORT_C TInt DeleteTask(const TInt aTaskId) const;
williamr@2
   115
	
williamr@2
   116
	//retrieving
williamr@2
   117
	IMPORT_C TInt GetScheduleRefsL(CArrayFixFlat<TSchedulerItemRef>& aScheduleRefArray,
williamr@2
   118
							const TScheduleFilter aFilter);
williamr@2
   119
williamr@2
   120
	// Gets time based schedule.  Will return KErrArgument if scheduleType 
williamr@2
   121
	// is not time based.
williamr@2
   122
	IMPORT_C TInt GetScheduleL(const TInt aScheduleHandle, 
williamr@2
   123
							TScheduleState2& aState, 
williamr@2
   124
							CArrayFixFlat<TScheduleEntryInfo2>& aEntries, 
williamr@2
   125
							CArrayFixFlat<TTaskInfo>& aTasks, 
williamr@2
   126
							TTsTime& aDueTime);
williamr@2
   127
williamr@2
   128
	// Gets condition based schedule.  Will return KErrArgument if scheduleType 
williamr@2
   129
	// is not condition based. 
williamr@2
   130
	IMPORT_C TInt GetScheduleL(TInt aScheduleHandle, 
williamr@2
   131
							TScheduleState2& aState, 
williamr@2
   132
							CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   133
							TTsTime& aDefaultRunTime, 
williamr@2
   134
							CArrayFixFlat<TTaskInfo>& aTasks);
williamr@2
   135
williamr@2
   136
	IMPORT_C TInt GetTaskRefsL(CArrayFixFlat<TSchedulerItemRef>& aTasks,
williamr@2
   137
							const TScheduleFilter aScheduleFilter, 
williamr@2
   138
							const TTaskFilter aTaskFilter);
williamr@2
   139
williamr@2
   140
	IMPORT_C TInt GetTaskInfoL(const TInt aTaskId, 
williamr@2
   141
							TTaskInfo& aTaskInfo, 
williamr@2
   142
							TPtr& aTaskData, 
williamr@2
   143
							TSchedulerItemRef& aRef, 
williamr@2
   144
							TTsTime& aNextDue);
williamr@2
   145
williamr@2
   146
	IMPORT_C TInt GetTaskDataSize(const TInt aTaskId, TInt& aSize);
williamr@2
   147
	
williamr@2
   148
	// Gets the scheduletype for a given schedule handle
williamr@2
   149
	IMPORT_C TInt GetScheduleTypeL(TInt aScheduleHandle,
williamr@2
   150
											TScheduleType& aScheduleType);
williamr@2
   151
public:
williamr@2
   152
	//deprecated API functions as of v9.2
williamr@2
   153
	//clients of these APIs are encouraged to migrate to the equivalent APIs above.
williamr@2
   154
	//see ../Documentation/Feature Documentation/SGL.GT0250.204 Task Scheduler Migration Guide to new APIs in Symbian OS v9.x.doc
williamr@2
   155
	
williamr@2
   156
	IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef, 
williamr@2
   157
							const CArrayFixFlat<TScheduleEntryInfo>& aEntryList);
williamr@2
   158
williamr@2
   159
	IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef, 
williamr@2
   160
							const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   161
							const TTime& aDefaultRunTime);
williamr@2
   162
williamr@2
   163
	IMPORT_C TInt EditSchedule(const TInt aScheduleHandle, 
williamr@2
   164
							const CArrayFixFlat<TScheduleEntryInfo>& aEntryList);
williamr@2
   165
williamr@2
   166
	IMPORT_C TInt EditSchedule(TInt aScheduleHandle, 
williamr@2
   167
							const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   168
							const TTime& aDefaultRunTime);	
williamr@2
   169
williamr@2
   170
	IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo, 
williamr@2
   171
							HBufC& aTaskData, 
williamr@2
   172
							TSchedulerItemRef& aRef,
williamr@2
   173
							const CArrayFixFlat<TScheduleEntryInfo>& aEntryList);
williamr@2
   174
williamr@2
   175
	IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo, 
williamr@2
   176
							HBufC& aTaskData, 
williamr@2
   177
							TSchedulerItemRef& aRef, 
williamr@2
   178
							const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   179
							const TTime& aDefaultRunTime);
williamr@2
   180
	
williamr@2
   181
	IMPORT_C TInt GetScheduleL(const TInt aScheduleHandle, 
williamr@2
   182
							TScheduleState& aState, 
williamr@2
   183
							CArrayFixFlat<TScheduleEntryInfo>& aEntries, 
williamr@2
   184
							CArrayFixFlat<TTaskInfo>& aTasks, 
williamr@2
   185
							TTime& aDueTime);
williamr@2
   186
williamr@2
   187
	IMPORT_C TInt GetScheduleL(TInt aScheduleHandle, 
williamr@2
   188
							TScheduleState& aState, 
williamr@2
   189
							CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   190
							TTime& aDefaultRunTime, 
williamr@2
   191
							CArrayFixFlat<TTaskInfo>& aTasks);
williamr@2
   192
williamr@2
   193
	IMPORT_C TInt GetTaskInfoL(const TInt aTaskId, 
williamr@2
   194
							TTaskInfo& aTaskInfo, 
williamr@2
   195
							TPtr& aTaskData, 
williamr@2
   196
							TSchedulerItemRef& aRef, 
williamr@2
   197
							TTime& aNextDue);
williamr@2
   198
	
williamr@2
   199
public://debug functions.
williamr@2
   200
	//these functions are included in rel for rel/deb compatibility, 
williamr@2
   201
	//but only do stuff in debug builds
williamr@2
   202
	IMPORT_C TInt __DbgMarkHeap();
williamr@2
   203
	IMPORT_C TInt __DbgCheckHeap(TInt aCount);
williamr@2
   204
	IMPORT_C TInt __DbgMarkEnd(TInt aCount);
williamr@2
   205
	IMPORT_C TInt __DbgFailNext(TInt aCount);
williamr@2
   206
	IMPORT_C TInt __DbgResetHeap();
williamr@2
   207
	IMPORT_C TInt __FaultServer();//kill the server!
williamr@2
   208
williamr@2
   209
private:
williamr@2
   210
	TInt CreateSchedule(TSchedulerItemRef& aRef, 
williamr@2
   211
						const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList, 
williamr@2
   212
						const TScheduleSettings2& aSettings);
williamr@2
   213
	TInt CreateSchedule(TSchedulerItemRef& aRef, 
williamr@2
   214
						const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   215
						const TTsTime& aDefaultRunTime, 
williamr@2
   216
						const TScheduleSettings2& aSettings);
williamr@2
   217
	TInt GetScheduleInfo(const TInt aScheduleHandle, 
williamr@2
   218
						TScheduleInfo& aInfo, 
williamr@2
   219
						TTsTime& aNextDue);
williamr@2
   220
	TInt GetScheduleDataL(const TInt aScheduleHandle, 
williamr@2
   221
						const TScheduleInfo& aInfo,
williamr@2
   222
						CArrayFixFlat<TScheduleEntryInfo2>& aEntries);
williamr@2
   223
	TInt GetScheduleDataL(const TInt aScheduleHandle, 
williamr@2
   224
						const TScheduleInfo& aInfo,
williamr@2
   225
						CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
williamr@2
   226
						TTsTime& aDefaultRunTime);
williamr@2
   227
	TInt GetTaskDataL(const TInt aScheduleHandle, 
williamr@2
   228
						const TScheduleInfo& aInfo,
williamr@2
   229
						CArrayFixFlat<TTaskInfo>& aTasks);					
williamr@2
   230
	};
williamr@2
   231
williamr@2
   232
#endif