1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/authorisation/userpromptservice/inc_private/policylist.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,80 @@
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 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @internalComponent
1.25 + @released
1.26 +*/
1.27 +
1.28 +#ifndef POLICYLIST_H
1.29 +#define POLICYLIST_H
1.30 +
1.31 +#include <e32base.h>
1.32 +#include <e32cmn.h>
1.33 +#include <ups/upstypes.h>
1.34 +#include "serviceconfig.h"
1.35 +
1.36 +namespace UserPromptService
1.37 + {
1.38 + // Functions are only exported to support unit tests.
1.39 + // Not intended for use outside UPS policy library.
1.40 + class CPolicy;
1.41 + class CPolicyReader;
1.42 + class CPromptRequest;
1.43 +
1.44 + NONSHARABLE_CLASS(CPolicyList) : public CBase
1.45 + {
1.46 + public:
1.47 +
1.48 + /**
1.49 + Converts between UPS policy filenames and system server secure ids & service ids.
1.50 + */
1.51 + NONSHARABLE_CLASS(TId)
1.52 + {
1.53 + public:
1.54 + IMPORT_C TId();
1.55 + IMPORT_C TId(const TSecureId& iServerSid, const TServiceId& iServiceId);
1.56 + IMPORT_C static void IdL(const TDesC& aPolicyFile, TId& aId);
1.57 + IMPORT_C void AppendNameToPath(TDes& aFileName) const;
1.58 + IMPORT_C TBool operator==(const TId& aId) const;
1.59 + public:
1.60 + TSecureId iServerSid;
1.61 + TServiceId iServiceId;
1.62 + };
1.63 +
1.64 + IMPORT_C static CPolicyList* NewL(const TId& aId, CPolicyReader& aReader);
1.65 + IMPORT_C static CPolicyList* NewLC(const TId& aId, CPolicyReader& aReader);
1.66 + IMPORT_C const CPolicy* Match(const CPromptRequest& aRequest) const;
1.67 + IMPORT_C const TId& Id() const;
1.68 + IMPORT_C const TServiceConfig& ServiceConfig() const;
1.69 +
1.70 + ~CPolicyList();
1.71 + private:
1.72 + CPolicyList(const TId& aId);
1.73 + void ConstructL(CPolicyReader& aReader);
1.74 +
1.75 + CPolicy* iDefaultPolicy; ///< The policy to use if no other policy matches.
1.76 + RPointerArray<CPolicy> iPolicies; ///< An ordered list of policies read from the policy file.
1.77 + /** Associates the policy list with a system server secure id and a service id. */
1.78 + TId iId;
1.79 + TServiceConfig iServiceConfig; ///< The policy header
1.80 + };
1.81 + }
1.82 +
1.83 +#endif // POLICYLIST_H