sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * Interface definition for UPS policy evaluator ECOM plug-in. sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released sl@0: */ sl@0: sl@0: #ifndef POLICYEVALUATOR_H sl@0: #define POLICYEVALUATOR_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: namespace UserPromptService sl@0: { sl@0: class CClientEntity; sl@0: class CFingerprint; sl@0: class CPolicy; sl@0: class CPromptRequest; sl@0: class CDecisionRecord; sl@0: sl@0: /** sl@0: Abstract base class for a policy evaluator ECOM plug-in. sl@0: Policy evaluators are primarily responsible for generating the fingerprints sl@0: used to locate previous decision records related to the current request. sl@0: */ sl@0: class CPolicyEvaluator : public CActive sl@0: { sl@0: public: sl@0: IMPORT_C static CPolicyEvaluator* NewL(const TUid& aPolicyEvaluatormplementationId); sl@0: sl@0: /** sl@0: Asynchronously generates an ordered list the fingerprints used to locate sl@0: decision records related to the request.\n sl@0: A fingerprint is typically a hash created from the Destination sl@0: and OpaqueData values in the request structure e.g. Hash(phone number). sl@0: sl@0: - Fingerprints should be ordered most-specific to least-specific. sl@0: - Fingerprints are not required to be a hash or a fixed length. sl@0: - The policy evaluator may also specify the entity within the client process to which sl@0: a decision applies e.g. the id of the script or midlet. sl@0: - The policy evaluator may also generate an opaque data structure for use by the sl@0: dialog creator object. sl@0: sl@0: @param aRequest The parameters supplied by the system server. sl@0: @param aPolicy The policy being evaluated. sl@0: @param aFingerprints An ordered set of fingerprints to match against decision records. sl@0: This is only required if the result is ECheckDatabase\n sl@0: (OUT parameter) sl@0: @param aClientEntity Optionally, identifies an entity within the client process e.g. a script. sl@0: This is only used if the result is ECheckDatabase.\n sl@0: Ownership is NOT transferred to the caller.\n sl@0: (OUT parameter) sl@0: @param aDialogCreatorParams Optional opaque data to pass to the dialog creator if a prompt is displayed. sl@0: Ownership is NOT transferred to the caller.\n sl@0: (OUT parameter) sl@0: @param aStatus The request object to complete once the fingerprints have been generated. sl@0: */ sl@0: virtual void GenerateFingerprints( sl@0: const CPromptRequest& aRequest, const CPolicy& aPolicy, sl@0: RPointerArray& aFingerprints, const CClientEntity*& aClientEntity, sl@0: const TAny*& aDialogCreatorParams, sl@0: TRequestStatus& aStatus) = 0; sl@0: sl@0: IMPORT_C virtual TBool ForcePromptL(const CDecisionRecord& aDecision, TUint& aNewEvaluatorInfo); sl@0: IMPORT_C TInt GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1); sl@0: IMPORT_C ~CPolicyEvaluator(); sl@0: protected: sl@0: IMPORT_C CPolicyEvaluator(); sl@0: IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); sl@0: private: sl@0: TAny* iReserved; sl@0: TUid iDtor_ID_Key; // Required by ECOM sl@0: }; sl@0: } sl@0: sl@0: #endif // POLICYEVALUATOR_H