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