1 /* |
|
2 * Copyright (c) 2008-2009 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: Handles Meco IM settings in OMA provisioning. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_XMPPADAPTER_H |
|
20 #define C_XMPPADAPTER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <CWPAdapter.h> |
|
24 #include <barsc.h> |
|
25 class CCoeEnv; |
|
26 |
|
27 |
|
28 // CLASS DECLARATION |
|
29 |
|
30 /** |
|
31 * CXMPPAdapter handles XMPP conifurations. |
|
32 * The processes configurations are stored inside VENDORCONFIG element. |
|
33 * |
|
34 * @lib xmppadapter.lib |
|
35 * @since S60 v5.0 |
|
36 */ |
|
37 class CXMPPAdapter : public CWPAdapter |
|
38 { |
|
39 |
|
40 public: // Constructors and destructor |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * @param aStorage Storage instance |
|
45 * @param aObserver contact data container observer |
|
46 * |
|
47 */ |
|
48 |
|
49 static CXMPPAdapter* NewL(); |
|
50 |
|
51 /** |
|
52 * Destructor |
|
53 */ |
|
54 virtual ~CXMPPAdapter(); |
|
55 |
|
56 public: // Functions from base classes |
|
57 /** |
|
58 * Reads resource corresponding to the aId |
|
59 * |
|
60 * @return Resource buffer |
|
61 */ |
|
62 |
|
63 HBufC* ReadResourceL( TInt aId ); |
|
64 |
|
65 /** |
|
66 * From CWPAdapter. |
|
67 * Checks the number of settings items. |
|
68 * |
|
69 * @return Quantity of items (always one). |
|
70 */ |
|
71 TInt ItemCount() const; |
|
72 |
|
73 /** |
|
74 * From CWPAdapter. |
|
75 * Getter for the summary title of general IM settings item. Text is |
|
76 * shown to the user in an opened configuration message. |
|
77 * |
|
78 * @param aIndex Not used. |
|
79 * @return Summary title. |
|
80 */ |
|
81 const TDesC16& SummaryTitle( TInt aIndex ) const; |
|
82 |
|
83 |
|
84 /** |
|
85 * From CWPAdapter. |
|
86 * Getter for the summary text of general IM settings. Text is shown |
|
87 * to the user in opened configuration message. |
|
88 * |
|
89 * @param aIndex Not used. |
|
90 * @return Summary text. |
|
91 */ |
|
92 const TDesC16& SummaryText( TInt aIndex ) const; |
|
93 |
|
94 /** |
|
95 * From CWPAdapter. |
|
96 * Query for detailed information about the general IM settings. |
|
97 * This is not supported feature as in other adapters in the framework. |
|
98 * |
|
99 * @param aItem Not used but here because of inheritance. |
|
100 * @param aVisitor Object for retrieveing details of a setting entry. |
|
101 * @return KErrNotSupported if not supported. |
|
102 */ |
|
103 TInt DetailsL( TInt aItem, MWPPairVisitor& aVisitor ); |
|
104 |
|
105 /** |
|
106 * From CWPAdapter. |
|
107 * Saves general IM settings. |
|
108 * |
|
109 * @param aIndex Not used. |
|
110 */ |
|
111 void SaveL( TInt aItem ); |
|
112 |
|
113 /** |
|
114 * From CWPAdapter. |
|
115 * Returns EFalse since there can only be one set of general VoIP |
|
116 * settings. |
|
117 * |
|
118 * @param aItem Location of the general IM settings item to |
|
119 * be queried. Not used. |
|
120 * @return Information whether these settings can be set as default. |
|
121 */ |
|
122 TBool CanSetAsDefault( TInt aItem ) const; |
|
123 |
|
124 /** |
|
125 * From CWPAdapter. |
|
126 * Adapter sets the settings as default. Not supported. |
|
127 * |
|
128 * @param aItem Location of the general IM settings item to be |
|
129 * set as default. |
|
130 */ |
|
131 void SetAsDefaultL( TInt aItem ); |
|
132 |
|
133 /** |
|
134 * From CWPAdapter. |
|
135 * Visit method. Visits the adapter. Adapter checks from |
|
136 * aCharacteristic if the data is targetet to it and acts according to |
|
137 * that. |
|
138 * |
|
139 * @param aCharacteristic The characteristic found. |
|
140 */ |
|
141 void VisitL( CWPCharacteristic& aCharacteristic ); |
|
142 |
|
143 /** |
|
144 * From CWPAdapter. |
|
145 * Visit method. Visits the adapter. Method sets the iAppId value. |
|
146 * |
|
147 * @param aParameter The parameter found. |
|
148 */ |
|
149 void VisitL( CWPParameter& aParameter ); |
|
150 |
|
151 /** |
|
152 * From CWPAdapter. |
|
153 * Visit method. Not supported. |
|
154 * |
|
155 * @param aLink Link to the characteristic. |
|
156 */ |
|
157 void VisitLinkL( CWPCharacteristic& /*aLink*/ ); |
|
158 |
|
159 private: // Default constructors |
|
160 |
|
161 /** |
|
162 * C++ default constructor. |
|
163 */ |
|
164 CXMPPAdapter(); |
|
165 |
|
166 /** |
|
167 * By default Symbian 2nd phase constructor is private. |
|
168 */ |
|
169 void ConstructL(); |
|
170 |
|
171 private: // New functions |
|
172 |
|
173 /** |
|
174 * Creates the settings from the received provisioning |
|
175 */ |
|
176 void CreateSettingsRecordL(); |
|
177 |
|
178 /** |
|
179 * Updates the existing settings |
|
180 */ |
|
181 void UpdateServiceSettingsL(); |
|
182 |
|
183 /** |
|
184 * Parses integer form Descriptor |
|
185 * |
|
186 * @param aPtr to be parsed. |
|
187 * @param aInt parsed integer value is stored.. |
|
188 */ |
|
189 void ParseIntegerL( const TDesC& aPtr, TInt& aInt ); |
|
190 /** |
|
191 * writes the application specific settings into cenrep |
|
192 * |
|
193 * e.g. cancel login support : This writes if cancel lgin not supported. |
|
194 */ |
|
195 void WriteAppSettingsL(); |
|
196 |
|
197 /** |
|
198 * This will check for the IM subservice in sp settings table |
|
199 * if any service in spsettings is having IM Subservice |
|
200 * this will return Etrue else it will return EFalse |
|
201 * @Return - ETrue - if IM Subservice Exists else EFalse |
|
202 **/ |
|
203 TBool CheckforXmppserviceL(); |
|
204 |
|
205 private: // Data |
|
206 /** |
|
207 * user name for the current characteristic. |
|
208 * Owned |
|
209 */ |
|
210 HBufC* iUserName; |
|
211 /** |
|
212 * password for the current characteristic. |
|
213 * Owned |
|
214 */ |
|
215 HBufC* iPassword; |
|
216 |
|
217 /** |
|
218 * user name the current characteristic. |
|
219 * Owned |
|
220 */ |
|
221 HBufC* iProviderId; |
|
222 |
|
223 /** |
|
224 * settingsrecordid for the current characteristic. |
|
225 * Owned |
|
226 */ |
|
227 TUint32 iSettingsRecordId; |
|
228 |
|
229 /** |
|
230 * service id for the current characteristic. |
|
231 */ |
|
232 TInt iServiceProviderId; |
|
233 |
|
234 /** |
|
235 * Application ID of the current characteristic. |
|
236 * Owned |
|
237 */ |
|
238 HBufC* iAppId; |
|
239 |
|
240 /** |
|
241 * pointer to Application ID of the current characteristic. |
|
242 */ |
|
243 TPtrC iAppIdPtr; |
|
244 |
|
245 /** |
|
246 * xmppserveraddress of the current characteristic. |
|
247 * Owned |
|
248 */ |
|
249 HBufC* iXmppServerAddress; |
|
250 /** |
|
251 * protocol id of the current characteristic. |
|
252 * Owned |
|
253 */ |
|
254 HBufC* iProtocol; |
|
255 /** |
|
256 * Sanp id of the current characteristic. |
|
257 */ |
|
258 TInt iSnapId; |
|
259 |
|
260 /** |
|
261 * ssl of the current characteristic. |
|
262 */ |
|
263 TInt iSSL; |
|
264 |
|
265 /** |
|
266 * port number of the current characteristic. |
|
267 */ |
|
268 TInt iPortNbr; |
|
269 |
|
270 /** |
|
271 * Domain name the current characteristic. |
|
272 * Owned |
|
273 */ |
|
274 HBufC* iDomainName; |
|
275 |
|
276 /** |
|
277 * BranId for the service specific icons. |
|
278 */ |
|
279 HBufC* iBrandId; |
|
280 |
|
281 /** |
|
282 * Reference Name. |
|
283 */ |
|
284 HBufC* iAppref; |
|
285 |
|
286 /** |
|
287 * Default text |
|
288 */ |
|
289 HBufC* iDefaultName; |
|
290 |
|
291 /** |
|
292 * Title |
|
293 */ |
|
294 HBufC* iTitle; |
|
295 /** |
|
296 * Confirms whether APPID is correct (w9033). |
|
297 */ |
|
298 TBool iIsAppIdOk; |
|
299 |
|
300 /* |
|
301 * the user viewable name of general XMPP settings. |
|
302 */ |
|
303 HBufC* iAppName; |
|
304 |
|
305 /* |
|
306 * Resource file to read |
|
307 */ |
|
308 RResourceFile iResFile; |
|
309 |
|
310 }; |
|
311 |
|
312 #endif // C_XMPPADAPTER_H |
|
313 |
|
314 // End of File |
|