sysstatemgmt/systemstatemgr/ssm/inc/ssmserver.h
changeset 0 4e1aa6a622a0
child 7 1fc153c72b60
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 __SSMSERVER_H__
       
    17 #define __SSMSERVER_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <ssm/ssmstates.hrh>
       
    21 
       
    22 class TSsmState;
       
    23 class TSsmSwp;
       
    24 class CSsmStateTransitionEngine;
       
    25 class CSsmSwpRequestHandler;
       
    26 class CSsmSwpPolicyResolver;
       
    27 class CCleSessionProxy;
       
    28 
       
    29 /**
       
    30  Implements the API used to request changes to the
       
    31  system state or to request changes to the value of a system-wide property.
       
    32  The policy plug-in associated with the current system state or the requested 
       
    33  system wide property implements the required security policy in 
       
    34  MSsmStatePolicy::TransitionAllowed() or MSsmSwpPolicy::TransitionAllowed().
       
    35  @internalComponent
       
    36  @released
       
    37  */
       
    38 class CSsmServer : public CPolicyServer
       
    39 	{
       
    40 public:
       
    41 	enum TValidation
       
    42 		{
       
    43 		EDoValidateCommandLists, 
       
    44 		ENoCommandListValidation
       
    45 		};
       
    46 	
       
    47 	static CSsmServer* NewLC();
       
    48 	static CSsmServer* NewLC(TUint16 aInitialState);
       
    49 	static CSsmServer* NewLC(TUint16 aInitialState, TValidation aSetting);
       
    50 
       
    51 #ifdef TEST_SSM_SERVER
       
    52 	static CSsmServer* NewLC(const TDesC& aServerName, TUint16 aInitialState); //used by automated tests to avoid clash with production server name
       
    53 #endif // TEST_SSM_SERVER
       
    54 
       
    55 	~CSsmServer( );
       
    56 
       
    57 	void RequestStateTransitionL(const TSsmState& aState, TInt aReason,	const RMessage2& aMessage );
       
    58 	void RequestStateTransitionCancel(CSession2* aSession);
       
    59 	void RequestSwpChangeL(const TSsmSwp&, const RMessage2& aMessage );
       
    60 	void RequestSwpChangeCancel(CSession2* aSession);
       
    61 	void RequestRegisterSwpMappingL(TUint aSwpKey, const TDesC& aFilename);
       
    62 #ifdef _DEBUG
       
    63 	void RequestDeRegisterSwpMappingL(TUint aSwpKey, const TDesC& aFilename);
       
    64 	void DoCleanupStateTransitionEngine();
       
    65 	void DoCleanupSwpRequestHandler();
       
    66 #endif
       
    67 
       
    68 private:
       
    69 	CSsmServer( );
       
    70 	void ConstructL(TUint16 aInitialState, TValidation aSetting );
       
    71 
       
    72 	//from CServer2
       
    73 	CSession2* NewSessionL(const TVersion& aVersion, const RMessage2& aMessage ) const;
       
    74 
       
    75 private:
       
    76 	CSsmStateTransitionEngine* iStateTransitionEngine;
       
    77 
       
    78 	CSsmSwpRequestHandler* iSwpRequestHandler;
       
    79 	CSsmSwpPolicyResolver* iSwpResolver;
       
    80 	CCleSessionProxy* iSwpCleSession;
       
    81 	};
       
    82 
       
    83 #endif