policymanagement/policyengine/policyengineserver/inc/SettingEnforcementManager.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 #ifndef _SETTING_ENFORCEMENT_MANAGER_HEADER__
       
    20 #define _SETTING_ENFORCEMENT_MANAGER_HEADER__
       
    21 
       
    22 // INCLUDES
       
    23 
       
    24 #include "CentRepToolClient.h"
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <ssl.h>
       
    28 
       
    29 // CONSTANTS
       
    30 //DM client UID
       
    31 const TUid KDMClientUiD = { 0x101f9a02 };
       
    32 
       
    33 
       
    34 // DATA TYPES
       
    35 typedef RPointerArray<HBufC8> RAccessControlList;
       
    36 
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 class CElementBase;
       
    40 class CPolicyStorage;
       
    41 class CEnforcementBase;
       
    42 
       
    43 class CSettingEnforcementManager : public CActive
       
    44 {
       
    45 	public:
       
    46 		//constructors
       
    47 		CSettingEnforcementManager();
       
    48 		~CSettingEnforcementManager();
       
    49 		static CSettingEnforcementManager* NewL();
       
    50 		
       
    51 		//enforcement management
       
    52 
       
    53 	    /**
       
    54 		* Start setting enforcement session 
       
    55         */		
       
    56 		void StartEnforcementSessionL( TRequestStatus& aRequestStatus, const TCertInfo& aCertInfo);
       
    57 		
       
    58 	    /**
       
    59 		* Check if changed element is a element, which affect to setting enforcements 
       
    60 		* aElement Pointer to modified element. Function doesn't reserve element, only get element name.
       
    61         */		
       
    62 
       
    63 		void AddModifiedElementL( const CElementBase* aElement);
       
    64 
       
    65 	    /**
       
    66 		* Execute setting enforcement for all elements added to session
       
    67         */		
       
    68 		void ExecuteEnforcementSessionL();
       
    69 
       
    70 	    /**
       
    71 		* Commit changes
       
    72         */		
       
    73 		void CommitChanges();
       
    74 
       
    75 	    /**
       
    76 		* Finish execution session
       
    77         */		
       
    78 		void EndEnforcementSession( TBool aFlushSettings);
       
    79 		
       
    80 	protected:
       
    81 		//Derived from CActive
       
    82 		void RunL();
       
    83 		TInt RunError( TInt aError);
       
    84 		void DoCancel();
       
    85 		
       
    86 		//certificate
       
    87 		TCertInfo& SessionCertificate();
       
    88 	private:
       
    89 		void ResolveValidEditorsForSettingL( TUint32 iElementId);
       
    90 		void SetActiveEnforcementBaseL( const TDesC8& aEnforcementId);
       
    91 	private:
       
    92 		RPointerArray<HBufC8> iEnforcementElements;
       
    93 		RAccessControlList iValidEditorsForSetting;
       
    94 		CEnforcementBase* iActiveEnforcementBase;
       
    95 		
       
    96 		//certificate info
       
    97 		TCertInfo iCertInfo;
       
    98 		
       
    99 		//active state variables
       
   100 		HBufC8 * iActivelementName;
       
   101 		TInt iOperationCounter;
       
   102 		TInt iOperationState;
       
   103 		TRequestStatus* iExternalRequestStatus;
       
   104 };
       
   105 
       
   106 class CEnforcementBase : public CBase
       
   107 {
       
   108 	public:
       
   109 		virtual ~CEnforcementBase() {}
       
   110 	
       
   111 		virtual void InitEnforcementL( TRequestStatus& aRequestStatus) = 0;
       
   112 		virtual void DoEnforcementL( TRequestStatus& aRequestStatus) = 0;
       
   113 		virtual TBool InitReady() = 0;
       
   114 		virtual TBool EnforcementReady() = 0;
       
   115 		virtual void FinishEnforcementL( TBool aFlushSettings) = 0;
       
   116 		virtual void ResetEnforcementL() = 0;
       
   117 				
       
   118 		virtual void AccessRightList( RAccessControlList& aAccessControlList) = 0;		
       
   119 		
       
   120 		void SetSessionCertificate( TCertInfo& aCertInfo);
       
   121 	protected:
       
   122 		TCertInfo& SessionCertificate();	
       
   123 	
       
   124 	private:
       
   125 		TCertInfo* iCertInfo;
       
   126 };
       
   127 
       
   128 
       
   129 #endif