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