|
1 /* |
|
2 * Copyright (c) 2006 - 2007 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: Holds and stores NATFW items. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CWPNATFWITEM_H |
|
20 #define CWPNATFWITEM_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> // CBase. |
|
24 |
|
25 // FORWARD DECLARATIONS |
|
26 class CWPCharacteristic; |
|
27 class CNATFWIAPSpecificItem; |
|
28 class CNATFWDomainSpecificItem; |
|
29 class CRepository; |
|
30 class CWPStunServerItem; |
|
31 class CWPTurnServerItem; |
|
32 |
|
33 /** |
|
34 * This class stores domain and access point specific items |
|
35 * to central repository using UNSAF Protocols Config API |
|
36 * @since S60 v3.1 |
|
37 */ |
|
38 class CWPNATFWItem : public CBase |
|
39 { |
|
40 public: // enumerations |
|
41 |
|
42 enum TNatProtocol |
|
43 { |
|
44 EStunProtocol = 0, |
|
45 ETurnProtocol, |
|
46 EIceProtocol |
|
47 }; |
|
48 |
|
49 public: |
|
50 |
|
51 static CWPNATFWItem* NewL(); |
|
52 |
|
53 virtual ~CWPNATFWItem(); |
|
54 |
|
55 /** |
|
56 * Setter for item id. |
|
57 * @since S60 v3.1 |
|
58 * @param aItemId. Id number for item. |
|
59 */ |
|
60 void SetItemId( TUint aItemId ); |
|
61 |
|
62 /** |
|
63 * Setter for user viewable name of the setting. |
|
64 * @since S60 v3.1 |
|
65 * @param aName. |
|
66 */ |
|
67 void SetNameL( const TDesC& aName ); |
|
68 |
|
69 /** |
|
70 * Setter for APPREF. |
|
71 * @since S60 v3.1 |
|
72 * @param aAppRef. Application reference. |
|
73 */ |
|
74 void SetAppRefL( const TDesC8& aAppRef ); |
|
75 |
|
76 /** |
|
77 * Getter for APPREF. |
|
78 * @since S60 v3.1 |
|
79 * @return Appref value |
|
80 */ |
|
81 const TDesC8& AppRef() const; |
|
82 |
|
83 /** |
|
84 * Setter for Domain specific settings. |
|
85 * Ownership transfer. |
|
86 * @since S60 v3.1 |
|
87 * @param aNATFWDomainSpecificItem. Domain specific settings item. |
|
88 */ |
|
89 void AddDomainSpecificL( CNATFWDomainSpecificItem* |
|
90 aNATFWDomainSpecificItem ); |
|
91 |
|
92 /** |
|
93 * Setter for IAP specific settings. |
|
94 * Ownership transfer. |
|
95 * @since S60 v3.1 |
|
96 * @param aNATFWIAPSpecificItem. IAP specific settings item. |
|
97 */ |
|
98 void AddIAPSpecificL( CNATFWIAPSpecificItem* aNATFWIAPSpecificItem ); |
|
99 |
|
100 /** |
|
101 * Getter for IAP specific settings. |
|
102 * @since S60 v3.2 |
|
103 * @return Reference to RPointerArray containing the IAP specific |
|
104 * items. |
|
105 */ |
|
106 const RPointerArray<CNATFWIAPSpecificItem>& IAPItems() const; |
|
107 |
|
108 /** |
|
109 * Getter for user viewable name of NAT/FW settings item. |
|
110 * @since S60 v3.1 |
|
111 * @return Name parameter value |
|
112 */ |
|
113 const TDesC& Name() const; |
|
114 |
|
115 /** |
|
116 * Getter for NAT/FW item id. |
|
117 * @since S60 v3.1 |
|
118 * @return Item id. |
|
119 */ |
|
120 TUint ItemId() const; |
|
121 |
|
122 /** |
|
123 * Saves the NAT/FW Settings |
|
124 * @since S60 v3.1 |
|
125 */ |
|
126 void StoreL(); |
|
127 |
|
128 /** |
|
129 * Return save data. |
|
130 * @since S60 v3.1 |
|
131 * @return Ids of the Domain and iap item. |
|
132 */ |
|
133 const TDesC8& SaveData() const; |
|
134 |
|
135 /** |
|
136 * Return profile id. |
|
137 * @since S60 v3.1 |
|
138 * @return Id of the saved Domain item. |
|
139 */ |
|
140 const TDesC8& SavedDomainId() const; |
|
141 |
|
142 private: |
|
143 |
|
144 void ConstructL(); |
|
145 |
|
146 /** |
|
147 * Create ICE settings. |
|
148 * @since S60 v3.2 |
|
149 * @param aRepository Target repository. |
|
150 * @param aIndex Current domain item. |
|
151 * @param aKey Domain key. |
|
152 */ |
|
153 void CreateIceSettingsL( CRepository* aRepository, TInt aIndex, |
|
154 TUint aKey ); |
|
155 |
|
156 /** |
|
157 * Create TURN settings. |
|
158 * @since S60 v3.2 |
|
159 * @param aRepository Target repository. |
|
160 * @param aIndex Current domain item. |
|
161 * @param aKey Domain key. |
|
162 */ |
|
163 void CreateTurnSettingsL( CRepository* aRepository, TInt aIndex, |
|
164 TUint aKey ); |
|
165 |
|
166 /** |
|
167 * Create STUN settings. |
|
168 * @since S60 v3.2 |
|
169 * @param aRepository Target repository. |
|
170 * @param aIndex Current domain item. |
|
171 * @param aKey Domain key. |
|
172 * @param aTmpSavedata Buffer for temporary save data. |
|
173 */ |
|
174 void CreateStunSettingsL( CRepository* aRepository, TInt aIndex, |
|
175 TUint aKey, HBufC8* aTmpSavedata ); |
|
176 |
|
177 /** |
|
178 * Create IAP settings. |
|
179 * @since S60 v3.2 |
|
180 * @param aRepository Target repository. |
|
181 * @param aTmpSavedata Buffer for temporary save data. |
|
182 */ |
|
183 void CreateIapSettingsL( CRepository* aRepository, |
|
184 HBufC8* aTmpSavedata ); |
|
185 |
|
186 /** |
|
187 * Update ICE settings. |
|
188 * @since S60 v3.2 |
|
189 * @param aRepository Target repository. |
|
190 * @param aIndex Current domain item. |
|
191 * @param aKey Domain key. |
|
192 */ |
|
193 void UpdateIceSettingsL( CRepository* aRepository, TInt aIndex, |
|
194 TUint aKey ); |
|
195 |
|
196 /** |
|
197 * Update TURN settings. |
|
198 * @since S60 v3.2 |
|
199 * @param aRepository Target repository. |
|
200 * @param aIndex Current domain item. |
|
201 * @param aKey Domain key. |
|
202 */ |
|
203 void UpdateTurnSettingsL( CRepository* aRepository, TInt aIndex, |
|
204 TUint aKey ); |
|
205 |
|
206 /** |
|
207 * Update STUN settings. |
|
208 * @since S60 v3.2 |
|
209 * @param aRepository Target repository. |
|
210 * @param aIndex Current domain item. |
|
211 * @param aKey Domain key. |
|
212 * @param aTmpSavedata Buffer for temporary save data. |
|
213 */ |
|
214 void UpdateStunSettingsL( CRepository* aRepository, TInt aIndex, |
|
215 TUint aKey, HBufC8* aTmpSavedata ); |
|
216 |
|
217 private: // data |
|
218 |
|
219 /** |
|
220 * Domain specific items. |
|
221 */ |
|
222 RPointerArray<CNATFWDomainSpecificItem> iDomainItems; |
|
223 |
|
224 /** |
|
225 * IAP specific items. |
|
226 */ |
|
227 RPointerArray<CNATFWIAPSpecificItem> iIAPItems; |
|
228 |
|
229 /** |
|
230 * NAT/FW settings reference identity in provisioning document. |
|
231 * Own. |
|
232 */ |
|
233 HBufC8* iAppRef; |
|
234 |
|
235 /** |
|
236 * Identifies the item. |
|
237 */ |
|
238 TUint iItemId; |
|
239 |
|
240 /** |
|
241 * Name of NAT/FW settings visible to user when viewing the provisioning |
|
242 * message. See OMA ProvCont document. |
|
243 * CP parameter: NAME |
|
244 * Own. |
|
245 */ |
|
246 HBufC* iName; |
|
247 |
|
248 /** |
|
249 * Saved Domain Specific settings ID. |
|
250 * Own. |
|
251 */ |
|
252 HBufC8* iSavedDomainId; |
|
253 |
|
254 /** |
|
255 * Whole savedata |
|
256 * Own. |
|
257 */ |
|
258 HBufC8* iSaveData; |
|
259 }; |
|
260 |
|
261 #endif // CWPNATFWITEM_H |
|
262 |
|
263 // End of File |