os/security/authorisation/userpromptservice/inc_private/policycache.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/authorisation/userpromptservice/inc_private/policycache.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,71 @@
     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 +* Class declaration for the User Prompt Service policy cache.
    1.19 +*
    1.20 +*/
    1.21 +
    1.22 +
    1.23 +/**
    1.24 + @file
    1.25 + @internalComponent
    1.26 + @released 
    1.27 +*/
    1.28 +
    1.29 +#ifndef POLICYCACHE_H
    1.30 +#define POLICYCACHE_H
    1.31 +
    1.32 +#include <e32base.h>
    1.33 +#include <e32cmn.h>
    1.34 +
    1.35 +#include <f32file.h>
    1.36 +#include "policylist.h"
    1.37 +#include "serviceconfig.h"
    1.38 +
    1.39 +namespace UserPromptService
    1.40 +	{
    1.41 +	class CPolicy;
    1.42 +	class CPromptRequest;
    1.43 +	
    1.44 +	/**
    1.45 +	Maintains an in memory cache of User Prompt Service policies.	
    1.46 +	- Policy files are loaded lazily when MatchL is called..
    1.47 +	*/	
    1.48 +	NONSHARABLE_CLASS(CPolicyCache) : public CBase
    1.49 +		{
    1.50 +	public:
    1.51 +		IMPORT_C static CPolicyCache* NewL(RFs& aFs, const TDesC& aPolicyPath);
    1.52 +		IMPORT_C const CPolicy* MatchL(const CPromptRequest& aRequest);
    1.53 +		IMPORT_C void ServiceConfigL(const TSecureId& aServerSid, RArray<TServiceConfig>& aConfig);
    1.54 +		
    1.55 +		~CPolicyCache();
    1.56 +	private:
    1.57 +		CPolicyCache(RFs& aFs);
    1.58 +		void ConstructL(const TDesC& aPolicyPath);
    1.59 +		CPolicyList* ParseListL(const CPolicyList::TId& aId, const TDesC& aPolicyFileName);
    1.60 +		CPolicyList* LoadPolicyListL(const CPolicyList::TId& aId);
    1.61 +		void LocatePolicyFileL(TDes& aPolicyFileName, const CPolicyList::TId& aId);
    1.62 +		TBool FileExistsL(const TDesC& aFileName);
    1.63 +		
    1.64 +		const CPolicyList* PolicyList(const CPolicyList::TId& aId) const;
    1.65 +		void FindServicesL(const TSecureId& aServerSid, RArray<TUint>& aServices);
    1.66 +
    1.67 +		RPointerArray<CPolicyList> iPolicyLists;
    1.68 +		HBufC* iPolicyPath;
    1.69 +		RFs iFs;
    1.70 +		TChar iSystemDriveChar;
    1.71 +		};
    1.72 +	}
    1.73 +
    1.74 +#endif // POLICYCACHE_H