sysstatemgmt/systemstatemgr/cle/inc/clesrv.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-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 //
       
    15 
       
    16 #ifndef __CLESRV_H__
       
    17 #define __CLESRV_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <s32mem.h>
       
    21 
       
    22 #include "cmdlistexecobs.h"
       
    23 #include "cmdlistexecutor.h"
       
    24 
       
    25 
       
    26 _LIT( KCleSrvName, "!CleSrv" );
       
    27 
       
    28 
       
    29 class CSsmCommandList;
       
    30 class CSsmCmdListExecutor;
       
    31 
       
    32 
       
    33 
       
    34 /**
       
    35 @internalComponent
       
    36 @released
       
    37 */
       
    38 struct SCleSessionInfo
       
    39 	{
       
    40 	CSsmCmdListExecutor* iExecutor;
       
    41 	RMessagePtr2 iMessagePtr;
       
    42 	TBool iInUse;
       
    43 	};
       
    44 
       
    45 
       
    46 	
       
    47 /**
       
    48  The Commamd-list executor server
       
    49  
       
    50 @internalComponent
       
    51 @released
       
    52 */
       
    53 NONSHARABLE_CLASS( CCleServer ) : public CPolicyServer, public MCommandListExecutionObserver
       
    54 	{
       
    55 
       
    56 public:
       
    57 	IMPORT_C static CCleServer* NewL(const TDesC& aServerName);
       
    58 	IMPORT_C static CCleServer* NewLC(const TDesC& aServerName);
       
    59 	IMPORT_C static TInt StartCleSrv(const TDesC& aServerName);
       
    60 	~CCleServer();
       
    61 	
       
    62 	void ExecuteCommandListL( CSsmCommandList* aCommandList, const RMessage2& aMessage, const TInt aSessionIndex );
       
    63 	void ExecuteCommandListCancel( TInt aSessionIndex );
       
    64 	void RegisterSessionL( TInt& aSessionIndex );	
       
    65 	void DeregisterSession( const TInt& aSessionIndex );
       
    66 	TInt CloseNeverUnloadLibrariesL();
       
    67 	void CleanHandlesFileL();
       
    68 
       
    69 	// From MCommandListExecutionObserver
       
    70 	void ListExecutionComplete( TInt aComplete, TInt aSessionIndex, TCmdErrorSeverity aSeverity);
       
    71 	// From CServer2
       
    72 	IMPORT_C CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const;
       
    73 
       
    74 private:	
       
    75 	void ConstructL(const TDesC& aServerName);	
       
    76 	CCleServer();
       
    77 	static TInt CleSrvThreadFn( TAny* aAny );
       
    78 private:
       
    79 	TVersion iVersion;	
       
    80 	RArray<SCleSessionInfo> iSessionInfoArray;
       
    81 	TInt iSessionCount;
       
    82 	};
       
    83 
       
    84 
       
    85 #endif // __CLESRV_H__