authorisation/userpromptservice/inc_private/policycache.h
changeset 8 35751d3474b7
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     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 * Class declaration for the User Prompt Service policy cache.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 /**
       
    21  @file
       
    22  @internalComponent
       
    23  @released 
       
    24 */
       
    25 
       
    26 #ifndef POLICYCACHE_H
       
    27 #define POLICYCACHE_H
       
    28 
       
    29 #include <e32base.h>
       
    30 #include <e32cmn.h>
       
    31 
       
    32 #include <f32file.h>
       
    33 #include "policylist.h"
       
    34 #include "serviceconfig.h"
       
    35 
       
    36 namespace UserPromptService
       
    37 	{
       
    38 	class CPolicy;
       
    39 	class CPromptRequest;
       
    40 	
       
    41 	/**
       
    42 	Maintains an in memory cache of User Prompt Service policies.	
       
    43 	- Policy files are loaded lazily when MatchL is called..
       
    44 	*/	
       
    45 	NONSHARABLE_CLASS(CPolicyCache) : public CBase
       
    46 		{
       
    47 	public:
       
    48 		IMPORT_C static CPolicyCache* NewL(RFs& aFs, const TDesC& aPolicyPath);
       
    49 		IMPORT_C const CPolicy* MatchL(const CPromptRequest& aRequest);
       
    50 		IMPORT_C void ServiceConfigL(const TSecureId& aServerSid, RArray<TServiceConfig>& aConfig);
       
    51 		
       
    52 		~CPolicyCache();
       
    53 	private:
       
    54 		CPolicyCache(RFs& aFs);
       
    55 		void ConstructL(const TDesC& aPolicyPath);
       
    56 		CPolicyList* ParseListL(const CPolicyList::TId& aId, const TDesC& aPolicyFileName);
       
    57 		CPolicyList* LoadPolicyListL(const CPolicyList::TId& aId);
       
    58 		void LocatePolicyFileL(TDes& aPolicyFileName, const CPolicyList::TId& aId);
       
    59 		TBool FileExistsL(const TDesC& aFileName);
       
    60 		
       
    61 		const CPolicyList* PolicyList(const CPolicyList::TId& aId) const;
       
    62 		void FindServicesL(const TSecureId& aServerSid, RArray<TUint>& aServices);
       
    63 
       
    64 		RPointerArray<CPolicyList> iPolicyLists;
       
    65 		HBufC* iPolicyPath;
       
    66 		RFs iFs;
       
    67 		TChar iSystemDriveChar;
       
    68 		};
       
    69 	}
       
    70 
       
    71 #endif // POLICYCACHE_H