sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
@file
|
sl@0
|
21 |
@internalComponent
|
sl@0
|
22 |
@released
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
|
sl@0
|
25 |
#ifndef POLICYLIST_H
|
sl@0
|
26 |
#define POLICYLIST_H
|
sl@0
|
27 |
|
sl@0
|
28 |
#include <e32base.h>
|
sl@0
|
29 |
#include <e32cmn.h>
|
sl@0
|
30 |
#include <ups/upstypes.h>
|
sl@0
|
31 |
#include "serviceconfig.h"
|
sl@0
|
32 |
|
sl@0
|
33 |
namespace UserPromptService
|
sl@0
|
34 |
{
|
sl@0
|
35 |
// Functions are only exported to support unit tests.
|
sl@0
|
36 |
// Not intended for use outside UPS policy library.
|
sl@0
|
37 |
class CPolicy;
|
sl@0
|
38 |
class CPolicyReader;
|
sl@0
|
39 |
class CPromptRequest;
|
sl@0
|
40 |
|
sl@0
|
41 |
NONSHARABLE_CLASS(CPolicyList) : public CBase
|
sl@0
|
42 |
{
|
sl@0
|
43 |
public:
|
sl@0
|
44 |
|
sl@0
|
45 |
/**
|
sl@0
|
46 |
Converts between UPS policy filenames and system server secure ids & service ids.
|
sl@0
|
47 |
*/
|
sl@0
|
48 |
NONSHARABLE_CLASS(TId)
|
sl@0
|
49 |
{
|
sl@0
|
50 |
public:
|
sl@0
|
51 |
IMPORT_C TId();
|
sl@0
|
52 |
IMPORT_C TId(const TSecureId& iServerSid, const TServiceId& iServiceId);
|
sl@0
|
53 |
IMPORT_C static void IdL(const TDesC& aPolicyFile, TId& aId);
|
sl@0
|
54 |
IMPORT_C void AppendNameToPath(TDes& aFileName) const;
|
sl@0
|
55 |
IMPORT_C TBool operator==(const TId& aId) const;
|
sl@0
|
56 |
public:
|
sl@0
|
57 |
TSecureId iServerSid;
|
sl@0
|
58 |
TServiceId iServiceId;
|
sl@0
|
59 |
};
|
sl@0
|
60 |
|
sl@0
|
61 |
IMPORT_C static CPolicyList* NewL(const TId& aId, CPolicyReader& aReader);
|
sl@0
|
62 |
IMPORT_C static CPolicyList* NewLC(const TId& aId, CPolicyReader& aReader);
|
sl@0
|
63 |
IMPORT_C const CPolicy* Match(const CPromptRequest& aRequest) const;
|
sl@0
|
64 |
IMPORT_C const TId& Id() const;
|
sl@0
|
65 |
IMPORT_C const TServiceConfig& ServiceConfig() const;
|
sl@0
|
66 |
|
sl@0
|
67 |
~CPolicyList();
|
sl@0
|
68 |
private:
|
sl@0
|
69 |
CPolicyList(const TId& aId);
|
sl@0
|
70 |
void ConstructL(CPolicyReader& aReader);
|
sl@0
|
71 |
|
sl@0
|
72 |
CPolicy* iDefaultPolicy; ///< The policy to use if no other policy matches.
|
sl@0
|
73 |
RPointerArray<CPolicy> iPolicies; ///< An ordered list of policies read from the policy file.
|
sl@0
|
74 |
/** Associates the policy list with a system server secure id and a service id. */
|
sl@0
|
75 |
TId iId;
|
sl@0
|
76 |
TServiceConfig iServiceConfig; ///< The policy header
|
sl@0
|
77 |
};
|
sl@0
|
78 |
}
|
sl@0
|
79 |
|
sl@0
|
80 |
#endif // POLICYLIST_H
|