genericservices/taskscheduler/SCHSVR/SSCH_STD.H
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 2005-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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // defines scheduler panics & faults
       
    15 // CSchServer - server class
       
    16 // CSchSession - server-side session class
       
    17 // 
       
    18 //
       
    19 
       
    20 #ifndef __SSCH_STD_H__
       
    21 #define __SSCH_STD_H__
       
    22 
       
    23 // System includes
       
    24 #include <e32base.h>
       
    25 #include <bsul/bsul.h>
       
    26 
       
    27 // Classes referenced
       
    28 class CSheduleServerLog;
       
    29 class CTaskScheduler;
       
    30 class CClientProxy;
       
    31 class CSchStartupStateMgr;
       
    32 class CSchedule;
       
    33 class CClientMessage;
       
    34 
       
    35 enum TESchPanic
       
    36 	{
       
    37 	EPanicNotRegistered,
       
    38 	EPanicBadDescriptor,
       
    39 	EPanicIllegalFunction,
       
    40 	};
       
    41 
       
    42 enum TESchFault
       
    43 	{
       
    44 	EMainSchedulerError,
       
    45 	ESvrCreateServer,
       
    46 	ESvrStartServer,
       
    47 	ETaskWithoutClient,
       
    48 	ECreateTrapCleanup,
       
    49 	ENotImplementedYet,
       
    50 	};
       
    51 
       
    52 
       
    53 NONSHARABLE_CLASS(CSchServer) : public CServer2
       
    54 	{
       
    55 private:
       
    56 	enum {EPriority=1000};
       
    57 
       
    58 public:
       
    59 	static CSchServer* NewLC();
       
    60 	~CSchServer();
       
    61 	CSession2* NewSessionL(const TVersion &aVersion, const RMessage2& aMessage) const;
       
    62 
       
    63 private:
       
    64 	CSchServer(TInt aPriority);
       
    65 	void ConstructL();
       
    66 private:
       
    67 	// Server owns one & only instance of CTaskScheduler
       
    68 	CTaskScheduler* iTaskScheduler;
       
    69 
       
    70 	CSchStartupStateMgr* iSSAMgr;
       
    71 
       
    72 #ifdef __SCHLOGGING__
       
    73 	CSheduleServerLog* iTheLog;
       
    74 #endif	
       
    75 	};
       
    76 
       
    77 NONSHARABLE_CLASS(CSchSession) : public CSession2
       
    78 	{
       
    79 public:
       
    80 	void ServiceL(const RMessage2 &aMessage);
       
    81 	void ServiceError(const RMessage2& aMessage,TInt aError);
       
    82 	virtual ~CSchSession();
       
    83 	CSchSession(CTaskScheduler& aScheduler);
       
    84 	
       
    85 private:
       
    86 	//request handlers
       
    87 	void RegisterClientL();
       
    88 	void CreateTimeScheduleL();
       
    89 	void CreateConditionScheduleL();
       
    90 	void ScheduleTaskL();
       
    91 	void DeleteTaskL();
       
    92 	void EditTimeScheduleL();
       
    93 	void EditConditionScheduleL();
       
    94 	//retrieval
       
    95 	void GetScheduleRefsL();//name & handle for each schedule
       
    96 	void CountSchedulesL();
       
    97 	void GetTimeScheduleDataL();
       
    98 	void GetConditionScheduleDataL();
       
    99 	void GetTaskDataL();
       
   100 
       
   101 	void GetScheduleInfoL();
       
   102 	void GetTaskRefsL();//name & handle for each task
       
   103 	void GetTaskInfoL();
       
   104 	void GetScheduleItemRefAndDueTimeL(); 
       
   105 	void GetScheduleTypeL(); 
       
   106 
       
   107 	void GetTaskDataSizeL();
       
   108 	void CountTasksL();
       
   109 	
       
   110 	void CheckCapabilityL();
       
   111 	void CheckPersistsInBackupL(const CSchedule& aSchedule);
       
   112 	void DoServiceL();
       
   113 private:	
       
   114 	//Session is initialised with the one and only instance of CTaskScheduler
       
   115 	CTaskScheduler* iTaskScheduler;
       
   116 	//NULL on creation, assigned when registers
       
   117 	CClientProxy* iClient;
       
   118 	// current request for this client.  NULL on creation
       
   119 	RMessage2 iPendingNotification;
       
   120 	
       
   121 	BSUL::CClientMessage *iClientMessage;
       
   122 	};
       
   123 
       
   124 #endif
       
   125