|
1 /* |
|
2 * Copyright (c) 2004 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: SAP settings container. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include <e32std.h> |
|
20 #include <centralrepository.h> |
|
21 #include <s32mem.h> |
|
22 |
|
23 #include "cimpssapsettings.h" |
|
24 #include "CIMPSSAPSettingsBody.h" |
|
25 #include "CIMPSSAPKeyValuePairs.h" |
|
26 #include "CIMPSSAPKeyValuePair.h" |
|
27 |
|
28 #include "IMPSSAPObjectHandler.h" |
|
29 #include "IMPSSAPSettingsStoreDefinitions.h" |
|
30 #include "IMPSSAPSettingsStorePanics.h" |
|
31 |
|
32 |
|
33 // ================= MEMBER FUNCTIONS ======================= |
|
34 // ----------------------------------------------------------------------------- |
|
35 // CIMPSSAPSettings::NewL() |
|
36 // Two-phased constructor. |
|
37 // ----------------------------------------------------------------------------- |
|
38 // |
|
39 EXPORT_C CIMPSSAPSettings* CIMPSSAPSettings::NewL() |
|
40 { |
|
41 CIMPSSAPSettings* self = CIMPSSAPSettings::NewLC(); |
|
42 CleanupStack::Pop(); |
|
43 return self; |
|
44 } |
|
45 |
|
46 |
|
47 // ----------------------------------------------------------------------------- |
|
48 // CIMPSSAPSettings::NewLC() |
|
49 // Two-phased constructor. |
|
50 // ----------------------------------------------------------------------------- |
|
51 // |
|
52 EXPORT_C CIMPSSAPSettings* CIMPSSAPSettings::NewLC() |
|
53 { |
|
54 CIMPSSAPSettings* self = new ( ELeave ) CIMPSSAPSettings(); |
|
55 CleanupStack::PushL( self ); |
|
56 self->iKeyValuePairs = CIMPSSAPKeyValuePairs::NewL(); |
|
57 self->iBody = CIMPSSAPSettingsBody::NewL(); |
|
58 return self; |
|
59 } |
|
60 |
|
61 |
|
62 // ----------------------------------------------------------------------------- |
|
63 // CIMPSSAPSettings::~CIMPSSAPSettings() |
|
64 // Destructor |
|
65 // ----------------------------------------------------------------------------- |
|
66 // |
|
67 EXPORT_C CIMPSSAPSettings::~CIMPSSAPSettings() |
|
68 { |
|
69 delete iBody; |
|
70 delete iKeyValuePairs; |
|
71 } |
|
72 |
|
73 |
|
74 // ----------------------------------------------------------------------------- |
|
75 // CIMPSSAPSettings::CIMPSSAPSettings() |
|
76 // C++ default constructor can NOT contain any code, that |
|
77 // might leave. |
|
78 // ----------------------------------------------------------------------------- |
|
79 // |
|
80 CIMPSSAPSettings::CIMPSSAPSettings() |
|
81 { |
|
82 } |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 // ----------------------------------------------------------------------------- |
|
89 // CIMPSSAPSettings::Uid() |
|
90 // ----------------------------------------------------------------------------- |
|
91 // |
|
92 EXPORT_C TUint32 CIMPSSAPSettings::Uid() const |
|
93 { |
|
94 return iBody->Uid(); |
|
95 } |
|
96 |
|
97 // ----------------------------------------------------------------------------- |
|
98 // CIMPSSAPSettings::SAPName() |
|
99 // ----------------------------------------------------------------------------- |
|
100 // |
|
101 EXPORT_C const TDesC& CIMPSSAPSettings::SAPName() const |
|
102 { |
|
103 return iBody->SAPName(); |
|
104 } |
|
105 |
|
106 |
|
107 // ----------------------------------------------------------------------------- |
|
108 // CIMPSSAPSettings::SAPAddress() |
|
109 // ----------------------------------------------------------------------------- |
|
110 // |
|
111 EXPORT_C const TDesC& CIMPSSAPSettings::SAPAddress() const |
|
112 { |
|
113 return iBody->SAPAddress(); |
|
114 } |
|
115 |
|
116 |
|
117 // ----------------------------------------------------------------------------- |
|
118 // CIMPSSAPSettings::SAPPort() |
|
119 // ----------------------------------------------------------------------------- |
|
120 // |
|
121 EXPORT_C TInt32 CIMPSSAPSettings::SAPPort() const |
|
122 { |
|
123 return iBody->SAPPort(); |
|
124 } |
|
125 |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CIMPSSAPSettings::SAPUserId() |
|
129 // ----------------------------------------------------------------------------- |
|
130 // |
|
131 EXPORT_C const TDesC& CIMPSSAPSettings::SAPUserId() const |
|
132 { |
|
133 return iBody->SAPUserId(); |
|
134 } |
|
135 |
|
136 |
|
137 // ----------------------------------------------------------------------------- |
|
138 // CIMPSSAPSettings::SAPUserPassword() |
|
139 // ----------------------------------------------------------------------------- |
|
140 // |
|
141 EXPORT_C const TDesC& CIMPSSAPSettings::SAPUserPassword() const |
|
142 { |
|
143 return iBody->SAPUserPassword(); |
|
144 } |
|
145 |
|
146 |
|
147 // ----------------------------------------------------------------------------- |
|
148 // CIMPSSAPSettings::HTTPProxyAddress() |
|
149 // ----------------------------------------------------------------------------- |
|
150 // |
|
151 EXPORT_C const TDesC& CIMPSSAPSettings::HTTPProxyAddress() const |
|
152 { |
|
153 return iBody->HTTPProxyAddress(); |
|
154 } |
|
155 |
|
156 |
|
157 // ----------------------------------------------------------------------------- |
|
158 // CIMPSSAPSettings::HTTPProxyPort() |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 EXPORT_C TInt32 CIMPSSAPSettings::HTTPProxyPort() const |
|
162 { |
|
163 return iBody->HTTPProxyPort(); |
|
164 } |
|
165 |
|
166 |
|
167 // ----------------------------------------------------------------------------- |
|
168 // CIMPSSAPSettings::HTTPProxyUserId() |
|
169 // ----------------------------------------------------------------------------- |
|
170 // |
|
171 EXPORT_C const TDesC& CIMPSSAPSettings::HTTPProxyUserId() const |
|
172 { |
|
173 return iBody->HTTPProxyUserId(); |
|
174 } |
|
175 |
|
176 |
|
177 // ----------------------------------------------------------------------------- |
|
178 // CIMPSSAPSettings::HTTPProxyUserPassword() |
|
179 // ----------------------------------------------------------------------------- |
|
180 // |
|
181 EXPORT_C const TDesC& CIMPSSAPSettings::HTTPProxyUserPassword() const |
|
182 { |
|
183 return iBody->HTTPProxyUserPassword(); |
|
184 } |
|
185 |
|
186 |
|
187 // ----------------------------------------------------------------------------- |
|
188 // CIMPSSAPSettings::AccessPoint() |
|
189 // ----------------------------------------------------------------------------- |
|
190 // |
|
191 EXPORT_C TUint32 CIMPSSAPSettings::AccessPoint() const |
|
192 { |
|
193 return iBody->AccessPoint(); |
|
194 } |
|
195 |
|
196 // ----------------------------------------------------------------------------- |
|
197 // CIMPSSAPSettings::ClientId() |
|
198 // ----------------------------------------------------------------------------- |
|
199 // |
|
200 EXPORT_C const TDesC& CIMPSSAPSettings::ClientId() const |
|
201 { |
|
202 return iBody->ClientId(); |
|
203 } |
|
204 |
|
205 // ----------------------------------------------------------------------------- |
|
206 // CIMPSSAPSettings::ServerAuthenticationName() |
|
207 // ----------------------------------------------------------------------------- |
|
208 // |
|
209 EXPORT_C const TDesC& CIMPSSAPSettings::ServerAuthenticationName() const |
|
210 { |
|
211 return iBody->ServerAuthenticationName(); |
|
212 } |
|
213 |
|
214 // ----------------------------------------------------------------------------- |
|
215 // CIMPSSAPSettings::ServerAuthenticationPassword() |
|
216 // ----------------------------------------------------------------------------- |
|
217 // |
|
218 EXPORT_C const TDesC& CIMPSSAPSettings::ServerAuthenticationPassword() const |
|
219 { |
|
220 return iBody->ServerAuthenticationPassword(); |
|
221 } |
|
222 |
|
223 // ----------------------------------------------------------------------------- |
|
224 // CIMPSSAPSettings::ServerAcceptedContentType() |
|
225 // ----------------------------------------------------------------------------- |
|
226 // |
|
227 EXPORT_C const TDesC& CIMPSSAPSettings::ServerAcceptedContentType() const |
|
228 { |
|
229 return iBody->ServerAcceptedContentType(); |
|
230 } |
|
231 |
|
232 |
|
233 // ----------------------------------------------------------------------------- |
|
234 // CIMPSSAPSettings::HighLevelServices() |
|
235 // ----------------------------------------------------------------------------- |
|
236 // |
|
237 EXPORT_C TUint32 CIMPSSAPSettings::HighLevelServices() const |
|
238 { |
|
239 return iBody->HighLevelServices(); |
|
240 } |
|
241 |
|
242 |
|
243 // ----------------------------------------------------------------------------- |
|
244 // CIMPSSAPSettings::SetSAPNameL() |
|
245 // ----------------------------------------------------------------------------- |
|
246 // |
|
247 EXPORT_C void CIMPSSAPSettings::SetSAPNameL( const TDesC& aName ) |
|
248 { |
|
249 iBody->SetSAPNameL( aName ); |
|
250 } |
|
251 |
|
252 |
|
253 // ----------------------------------------------------------------------------- |
|
254 // CIMPSSAPSettings::SetSAPAddressL() |
|
255 // ----------------------------------------------------------------------------- |
|
256 // |
|
257 EXPORT_C void CIMPSSAPSettings::SetSAPAddressL( const TDesC& aAddress ) |
|
258 { |
|
259 iBody->SetSAPAddressL( aAddress ); |
|
260 } |
|
261 |
|
262 |
|
263 // ----------------------------------------------------------------------------- |
|
264 // CIMPSSAPSettings::SetSAPPort() |
|
265 // ----------------------------------------------------------------------------- |
|
266 // |
|
267 EXPORT_C TInt CIMPSSAPSettings::SetSAPPort( TInt32 aPort ) |
|
268 { |
|
269 return iBody->SetSAPPort( aPort ); |
|
270 } |
|
271 |
|
272 |
|
273 // ----------------------------------------------------------------------------- |
|
274 // CIMPSSAPSettings::SetSAPUserIdL() |
|
275 // ----------------------------------------------------------------------------- |
|
276 // |
|
277 EXPORT_C void CIMPSSAPSettings::SetSAPUserIdL( const TDesC& aUserId ) |
|
278 { |
|
279 iBody->SetSAPUserIdL( aUserId ); |
|
280 } |
|
281 |
|
282 |
|
283 // ----------------------------------------------------------------------------- |
|
284 // CIMPSSAPSettings::SetSAPUserPasswordL() |
|
285 // ----------------------------------------------------------------------------- |
|
286 // |
|
287 EXPORT_C void CIMPSSAPSettings::SetSAPUserPasswordL( const TDesC& aPassword ) |
|
288 { |
|
289 iBody->SetSAPUserPasswordL( aPassword ); |
|
290 } |
|
291 |
|
292 |
|
293 // ----------------------------------------------------------------------------- |
|
294 // CIMPSSAPSettings::SetHTTPProxyAddressL() |
|
295 // ----------------------------------------------------------------------------- |
|
296 // |
|
297 EXPORT_C void CIMPSSAPSettings::SetHTTPProxyAddressL( const TDesC& aAddress ) |
|
298 { |
|
299 iBody->SetHTTPProxyAddressL( aAddress ); |
|
300 } |
|
301 |
|
302 |
|
303 // ----------------------------------------------------------------------------- |
|
304 // CIMPSSAPSettings::SetHTTPProxyPort() |
|
305 // ----------------------------------------------------------------------------- |
|
306 // |
|
307 EXPORT_C TInt CIMPSSAPSettings::SetHTTPProxyPort( TInt32 aPort ) |
|
308 { |
|
309 return iBody->SetHTTPProxyPort( aPort ); |
|
310 } |
|
311 |
|
312 |
|
313 // ----------------------------------------------------------------------------- |
|
314 // CIMPSSAPSettings::SetHTTPProxyUserIdL() |
|
315 // ----------------------------------------------------------------------------- |
|
316 // |
|
317 EXPORT_C void CIMPSSAPSettings::SetHTTPProxyUserIdL( const TDesC& aUserId ) |
|
318 { |
|
319 iBody->SetHTTPProxyUserIdL( aUserId ); |
|
320 } |
|
321 |
|
322 |
|
323 // ----------------------------------------------------------------------------- |
|
324 // CIMPSSAPSettings::SetHTTPProxyUserPasswordL() |
|
325 // ----------------------------------------------------------------------------- |
|
326 // |
|
327 EXPORT_C void CIMPSSAPSettings::SetHTTPProxyUserPasswordL( const TDesC& aPassword ) |
|
328 { |
|
329 iBody->SetHTTPProxyUserPasswordL( aPassword ); |
|
330 } |
|
331 |
|
332 |
|
333 // ----------------------------------------------------------------------------- |
|
334 // CIMPSSAPSettings::SetAccessPoint() |
|
335 // ----------------------------------------------------------------------------- |
|
336 // |
|
337 EXPORT_C TInt CIMPSSAPSettings::SetAccessPoint( TUint32 aAP ) |
|
338 { |
|
339 return iBody->SetAccessPoint( aAP ); |
|
340 } |
|
341 |
|
342 |
|
343 // ----------------------------------------------------------------------------- |
|
344 // CIMPSSAPSettings::SetClientIdL() |
|
345 // ----------------------------------------------------------------------------- |
|
346 // |
|
347 EXPORT_C void CIMPSSAPSettings::SetClientIdL( const TDesC& aClientId ) |
|
348 { |
|
349 iBody->SetClientIdL( aClientId ); |
|
350 } |
|
351 |
|
352 // ----------------------------------------------------------------------------- |
|
353 // CIMPSSAPSettings::SetServerAuthenticationNameL() |
|
354 // ----------------------------------------------------------------------------- |
|
355 // |
|
356 EXPORT_C void CIMPSSAPSettings::SetServerAuthenticationNameL( const TDesC& aClientId ) |
|
357 { |
|
358 iBody->SetServerAuthenticationNameL( aClientId ); |
|
359 } |
|
360 |
|
361 // ----------------------------------------------------------------------------- |
|
362 // CIMPSSAPSettings::SetServerAuthenticationPasswordL() |
|
363 // ----------------------------------------------------------------------------- |
|
364 // |
|
365 EXPORT_C void CIMPSSAPSettings::SetServerAuthenticationPasswordL( const TDesC& aClientId ) |
|
366 { |
|
367 iBody->SetServerAuthenticationPasswordL( aClientId ); |
|
368 } |
|
369 |
|
370 // ----------------------------------------------------------------------------- |
|
371 // CIMPSSAPSettings::SetServerAcceptedContentTypeL() |
|
372 // ----------------------------------------------------------------------------- |
|
373 // |
|
374 EXPORT_C void CIMPSSAPSettings::SetServerAcceptedContentTypeL( const TDesC& aClientId ) |
|
375 { |
|
376 iBody->SetServerAcceptedContentTypeL( aClientId ); |
|
377 } |
|
378 |
|
379 // ----------------------------------------------------------------------------- |
|
380 // CIMPSSAPSettings::SetHighLevelServices() |
|
381 // ----------------------------------------------------------------------------- |
|
382 // |
|
383 EXPORT_C TInt CIMPSSAPSettings::SetHighLevelServices( TUint32 aServices ) |
|
384 { |
|
385 return iBody->SetHighLevelServices( aServices ); |
|
386 } |
|
387 |
|
388 // ----------------------------------------------------------------------------- |
|
389 // CIMPSSAPSettings::SetAuthorizationMode() |
|
390 // ----------------------------------------------------------------------------- |
|
391 // |
|
392 EXPORT_C TInt CIMPSSAPSettings::SetAuthorizationMode( TUint32 aMode ) |
|
393 { |
|
394 return iBody->SetAuthorizationMode( aMode ); |
|
395 } |
|
396 |
|
397 // ----------------------------------------------------------------------------- |
|
398 // CIMPSSAPSettings::ProtectL() |
|
399 // Protection setters/getters. |
|
400 // ----------------------------------------------------------------------------- |
|
401 // |
|
402 EXPORT_C void CIMPSSAPSettings::ProtectL( TIMPSSAPProtection aProtection ) |
|
403 { |
|
404 iBody->ProtectL( aProtection ); |
|
405 } |
|
406 |
|
407 |
|
408 // ----------------------------------------------------------------------------- |
|
409 // CIMPSSAPSettings::Protection() |
|
410 // Protection setters/getters. |
|
411 // ----------------------------------------------------------------------------- |
|
412 // |
|
413 EXPORT_C TIMPSSAPProtection CIMPSSAPSettings::Protection() const |
|
414 { |
|
415 return iBody->Protection(); |
|
416 } |
|
417 |
|
418 |
|
419 // ----------------------------------------------------------------------------- |
|
420 // CIMPSSAPSettings::IncreaseLoginCoun() |
|
421 // Utility method. |
|
422 // ----------------------------------------------------------------------------- |
|
423 // |
|
424 EXPORT_C void CIMPSSAPSettings::IncreaseLoginCount() |
|
425 { |
|
426 iBody->IncreaseLoginCount(); |
|
427 } |
|
428 |
|
429 |
|
430 |
|
431 // ----------------------------------------------------------------------------- |
|
432 // CIMPSSAPSettings::LoginCount() |
|
433 // Utility method. |
|
434 // ----------------------------------------------------------------------------- |
|
435 // |
|
436 EXPORT_C TUint32 CIMPSSAPSettings::LoginCount() const |
|
437 { |
|
438 return iBody->LoginCount(); |
|
439 } |
|
440 |
|
441 // ----------------------------------------------------------------------------- |
|
442 // CIMPSSAPSettings::SetOpaqueInt() |
|
443 // Key-value pairs. |
|
444 // ----------------------------------------------------------------------------- |
|
445 // |
|
446 EXPORT_C TInt CIMPSSAPSettings::SetOpaqueInt( const TDesC& aKey, TInt aValue ) |
|
447 { |
|
448 __ASSERT_ALWAYS( aKey.Find( KKeyValuePairFieldSeparator ) == KErrNotFound, |
|
449 Panic( EIMPSInvalidKeyValue ) ); |
|
450 |
|
451 TInt err = iKeyValuePairs->SetValueInt( aKey, aValue ); |
|
452 if ( err == KErrNone ) |
|
453 { |
|
454 iBody->DoResetLoginCount(); |
|
455 } |
|
456 return err; |
|
457 } |
|
458 |
|
459 |
|
460 // ----------------------------------------------------------------------------- |
|
461 // CIMPSSAPSettings::SetOpaqueDesC8() |
|
462 // Key-value pairs. |
|
463 // ----------------------------------------------------------------------------- |
|
464 // |
|
465 EXPORT_C TInt CIMPSSAPSettings::SetOpaqueDesC8( const TDesC& aKey, |
|
466 const TDesC8& aValue ) |
|
467 { |
|
468 __ASSERT_ALWAYS( aKey.Find( KKeyValuePairFieldSeparator ) == KErrNotFound, |
|
469 Panic( EIMPSInvalidKeyValue ) ); |
|
470 |
|
471 TInt err = iKeyValuePairs->SetValueDesC8( aKey, aValue ); |
|
472 if ( err == KErrNone ) |
|
473 { |
|
474 iBody->DoResetLoginCount(); |
|
475 } |
|
476 return err; |
|
477 } |
|
478 |
|
479 |
|
480 // ----------------------------------------------------------------------------- |
|
481 // CIMPSSAPSettings::SetOpaqueDesC16() |
|
482 // Key-value pairs. |
|
483 // ----------------------------------------------------------------------------- |
|
484 // |
|
485 EXPORT_C TInt CIMPSSAPSettings::SetOpaqueDesC16( const TDesC& aKey, |
|
486 const TDesC16& aValue ) |
|
487 { |
|
488 __ASSERT_ALWAYS( aKey.Find( KKeyValuePairFieldSeparator ) == KErrNotFound, |
|
489 Panic( EIMPSInvalidKeyValue ) ); |
|
490 |
|
491 TInt err = iKeyValuePairs->SetValueDesC16( aKey, aValue ); |
|
492 if ( err == KErrNone ) |
|
493 { |
|
494 iBody->DoResetLoginCount(); |
|
495 } |
|
496 return err; |
|
497 } |
|
498 |
|
499 |
|
500 // ----------------------------------------------------------------------------- |
|
501 // CIMPSSAPSettings::GetOpaqueInt() |
|
502 // Key-value pairs. |
|
503 // ----------------------------------------------------------------------------- |
|
504 // |
|
505 EXPORT_C TInt CIMPSSAPSettings::GetOpaqueInt( const TDesC& aKey, TInt& aValue ) const |
|
506 { |
|
507 return iKeyValuePairs->GetValueInt( aKey, aValue ); |
|
508 } |
|
509 |
|
510 |
|
511 // ----------------------------------------------------------------------------- |
|
512 // CIMPSSAPSettings::GetOpaqueDesC8() |
|
513 // Key-value pairs. |
|
514 // ----------------------------------------------------------------------------- |
|
515 // |
|
516 EXPORT_C TInt CIMPSSAPSettings::GetOpaqueDesC8( const TDesC& aKey, TPtrC8& aValue ) const |
|
517 { |
|
518 return iKeyValuePairs->GetValueDesC8( aKey, aValue ); |
|
519 } |
|
520 |
|
521 |
|
522 // ----------------------------------------------------------------------------- |
|
523 // CIMPSSAPSettings::GetOpaqueDesC16() |
|
524 // Key-value pairs. |
|
525 // ----------------------------------------------------------------------------- |
|
526 // |
|
527 EXPORT_C TInt CIMPSSAPSettings::GetOpaqueDesC16( const TDesC& aKey, |
|
528 TPtrC16& aValue ) const |
|
529 { |
|
530 return iKeyValuePairs->GetValueDesC16( aKey, aValue ); |
|
531 } |
|
532 |
|
533 // ----------------------------------------------------------------------------- |
|
534 // CIMPSSAPSettings::DeleteOpaque() |
|
535 // Key-value pairs. |
|
536 // ----------------------------------------------------------------------------- |
|
537 // |
|
538 EXPORT_C TInt CIMPSSAPSettings::DeleteOpaque( const TDesC& aKey ) |
|
539 { |
|
540 return iKeyValuePairs->DeletePair( aKey ); |
|
541 } |
|
542 |
|
543 |
|
544 // ----------------------------------------------------------------------------- |
|
545 // CIMPSSAPSettings::EqualConnectionSettings() |
|
546 // ----------------------------------------------------------------------------- |
|
547 // |
|
548 EXPORT_C TBool CIMPSSAPSettings::EqualConnectionSettings( const CIMPSSAPSettings& aOther ) const |
|
549 { |
|
550 return iBody->EqualConnectionSettings( aOther.Body() ); |
|
551 } |
|
552 |
|
553 |
|
554 // ----------------------------------------------------------------------------- |
|
555 // CIMPSSAPSettings::EqualUserSettings() |
|
556 // ----------------------------------------------------------------------------- |
|
557 // |
|
558 EXPORT_C TBool CIMPSSAPSettings::EqualUserSettings( const CIMPSSAPSettings& aOther ) const |
|
559 { |
|
560 return iBody->EqualUserSettings( aOther.Body() ); |
|
561 } |
|
562 |
|
563 |
|
564 // ----------------------------------------------------------------------------- |
|
565 // CIMPSSAPSettings::Reset() |
|
566 // Utility method. |
|
567 // ----------------------------------------------------------------------------- |
|
568 // |
|
569 EXPORT_C void CIMPSSAPSettings::Reset() |
|
570 { |
|
571 iBody->Reset(); |
|
572 iKeyValuePairs->Reset(); |
|
573 } |
|
574 |
|
575 |
|
576 // ----------------------------------------------------------------------------- |
|
577 // CIMPSSAPSettings::CopyL() |
|
578 // ----------------------------------------------------------------------------- |
|
579 // |
|
580 EXPORT_C void CIMPSSAPSettings::CopyL( const CIMPSSAPSettings& aSource ) |
|
581 { |
|
582 IMPSSAPObjectHandler::CopyL( aSource.Body(), *iBody ); |
|
583 IMPSSAPObjectHandler::CopyL( *aSource.iKeyValuePairs, *iKeyValuePairs ); |
|
584 } |
|
585 |
|
586 // ----------------------------------------------------------------------------- |
|
587 // CIMPSSAPSettings::AccessGroup() |
|
588 // ----------------------------------------------------------------------------- |
|
589 // |
|
590 |
|
591 EXPORT_C TIMPSAccessGroup CIMPSSAPSettings::AccessGroup() const |
|
592 { |
|
593 return iBody->AccessGroup(); |
|
594 } |
|
595 |
|
596 // ----------------------------------------------------------------------------- |
|
597 // CIMPSSAPSettings::SetAccessGroup() |
|
598 // ----------------------------------------------------------------------------- |
|
599 // |
|
600 EXPORT_C void CIMPSSAPSettings::SetAccessGroup( TIMPSAccessGroup aGroup ) |
|
601 { |
|
602 iBody->DoSetAccessGroup( aGroup ); |
|
603 } |
|
604 |
|
605 // ----------------------------------------------------------------------------- |
|
606 // CIMPSSAPSettings::AuthorizationMode() |
|
607 // ----------------------------------------------------------------------------- |
|
608 // |
|
609 |
|
610 EXPORT_C TUint32 CIMPSSAPSettings::AuthorizationMode() const |
|
611 { |
|
612 return iBody->AuthorizationMode(); |
|
613 } |
|
614 |
|
615 // ----------------------------------------------------------------------------- |
|
616 // CIMPSSAPSettings::ExternalizeL() |
|
617 // Streaming support |
|
618 // ----------------------------------------------------------------------------- |
|
619 // |
|
620 EXPORT_C void CIMPSSAPSettings::ExternalizeL( RWriteStream& aStream ) const |
|
621 { |
|
622 IMPSSAPObjectHandler::ExternalizeL( *iBody, aStream ); |
|
623 IMPSSAPObjectHandler::ExternalizeL( *iKeyValuePairs, aStream ); |
|
624 } |
|
625 |
|
626 |
|
627 |
|
628 // ----------------------------------------------------------------------------- |
|
629 // CIMPSSAPSettings::InternalizeL() |
|
630 // Streaming support |
|
631 // ----------------------------------------------------------------------------- |
|
632 // |
|
633 EXPORT_C void CIMPSSAPSettings::InternalizeL( RReadStream& aStream ) |
|
634 { |
|
635 IMPSSAPObjectHandler::InternalizeL( *iBody, aStream ); |
|
636 IMPSSAPObjectHandler::InternalizeL( *iKeyValuePairs, aStream ); |
|
637 } |
|
638 |
|
639 |
|
640 // ----------------------------------------------------------------------------- |
|
641 // CIMPSSAPSettings::DataSize() |
|
642 // Streaming support |
|
643 // ----------------------------------------------------------------------------- |
|
644 // |
|
645 EXPORT_C TInt CIMPSSAPSettings::DataSize() const |
|
646 { |
|
647 return IMPSSAPObjectHandler::DataSize( *iBody ) + |
|
648 IMPSSAPObjectHandler::DataSize( *iKeyValuePairs ); |
|
649 } |
|
650 |
|
651 // ----------------------------------------------------------------------------- |
|
652 // CIMPSSAPSettings::PackLC() |
|
653 // ----------------------------------------------------------------------------- |
|
654 // |
|
655 |
|
656 EXPORT_C HBufC8* CIMPSSAPSettings::PackLC() const |
|
657 { |
|
658 HBufC8* packBuffer = HBufC8::NewLC( DataSize() ); |
|
659 TPtr8 pack( packBuffer->Des() ); |
|
660 |
|
661 RDesWriteStream ws; |
|
662 ws.Open( pack ); // CSI: 65 # |
|
663 // This Open() returns void |
|
664 CleanupClosePushL( ws ); |
|
665 |
|
666 ExternalizeL( ws ); |
|
667 |
|
668 ws.CommitL(); |
|
669 CleanupStack::PopAndDestroy(); //ws |
|
670 |
|
671 packBuffer = packBuffer->ReAllocL( packBuffer->Length() ); |
|
672 CleanupStack::Pop(); |
|
673 CleanupStack::PushL( packBuffer ); //Due realloc |
|
674 |
|
675 return packBuffer; |
|
676 } |
|
677 |
|
678 // ----------------------------------------------------------------------------- |
|
679 // CIMPSSAPSettings::UnPackL() |
|
680 // ----------------------------------------------------------------------------- |
|
681 // |
|
682 EXPORT_C void CIMPSSAPSettings::UnPackL( const TDesC8& aPackage ) |
|
683 { |
|
684 RDesReadStream rs; |
|
685 rs.Open( aPackage ); // CSI: 65 # |
|
686 // This Open() returns void |
|
687 CleanupClosePushL( rs ); |
|
688 |
|
689 InternalizeL( rs ); |
|
690 |
|
691 CleanupStack::PopAndDestroy(); //rs |
|
692 } |
|
693 |
|
694 // ----------------------------------------------------------------------------- |
|
695 // CIMPSSAPSettings::Body() |
|
696 // ----------------------------------------------------------------------------- |
|
697 // |
|
698 CIMPSSAPSettingsBody& CIMPSSAPSettings::Body() |
|
699 { |
|
700 return *iBody; |
|
701 } |
|
702 |
|
703 const CIMPSSAPSettingsBody& CIMPSSAPSettings::Body() const |
|
704 { |
|
705 return *iBody; |
|
706 } |
|
707 |
|
708 // ----------------------------------------------------------------------------- |
|
709 // CIMPSSAPSettings::KeyValuePairs() |
|
710 // ----------------------------------------------------------------------------- |
|
711 // |
|
712 CIMPSSAPKeyValuePairs& CIMPSSAPSettings::KeyValuePairs() |
|
713 { |
|
714 return *iKeyValuePairs; |
|
715 } |
|
716 |
|
717 const CIMPSSAPKeyValuePairs& CIMPSSAPSettings::KeyValuePairs() const |
|
718 { |
|
719 return *iKeyValuePairs; |
|
720 } |
|
721 |
|
722 |
|
723 |
|
724 // End of File |
|
725 |