|
1 /* |
|
2 * Copyright (c) 2002-2005 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 "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: Header declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 #ifndef SERVICE_POLICY_H |
|
29 #define SERVICE_POLICY_H |
|
30 |
|
31 // INCLUDES |
|
32 #include <e32base.h> // for CActive |
|
33 #include <badesca.h> |
|
34 // INCLUDES |
|
35 #include <flogger.h> |
|
36 #include "SenDomFragment.h" |
|
37 #include "MSenServicePolicy.h" |
|
38 #include "SenBaseFragment.h" |
|
39 |
|
40 // FORWARD DECLARATION |
|
41 class CSenIdentityProviderIdArray8; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 /** |
|
47 * Example structure of ServicePolicy XML fragment: |
|
48 * |
|
49 * <ServicePolicy> |
|
50 * </ServicePolicy> |
|
51 */ |
|
52 class CServicePolicy : public CSenDomFragment, public MSenServicePolicy |
|
53 { |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Two-phased constructors. |
|
58 * These parameterless constructors are ment to be used |
|
59 * for example before parsing XML stream. |
|
60 */ |
|
61 static CServicePolicy* NewL(); |
|
62 static CServicePolicy* NewLC(); |
|
63 |
|
64 /** |
|
65 * Destructor |
|
66 */ |
|
67 virtual ~CServicePolicy(); |
|
68 |
|
69 // Functions from base classes |
|
70 |
|
71 // From MServicePolicy |
|
72 virtual TInt AddPolicyL(CSenElement* aPolicy); |
|
73 virtual TInt RemovePolicyL(TDesC8& aPolicyName); |
|
74 virtual TInt ServicePolicies(RPolicyArray& aPolicies); |
|
75 virtual TInt RebuildServicePolicyFrom(MSenServicePolicy& aTemplate); |
|
76 virtual TBool Accepts(MSenServicePolicy& aPolicyPattern); |
|
77 virtual CSenElement* ClientPolicy(); |
|
78 virtual TBool ClientPolicy(const TDesC8& aKey); |
|
79 virtual HBufC8* ClientPolicyValue(const TDesC8& aKey); |
|
80 TInt AddClientPolicyL(CSenElement* aTemplate); |
|
81 |
|
82 protected: |
|
83 |
|
84 /** |
|
85 * C++ default constructor. |
|
86 */ |
|
87 CServicePolicy(); |
|
88 |
|
89 /** |
|
90 * By default Symbian 2nd phase constructor is private. |
|
91 */ |
|
92 void BaseConstructL(const TDesC8& aLocalName); |
|
93 //RFileLogger* Log() const; |
|
94 |
|
95 private: // New functions |
|
96 |
|
97 /** |
|
98 * Leaving variants of the functions. |
|
99 */ |
|
100 TBool AcceptsL(MSenServicePolicy& aPolicyPattern); |
|
101 TInt RebuildServicePolicyFromL(MSenServicePolicy& aTemplate); |
|
102 |
|
103 |
|
104 TInt AddWspPolicyL(CSenElement* aPolicy); |
|
105 TBool ValidatePolicy(CSenElement* aPolicy); |
|
106 TPtrC8 PolicyIdL(CSenElement* aPolicy); //codescannerwarnings |
|
107 TPtrC8 PolicyNameL(CSenElement* aPolicy); //codescannerwarnings |
|
108 TPtrC8 PolicyUriL(CSenElement* aPolicy); |
|
109 void GenerateDeviceIdL(CSenElement* aPolicy); //codescannerwarnings |
|
110 |
|
111 void AddApplicationInfoElementsL(CSenElement* aApplicationInfoElement); |
|
112 void AddAppicationElementsL(CSenElement* aApplicationElement); |
|
113 void AddDeviceElementsL(CSenElement* aDeviceElement); |
|
114 void AddUserAgentElementsL(CSenElement* aUserAgentElement); |
|
115 void AddOSElementsL(CSenElement* aOSElement); |
|
116 |
|
117 private: // Data |
|
118 // CSenIdentityProviderIdArray8* iIdpIdList; |
|
119 //RFileLogger iLog; |
|
120 }; |
|
121 |
|
122 #endif //SEN_POLICY_H |
|
123 |
|
124 // End of File |