os/security/authorisation/userpromptservice/inc_private/policylist.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 *
    16 */
    17 
    18 
    19 /**
    20  @file
    21  @internalComponent
    22  @released 
    23 */
    24 
    25 #ifndef POLICYLIST_H
    26 #define POLICYLIST_H
    27 
    28 #include <e32base.h>
    29 #include <e32cmn.h>
    30 #include <ups/upstypes.h>
    31 #include "serviceconfig.h"
    32 
    33 namespace UserPromptService
    34 	{			
    35 	// Functions are only exported to support unit tests.
    36 	// Not intended for use outside UPS policy library.
    37 	class CPolicy;
    38 	class CPolicyReader;
    39 	class CPromptRequest;
    40 		
    41 	NONSHARABLE_CLASS(CPolicyList) : public CBase
    42 		{
    43 	public:		
    44 	
    45 		/**
    46 		Converts between UPS policy filenames and system server secure ids & service ids.
    47 		*/
    48 		NONSHARABLE_CLASS(TId)
    49 			{
    50 		public:
    51 			IMPORT_C TId();
    52 			IMPORT_C TId(const TSecureId& iServerSid, const TServiceId& iServiceId);
    53 			IMPORT_C static void IdL(const TDesC& aPolicyFile, TId& aId);
    54 			IMPORT_C void AppendNameToPath(TDes& aFileName) const;
    55 			IMPORT_C TBool operator==(const TId& aId) const;
    56 		public:
    57 			TSecureId iServerSid;
    58 			TServiceId iServiceId;
    59 			};			
    60 			
    61 		IMPORT_C static CPolicyList* NewL(const TId& aId, CPolicyReader& aReader);
    62 		IMPORT_C static CPolicyList* NewLC(const TId& aId, CPolicyReader& aReader);		
    63 		IMPORT_C const CPolicy* Match(const CPromptRequest& aRequest) const;
    64 		IMPORT_C const TId& Id() const;
    65 		IMPORT_C const TServiceConfig& ServiceConfig() const; 
    66 		
    67 		~CPolicyList();
    68 	private:
    69 		CPolicyList(const TId& aId);
    70 		void ConstructL(CPolicyReader& aReader);
    71 		
    72 		CPolicy* iDefaultPolicy;			///< The policy to use if no other policy matches.
    73 		RPointerArray<CPolicy> iPolicies;	///< An ordered list of policies read from the policy file.
    74 		/** Associates the policy list with a system server secure id and a service id.	*/
    75 		TId iId;
    76 		TServiceConfig iServiceConfig;		///< The policy header
    77 		};
    78 	}
    79 
    80 #endif // POLICYLIST_H