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