policymanagement/policyengine/policyengineserver/inc/PolicyManager.h
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2000 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Implementation of policymanagement components
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef _POLICY_MANAGER_HEADER__
       
    22 #define _POLICY_MANAGER_HEADER__
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include "PolicyEngineServer.h"
       
    27 #include "PolicyStorage.h"
       
    28 #include "PolicyEngineClientServer.h"
       
    29 #include "OperationParser.h"
       
    30 #include <e32base.h>
       
    31 
       
    32 // CONSTANTS
       
    33 // MACROS
       
    34 // DATA TYPES
       
    35 // FUNCTION PROTOTYPES
       
    36 // FORWARD DECLARATIONS
       
    37 
       
    38 class CElementBase;
       
    39 class CTrustedSession;
       
    40 class CPolicyProcessor;
       
    41 class CSettingEnforcementManager;
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 class CPolicyManager : public CActive
       
    46 {
       
    47 	public:
       
    48 	
       
    49 		static CPolicyManager * NewL( CPolicyProcessor * aPolicyProcessor);
       
    50 		void ConstructL();
       
    51 		CPolicyManager( CPolicyProcessor * aPolicyProcessor);
       
    52 		~CPolicyManager();
       
    53 	
       
    54 		void ExecuteOperation( CTrustedSession * aSession, const RMessage2& aMessage);
       
    55 
       
    56 		void NewElementL( const TInt& aLineOffset, const TDesC8& aTargetElement, const TDesC8& aElementDescription, const TBool& aUseBearerCertificate);
       
    57 		void ReplaceElementL( const TInt& aLineOffset, const TDesC8& aTargetElement, const TDesC8& aElementDescription );
       
    58 		void RemoveElementL( const TDesC8& aTargetElement);
       
    59 
       
    60 		void GetElementListL( const RMessage2& aMessage);
       
    61 		void GetElementInfoL( const RMessage2& aMessage);
       
    62 		void GetElementXACMLDescriptionL( const RMessage2& aMessage);
       
    63 		void IsServerIdValidL( const RMessage2& aMessage);
       
    64 		void GetCertificateRoleL( const RMessage2& aMessage);
       
    65 	protected:	
       
    66 		// Derived from CActiveObject
       
    67 		void RunL();
       
    68 		void DoCancel();
       
    69 		TInt RunError( TInt aError);		
       
    70 	private:
       
    71 		void CommitChangesL();
       
    72 	
       
    73 		void ReAssignElementL( const TDesC8& aTargetElement, CElementBase * aElement);
       
    74 		void AssignElementL( const TDesC8& aTargetElement, CElementBase * aElement);
       
    75 		void IsAssigmentAcceptableL( CElementBase * aParentElement, CElementBase * aElement, TBool aNewElement);
       
    76 
       
    77 		void IsRemoveAcceptableL( CElementBase * aParentElement, CElementBase * aElement);
       
    78 	
       
    79 		void MakeEnforcementL(TInt aError);
       
    80 		void CompleteOperation( TInt aError);
       
    81 		
       
    82 		void UpdateStateFlagsL();
       
    83 		void AddSilentDMOperationServerIdL();
       
    84 		TBool IsCurrentServerIdTrustedL();
       
    85 		
       
    86 	private:
       
    87 		CPolicyProcessor* iPolicyProcessor;
       
    88 		CTrustedSession* iTrustedSession;
       
    89 		CSettingEnforcementManager* iSEManager;
       
    90 
       
    91 		//for management operations which need two calls from client side
       
    92 		HBufC8 * iActiveXACMLContent;
       
    93 		HBufC8 * iActiveDescription;
       
    94 		HBufC8 * iActiveChildList;
       
    95 		HBufC8 * iActiveElementList;
       
    96 		
       
    97 		//management handling
       
    98 		TBuf8<KMaxReturnMessageLength> iMsg;
       
    99 		TBool iUseBearerCertificate;
       
   100 		TBool iCertificateUpdates;
       
   101 		CPolicyStorage* iPolicyStorage;
       
   102 		
       
   103 		//active object related
       
   104 		const RMessage2 * iMessage;
       
   105 		TInt iOperationStatus;
       
   106 		HBufC8* iCurrentManagementCommand;
       
   107 		COperationParser* iOperationParser;
       
   108 };
       
   109 
       
   110 
       
   111 #endif