1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/authorisation/userpromptservice/policies/inc/policyevaluator.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,102 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Interface definition for UPS policy evaluator ECOM plug-in.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +/**
1.24 + @file
1.25 + @publishedPartner
1.26 + @released
1.27 +*/
1.28 +
1.29 +#ifndef POLICYEVALUATOR_H
1.30 +#define POLICYEVALUATOR_H
1.31 +
1.32 +#include <e32base.h>
1.33 +#include <e32cmn.h>
1.34 +#include <ups/ups.hrh>
1.35 +#include <ups/cliententity.h>
1.36 +#include <ups/fingerprint.h>
1.37 +#include <ups/policy.h>
1.38 +#include <ups/policyevaluator.h>
1.39 +#include <ups/promptrequest.h>
1.40 +
1.41 +
1.42 +namespace UserPromptService
1.43 + {
1.44 + class CClientEntity;
1.45 + class CFingerprint;
1.46 + class CPolicy;
1.47 + class CPromptRequest;
1.48 + class CDecisionRecord;
1.49 +
1.50 + /**
1.51 + Abstract base class for a policy evaluator ECOM plug-in.
1.52 + Policy evaluators are primarily responsible for generating the fingerprints
1.53 + used to locate previous decision records related to the current request.
1.54 + */
1.55 + class CPolicyEvaluator : public CActive
1.56 + {
1.57 + public:
1.58 + IMPORT_C static CPolicyEvaluator* NewL(const TUid& aPolicyEvaluatormplementationId);
1.59 +
1.60 + /**
1.61 + Asynchronously generates an ordered list the fingerprints used to locate
1.62 + decision records related to the request.\n
1.63 + A fingerprint is typically a hash created from the Destination
1.64 + and OpaqueData values in the request structure e.g. Hash(phone number).
1.65 +
1.66 + - Fingerprints should be ordered most-specific to least-specific.
1.67 + - Fingerprints are not required to be a hash or a fixed length.
1.68 + - The policy evaluator may also specify the entity within the client process to which
1.69 + a decision applies e.g. the id of the script or midlet.
1.70 + - The policy evaluator may also generate an opaque data structure for use by the
1.71 + dialog creator object.
1.72 +
1.73 + @param aRequest The parameters supplied by the system server.
1.74 + @param aPolicy The policy being evaluated.
1.75 + @param aFingerprints An ordered set of fingerprints to match against decision records.
1.76 + This is only required if the result is ECheckDatabase\n
1.77 + (OUT parameter)
1.78 + @param aClientEntity Optionally, identifies an entity within the client process e.g. a script.
1.79 + This is only used if the result is ECheckDatabase.\n
1.80 + Ownership is NOT transferred to the caller.\n
1.81 + (OUT parameter)
1.82 + @param aDialogCreatorParams Optional opaque data to pass to the dialog creator if a prompt is displayed.
1.83 + Ownership is NOT transferred to the caller.\n
1.84 + (OUT parameter)
1.85 + @param aStatus The request object to complete once the fingerprints have been generated.
1.86 + */
1.87 + virtual void GenerateFingerprints(
1.88 + const CPromptRequest& aRequest, const CPolicy& aPolicy,
1.89 + RPointerArray<CFingerprint>& aFingerprints, const CClientEntity*& aClientEntity,
1.90 + const TAny*& aDialogCreatorParams,
1.91 + TRequestStatus& aStatus) = 0;
1.92 +
1.93 + IMPORT_C virtual TBool ForcePromptL(const CDecisionRecord& aDecision, TUint& aNewEvaluatorInfo);
1.94 + IMPORT_C TInt GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1);
1.95 + IMPORT_C ~CPolicyEvaluator();
1.96 + protected:
1.97 + IMPORT_C CPolicyEvaluator();
1.98 + IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
1.99 + private:
1.100 + TAny* iReserved;
1.101 + TUid iDtor_ID_Key; // Required by ECOM
1.102 + };
1.103 + }
1.104 +
1.105 +#endif // POLICYEVALUATOR_H