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