1.1 --- a/epoc32/include/csch_cli.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/csch_cli.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,245 @@
1.4 -csch_cli.h
1.5 +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// 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
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// RScheduler class
1.19 +// Client Interface to Scheduler
1.20 +//
1.21 +//
1.22 +
1.23 +#if !defined(__CSCH_CLI_H__)
1.24 +#define __CSCH_CLI_H__
1.25 +
1.26 +#if !defined(__E32BASE_H__)
1.27 +#include <e32base.h>
1.28 +#endif
1.29 +
1.30 +#if !defined(__E32STD_H__)
1.31 +#include <e32std.h>
1.32 +#endif
1.33 +
1.34 +#if !defined(__SCHINFO_H__)
1.35 +#include <schinfo.h>
1.36 +#endif
1.37 +
1.38 +#include <e32cons.h>
1.39 +
1.40 +class TTaskSchedulerCondition;
1.41 +class TScheduleSettings2;
1.42 +/**
1.43 +starts scheduler under EPOC32
1.44 +@internalComponent
1.45 +@deprecated
1.46 +*/
1.47 +IMPORT_C TInt StartSch32();
1.48 +
1.49 +/**
1.50 +Constants
1.51 +@publishedAll
1.52 +@deprecated
1.53 +*/
1.54 +const TUint KESchMajorVersionNumber=1;
1.55 +const TUint KESchMinorVersionNumber=0;
1.56 +const TUint KESchBuildVersionNumber=50;
1.57 +
1.58 +/**
1.59 +@internalComponent
1.60 +@deprecated
1.61 +*/
1.62 +const TInt KMaxScheduleName=50;
1.63 +
1.64 +/**
1.65 +@internalComponent
1.66 +@deprecated
1.67 +*/
1.68 +_LIT(KScheduleServerName, "!TaskScheduler");
1.69 +
1.70 +/**
1.71 +Client side interface to the Task Scheduler.
1.72 +@publishedAll
1.73 +@released
1.74 +*/
1.75 +class RScheduler : public RSessionBase
1.76 + {
1.77 +public:
1.78 + IMPORT_C RScheduler();
1.79 + IMPORT_C TInt Connect();
1.80 + IMPORT_C TVersion Version() const;
1.81 +
1.82 + // client registration
1.83 + IMPORT_C TInt Register(const TFileName& aFileName,const TInt aPriority);
1.84 +
1.85 + // schedule editing
1.86 + IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef,
1.87 + const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList);
1.88 +
1.89 + IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef,
1.90 + const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.91 + const TTsTime& aDefaultRunTime);
1.92 +
1.93 + IMPORT_C TInt DeleteSchedule(const TInt aScheduleHandle) const;
1.94 +
1.95 + IMPORT_C TInt DisableSchedule(const TInt aScheduleHandle) const;
1.96 +
1.97 + IMPORT_C TInt EnableSchedule(const TInt aScheduleHandle) const;
1.98 +
1.99 + // This will return KErrArgument if the schedule is not a time based one.
1.100 + // (consistent behaviour with GetScheduleL below).
1.101 + IMPORT_C TInt EditSchedule(const TInt aScheduleHandle,
1.102 + const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList);
1.103 +
1.104 + // This will return KErrArgument if the schedule is not a condition based one.
1.105 + // (consistent behaviour with GetScheduleL below).
1.106 + IMPORT_C TInt EditSchedule(TInt aScheduleHandle,
1.107 + const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.108 + const TTsTime& aDefaultRunTime);
1.109 +
1.110 + //task funtions
1.111 + // Schedule a task based on a persistent schedule. Will return KErrArgument
1.112 + // if schedule is a condition based one and task repeat is not 0.
1.113 + IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo,
1.114 + HBufC& aTaskData,
1.115 + const TInt aScheduleHandle);
1.116 +
1.117 + //creates a transient schedule
1.118 + IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo,
1.119 + HBufC& aTaskData,
1.120 + TSchedulerItemRef& aRef,
1.121 + const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList);
1.122 +
1.123 + // creates a transient schedule based on conditions. Will return KErrArgument
1.124 + // if schedule is a condition based one and task repeat is not 0.
1.125 + IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo,
1.126 + HBufC& aTaskData,
1.127 + TSchedulerItemRef& aRef,
1.128 + const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.129 + const TTsTime& aDefaultRunTime);
1.130 +
1.131 + IMPORT_C TInt DeleteTask(const TInt aTaskId) const;
1.132 +
1.133 + //retrieving
1.134 + IMPORT_C TInt GetScheduleRefsL(CArrayFixFlat<TSchedulerItemRef>& aScheduleRefArray,
1.135 + const TScheduleFilter aFilter);
1.136 +
1.137 + // Gets time based schedule. Will return KErrArgument if scheduleType
1.138 + // is not time based.
1.139 + IMPORT_C TInt GetScheduleL(const TInt aScheduleHandle,
1.140 + TScheduleState2& aState,
1.141 + CArrayFixFlat<TScheduleEntryInfo2>& aEntries,
1.142 + CArrayFixFlat<TTaskInfo>& aTasks,
1.143 + TTsTime& aDueTime);
1.144 +
1.145 + // Gets condition based schedule. Will return KErrArgument if scheduleType
1.146 + // is not condition based.
1.147 + IMPORT_C TInt GetScheduleL(TInt aScheduleHandle,
1.148 + TScheduleState2& aState,
1.149 + CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.150 + TTsTime& aDefaultRunTime,
1.151 + CArrayFixFlat<TTaskInfo>& aTasks);
1.152 +
1.153 + IMPORT_C TInt GetTaskRefsL(CArrayFixFlat<TSchedulerItemRef>& aTasks,
1.154 + const TScheduleFilter aScheduleFilter,
1.155 + const TTaskFilter aTaskFilter);
1.156 +
1.157 + IMPORT_C TInt GetTaskInfoL(const TInt aTaskId,
1.158 + TTaskInfo& aTaskInfo,
1.159 + TPtr& aTaskData,
1.160 + TSchedulerItemRef& aRef,
1.161 + TTsTime& aNextDue);
1.162 +
1.163 + IMPORT_C TInt GetTaskDataSize(const TInt aTaskId, TInt& aSize);
1.164 +
1.165 + // Gets the scheduletype for a given schedule handle
1.166 + IMPORT_C TInt GetScheduleTypeL(TInt aScheduleHandle,
1.167 + TScheduleType& aScheduleType);
1.168 +public:
1.169 + //deprecated API functions as of v9.2
1.170 + //clients of these APIs are encouraged to migrate to the equivalent APIs above.
1.171 + //see ../Documentation/Feature Documentation/SGL.GT0250.204 Task Scheduler Migration Guide to new APIs in Symbian OS v9.x.doc
1.172 +
1.173 + IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef,
1.174 + const CArrayFixFlat<TScheduleEntryInfo>& aEntryList);
1.175 +
1.176 + IMPORT_C TInt CreatePersistentSchedule(TSchedulerItemRef& aRef,
1.177 + const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.178 + const TTime& aDefaultRunTime);
1.179 +
1.180 + IMPORT_C TInt EditSchedule(const TInt aScheduleHandle,
1.181 + const CArrayFixFlat<TScheduleEntryInfo>& aEntryList);
1.182 +
1.183 + IMPORT_C TInt EditSchedule(TInt aScheduleHandle,
1.184 + const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.185 + const TTime& aDefaultRunTime);
1.186 +
1.187 + IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo,
1.188 + HBufC& aTaskData,
1.189 + TSchedulerItemRef& aRef,
1.190 + const CArrayFixFlat<TScheduleEntryInfo>& aEntryList);
1.191 +
1.192 + IMPORT_C TInt ScheduleTask(TTaskInfo& aTaskInfo,
1.193 + HBufC& aTaskData,
1.194 + TSchedulerItemRef& aRef,
1.195 + const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.196 + const TTime& aDefaultRunTime);
1.197 +
1.198 + IMPORT_C TInt GetScheduleL(const TInt aScheduleHandle,
1.199 + TScheduleState& aState,
1.200 + CArrayFixFlat<TScheduleEntryInfo>& aEntries,
1.201 + CArrayFixFlat<TTaskInfo>& aTasks,
1.202 + TTime& aDueTime);
1.203 +
1.204 + IMPORT_C TInt GetScheduleL(TInt aScheduleHandle,
1.205 + TScheduleState& aState,
1.206 + CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.207 + TTime& aDefaultRunTime,
1.208 + CArrayFixFlat<TTaskInfo>& aTasks);
1.209 +
1.210 + IMPORT_C TInt GetTaskInfoL(const TInt aTaskId,
1.211 + TTaskInfo& aTaskInfo,
1.212 + TPtr& aTaskData,
1.213 + TSchedulerItemRef& aRef,
1.214 + TTime& aNextDue);
1.215 +
1.216 +public://debug functions.
1.217 + //these functions are included in rel for rel/deb compatibility,
1.218 + //but only do stuff in debug builds
1.219 + IMPORT_C TInt __DbgMarkHeap();
1.220 + IMPORT_C TInt __DbgCheckHeap(TInt aCount);
1.221 + IMPORT_C TInt __DbgMarkEnd(TInt aCount);
1.222 + IMPORT_C TInt __DbgFailNext(TInt aCount);
1.223 + IMPORT_C TInt __DbgResetHeap();
1.224 + IMPORT_C TInt __FaultServer();//kill the server!
1.225 +
1.226 +private:
1.227 + TInt CreateSchedule(TSchedulerItemRef& aRef,
1.228 + const CArrayFixFlat<TScheduleEntryInfo2>& aEntryList,
1.229 + const TScheduleSettings2& aSettings);
1.230 + TInt CreateSchedule(TSchedulerItemRef& aRef,
1.231 + const CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.232 + const TTsTime& aDefaultRunTime,
1.233 + const TScheduleSettings2& aSettings);
1.234 + TInt GetScheduleInfo(const TInt aScheduleHandle,
1.235 + TScheduleInfo& aInfo,
1.236 + TTsTime& aNextDue);
1.237 + TInt GetScheduleDataL(const TInt aScheduleHandle,
1.238 + const TScheduleInfo& aInfo,
1.239 + CArrayFixFlat<TScheduleEntryInfo2>& aEntries);
1.240 + TInt GetScheduleDataL(const TInt aScheduleHandle,
1.241 + const TScheduleInfo& aInfo,
1.242 + CArrayFixFlat<TTaskSchedulerCondition>& aConditions,
1.243 + TTsTime& aDefaultRunTime);
1.244 + TInt GetTaskDataL(const TInt aScheduleHandle,
1.245 + const TScheduleInfo& aInfo,
1.246 + CArrayFixFlat<TTaskInfo>& aTasks);
1.247 + };
1.248 +
1.249 +#endif