authorisation/userpromptservice/policies/inc/policyevaluator.h
changeset 8 35751d3474b7
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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 the License "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: 
       
    15 * Interface definition for UPS policy evaluator ECOM plug-in.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @publishedPartner
       
    23  @released
       
    24 */
       
    25 
       
    26 #ifndef POLICYEVALUATOR_H
       
    27 #define POLICYEVALUATOR_H
       
    28 
       
    29 #include <e32base.h>
       
    30 #include <e32cmn.h>
       
    31 #include <ups/ups.hrh>
       
    32 #include <ups/cliententity.h>
       
    33 #include <ups/fingerprint.h>
       
    34 #include <ups/policy.h>
       
    35 #include <ups/policyevaluator.h>
       
    36 #include <ups/promptrequest.h>
       
    37 
       
    38 
       
    39 namespace UserPromptService
       
    40 	{
       
    41 	class CClientEntity;
       
    42 	class CFingerprint;
       
    43 	class CPolicy;
       
    44 	class CPromptRequest;
       
    45 	class CDecisionRecord;
       
    46 		
       
    47 	/**
       
    48 	Abstract base class for a policy evaluator ECOM plug-in.
       
    49 	Policy evaluators are primarily	responsible for generating the fingerprints
       
    50 	used to locate previous decision records related to the current request.
       
    51 	*/
       
    52 	class CPolicyEvaluator : public CActive
       
    53 		{
       
    54 	public:
       
    55 		IMPORT_C static CPolicyEvaluator* NewL(const TUid& aPolicyEvaluatormplementationId);
       
    56 		
       
    57 		/**
       
    58 		 Asynchronously generates an ordered list the fingerprints used to locate 
       
    59 		 decision records related to the request.\n
       
    60 		 A fingerprint is typically a hash created from the Destination 
       
    61 		 and OpaqueData values in the request structure e.g. Hash(phone number).
       
    62 		 
       
    63 		 - Fingerprints should be ordered most-specific to least-specific.		 
       
    64 		 - Fingerprints are not required to be a hash or a fixed length.		 
       
    65 		 - The policy evaluator may also specify the entity within the client process to which
       
    66 		 a decision applies e.g. the id of the script or midlet.		  
       
    67 		 - The policy evaluator may also generate an opaque data structure for use by the 
       
    68 		 dialog creator object. 
       
    69 
       
    70 		 @param aRequest				The parameters supplied by the system server.
       
    71 		 @param aPolicy					The policy being evaluated.
       
    72 		 @param aFingerprints			An ordered set of fingerprints to match against decision records.
       
    73 										This is only required if the result is ECheckDatabase\n
       
    74 										(OUT parameter)
       
    75 		 @param aClientEntity			Optionally, identifies an entity within the client process e.g. a script.
       
    76 										This is only used if the result is ECheckDatabase.\n
       
    77 										Ownership is NOT transferred to the caller.\n
       
    78 										(OUT parameter)
       
    79 		 @param aDialogCreatorParams	Optional opaque data to pass to the dialog creator if a prompt is displayed.
       
    80 										Ownership is NOT transferred to the caller.\n
       
    81 										(OUT parameter)
       
    82 		 @param aStatus					The request object to complete once the fingerprints have been generated.
       
    83 		 */
       
    84 		virtual void GenerateFingerprints(
       
    85 			const CPromptRequest& aRequest, const CPolicy& aPolicy,
       
    86 			RPointerArray<CFingerprint>& aFingerprints, const CClientEntity*& aClientEntity, 
       
    87 			const TAny*& aDialogCreatorParams,
       
    88 			TRequestStatus& aStatus) = 0;
       
    89 			
       
    90 		IMPORT_C virtual TBool ForcePromptL(const CDecisionRecord& aDecision, TUint& aNewEvaluatorInfo);
       
    91 		IMPORT_C TInt GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1);		
       
    92 		IMPORT_C ~CPolicyEvaluator();
       
    93 	protected:
       
    94 		IMPORT_C CPolicyEvaluator();
       
    95 		IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
       
    96 	private:
       
    97 		TAny* iReserved;
       
    98 		TUid iDtor_ID_Key;		// Required by ECOM
       
    99 		};
       
   100 	}
       
   101 
       
   102 #endif // POLICYEVALUATOR_H