|
1 /* |
|
2 * Copyright (c) 2006 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: project specification |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWPPARAMETER_H |
|
20 #define CWPPARAMETER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include "MWPElement.h" |
|
25 |
|
26 // DATA TYPES |
|
27 /// Parameter IDs follow the WBXML specification. |
|
28 enum TWPParameterID |
|
29 { |
|
30 // This value means that the name of the parameter |
|
31 // has been stored instead of an id |
|
32 EWPNamedParameter = 0, |
|
33 |
|
34 // Actual parameter ids follow |
|
35 EWPParameterName = 7, |
|
36 EWPParameterNapAddress, |
|
37 EWPParameterNapAddrType, |
|
38 EWPParameterCallType, |
|
39 EWPParameterValidUntil, |
|
40 EWPParameterAuthType, |
|
41 EWPParameterAuthName, |
|
42 EWPParameterAuthSecret, |
|
43 EWPParameterLinger, |
|
44 EWPParameterBearer, |
|
45 EWPParameterNapID, |
|
46 EWPParameterCountry, |
|
47 EWPParameterNetwork, |
|
48 EWPParameterInternet, |
|
49 EWPParameterProxyID, |
|
50 EWPParameterProxyProviderID, |
|
51 EWPParameterDomain, |
|
52 EWPParameterProvURL, |
|
53 EWPParameterPxAuthType, |
|
54 EWPParameterPxAuthID, |
|
55 EWPParameterPxAuthPW, |
|
56 EWPParameterStartPage, |
|
57 EWPParameterBasAuthID, |
|
58 EWPParameterBasAuthPW, |
|
59 EWPParameterPushEnabled, |
|
60 EWPParameterPxAddr, |
|
61 EWPParameterPxAddrType, |
|
62 EWPParameterToNapID, |
|
63 EWPParameterPortNbr, |
|
64 EWPParameterService, |
|
65 EWPParameterLinkspeed, |
|
66 EWPParameterDnLinkSpeed, |
|
67 EWPParameterLocalAddr, |
|
68 EWPParameterLocalAddrType, |
|
69 EWPParameterContextAllow, |
|
70 EWPParameterTrust, |
|
71 EWPParameterMaster, |
|
72 EWPParameterSID, |
|
73 EWPParameterSOC, |
|
74 EWPParameterWSPVersion, |
|
75 EWPParameterPhysicalProxyID, |
|
76 EWPParameterClientID, |
|
77 EWPParameterDeliveryErrSDU, |
|
78 EWPParameterDeliveryOrder, |
|
79 EWPParameterTrafficClass, |
|
80 EWPParameterMaxSDUSide, |
|
81 EWPParameterMaxBitrateUplink, |
|
82 EWPParameterMaxBitrateDnlink, |
|
83 EWPParameterResidualBER, |
|
84 EWPParameterSDUErrorRatio, |
|
85 EWPParameterTrafficHandlPrio, |
|
86 EWPParameterTransferDelay, |
|
87 EWPParameterGuaranteedBitrateUplink, |
|
88 EWPParameterGuaranteedBitrateDnlink, |
|
89 EWPParameterPxAddrFQDN, |
|
90 EWPParameterProxyPW, |
|
91 EWPParameterPPGAuthType, |
|
92 EWPParameterPullEnabled = 0x47, |
|
93 EWPParameterDNSAddr, |
|
94 EWPParameterMaxNumRetry, |
|
95 EWPParameterFirstRetryTimeout, |
|
96 EWPParameterReregThreshold, |
|
97 EWPParameterTBit, |
|
98 EWPParameterAuthEntity = 0x4e, |
|
99 EWPParameterSPI, |
|
100 |
|
101 EWPParameterDirection = 0x60, |
|
102 EWPParameterDNSAddrType, |
|
103 EWPParameterDNSPriority, |
|
104 EWPParameterSourceStatisticsDescriptor, |
|
105 EWPParameterSignallingIndication, |
|
106 EWPParameterDefGW, |
|
107 EWPParameterNetworkMask, |
|
108 EWPParameterUseCB, |
|
109 EWPParameterCBNBR, |
|
110 EWPParameterPPPComp, |
|
111 EWPParameterToLoginScriptId, |
|
112 EWPParameterUsePTxtLog, |
|
113 EWPParameterGPRSPDP, |
|
114 EWPParameterModemInit, |
|
115 EWPParameterIPAddrFromServer, |
|
116 EWPParameterDNSAddrFromServer, |
|
117 EWPParameterIPv6AddrFromServer, |
|
118 EWPParameterIfNetworks, |
|
119 EWPParameterIAPService, |
|
120 EWPParameterSSID, |
|
121 EWPParameterNetworkMode, |
|
122 EWPParameterSecurityMode, |
|
123 EWPParameterWPAPreSharedKey, |
|
124 EWPParameterLength, |
|
125 EWPParameterData, |
|
126 |
|
127 // Code page 1 |
|
128 EWPParameterName1 = 0x07+0x100, |
|
129 EWPParameterInternet1 = 0x14+0x100, |
|
130 EWPParameterStartPage1 = 0x1C+0x100, |
|
131 EWPParameterToNapID1 = 0x22+0x100, |
|
132 EWPParameterPortNbr1 = 0x23+0x100, |
|
133 EWPParameterService1 = 0x24+0x100, |
|
134 |
|
135 // Skip in code page |
|
136 EWPParameterAAccept = 0x2E + 0x100, |
|
137 EWPParameterAAuthData, |
|
138 EWPParameterAAuthLevel, |
|
139 EWPParameterAAuthName, |
|
140 EWPParameterAAuthSecret, |
|
141 EWPParameterAAuthType, |
|
142 EWPParameterAddr, |
|
143 EWPParameterAddrType, |
|
144 EWPParameterAppID, |
|
145 EWPParameterAProtocol, |
|
146 EWPParameterProviderID, |
|
147 EWPParameterToProxy, |
|
148 EWPParameterURI, |
|
149 EWPParameterRule, |
|
150 EWPParameterAppRef, |
|
151 EWPParameterToAppRef, |
|
152 EWPParameterLoginTW, |
|
153 EWPParameterLoginScriptType, |
|
154 EWPParameterLoginScriptData, |
|
155 EWPParameterLoginScriptId, |
|
156 |
|
157 EWPParameterFrom = 0x0201, |
|
158 EWPParameterMaxBandwidth, |
|
159 EWPParameterMinUDPPort, |
|
160 EWPParameterMaxUDPPort, |
|
161 |
|
162 // This enumeration will always be the last element in enumeration |
|
163 EWPLastParameter |
|
164 }; |
|
165 |
|
166 /** |
|
167 * CWPParameter contains one parameter. |
|
168 * |
|
169 * @lib ProvisioningEngine |
|
170 * @since 2.0 |
|
171 */ |
|
172 class CWPParameter : public CBase, public MWPElement |
|
173 { |
|
174 public: // Constructors and destructor |
|
175 |
|
176 /** |
|
177 * Two-phased constructor. |
|
178 */ |
|
179 IMPORT_C static CWPParameter* NewL(); |
|
180 |
|
181 /** |
|
182 * Two-phased constructor. |
|
183 */ |
|
184 // Static constructor |
|
185 IMPORT_C static CWPParameter* NewLC(); |
|
186 |
|
187 /** |
|
188 * Destructor. |
|
189 */ |
|
190 ~CWPParameter(); |
|
191 |
|
192 public: // New methods |
|
193 |
|
194 /** |
|
195 * Sets the parameter's ID. Must be one of enumeration |
|
196 * TWPParameterID. |
|
197 * @param aID Parameter's ID |
|
198 */ |
|
199 IMPORT_C void SetID( TInt aId ); |
|
200 |
|
201 /** |
|
202 * Returns the parameter's ID. |
|
203 * @return Parameter's ID |
|
204 */ |
|
205 IMPORT_C TInt ID() const; |
|
206 |
|
207 /** |
|
208 * Sets the parameter's name. |
|
209 * @param aName Parameter's new name |
|
210 */ |
|
211 IMPORT_C void SetNameL( const TDesC& aValue ); |
|
212 |
|
213 /** |
|
214 * Returns the parameter's name. |
|
215 * @return Parameter's name |
|
216 */ |
|
217 IMPORT_C const TDesC& Name() const; |
|
218 |
|
219 /** |
|
220 * Sets the parameter's value. |
|
221 * @param aValue Parameter's new value |
|
222 */ |
|
223 IMPORT_C void SetValueL( const TDesC& aValue ); |
|
224 |
|
225 /** |
|
226 * Returns the parameter's value. |
|
227 * @return Parameter's value |
|
228 */ |
|
229 IMPORT_C const TDesC& Value() const; |
|
230 |
|
231 public: // From MWPElement |
|
232 |
|
233 void CallVisitorL( MWPVisitor& aVisitor ); |
|
234 |
|
235 TInt Type() const; |
|
236 |
|
237 void ExternalizeL(RWriteStream& aStream) const; |
|
238 |
|
239 void InternalizeL(RReadStream& aStream); |
|
240 |
|
241 private: |
|
242 |
|
243 /** |
|
244 * C++ default constructor. |
|
245 */ |
|
246 CWPParameter(); |
|
247 |
|
248 /** |
|
249 * By default Symbian 2nd phase constructor is private. |
|
250 */ |
|
251 void ConstructL(); |
|
252 |
|
253 |
|
254 private: |
|
255 /// ID of the parameter. See TWPParameterIDs. |
|
256 TInt iParameterID; |
|
257 |
|
258 /// Name of the parameter. Owns. |
|
259 HBufC* iName; |
|
260 |
|
261 /// Value of the parameter. Owns. |
|
262 HBufC* iValue; |
|
263 |
|
264 }; |
|
265 |
|
266 #endif /* CWPPARAMETER_H */ |