os/security/authorisation/userpromptservice/policies/test/testpolicyevaluator/source/testpolicyevaluator.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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 * refpolicyevaluator.h
    16 *
    17 */
    18 
    19 
    20 /**
    21  @file
    22  @internalTechnology 
    23  @test 
    24 */
    25 
    26 #ifndef TESTPOLICYEVALUATOR_H
    27 #define TESTPOLICYEVALUATOR_H
    28 
    29 #include <e32base.h>
    30 #include <e32cmn.h>
    31 #include <hash.h>
    32 #include <ups/policyevaluator.h>
    33 
    34 using namespace UserPromptService;
    35 
    36 /**
    37 Test/Reference implementation of a policy evaluator.
    38 */
    39 class CTestPolicyEvaluator : public CPolicyEvaluator 
    40 	{
    41 public:
    42 	static CPolicyEvaluator* CreatePolicyEvaluatorL();
    43 
    44 	// From UserPromptService::CPolicyEvaluator
    45 	void GenerateFingerprints(const CPromptRequest& aRequest, const CPolicy& aPolicy, 
    46 		RPointerArray<CFingerprint>& aFingerprints, const CClientEntity*& aClientEntity, 
    47 		const TAny*& aDialogCreatorParams, 
    48 		TRequestStatus& aStatus);
    49 		
    50 	TBool ForcePromptL(const CDecisionRecord& aDecision, TUint& aNewEvaluatorInfo);
    51 		
    52 protected:
    53 	// From CActive
    54 	void DoCancel();
    55 	void RunL();
    56 	TInt RunError(TInt aError);
    57 
    58 	~CTestPolicyEvaluator();
    59 private:		
    60 	CTestPolicyEvaluator();	
    61 	void ConstructL();
    62 	void SetClientEntityL();	
    63 
    64 	const CPromptRequest* iRequest;
    65 	const CPolicy* iPolicy;
    66 	RPointerArray<CFingerprint>* iFingerprints;
    67 	CClientEntity* iClientEntity;
    68 	const CClientEntity** iClientEntityPtr;	///< UPS server's pointer to client entity
    69 	
    70 	TRequestStatus* iClientStatus;	///< Request object to complete after generating fingerprints
    71 	CMessageDigest* iDigest;		///< Message digest used to create fingerprint
    72 	};
    73 
    74 #endif // TESTPOLICYEVALUATOR_H
    75