|
1 /* |
|
2 * Copyright (c) 2007-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: |
|
15 * Name : sipconcreteprofile.h |
|
16 * Part of : SIP / SIP Profile Agent / SIP Concrete Profile |
|
17 * Version : %version: 2.1.3 % |
|
18 * |
|
19 */ |
|
20 |
|
21 |
|
22 |
|
23 #ifndef CSIPCONCRETEPROFILE_H |
|
24 #define CSIPCONCRETEPROFILE_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32base.h> |
|
28 #include <badesca.h> |
|
29 #include <s32strm.h> |
|
30 #include <uri8.h> |
|
31 #include <sipprofiletypeinfo.h> |
|
32 |
|
33 // FORWARD DECLARATIONS |
|
34 class CSIPProfileParameter; |
|
35 class TExtensionIntParam; |
|
36 class TExtensionBoolParam; |
|
37 class CExtensionDescrParam; |
|
38 class CExtensionDescrArrayParam; |
|
39 |
|
40 // CLASS DECLARATION |
|
41 /** |
|
42 * @publishedPartner |
|
43 * @released |
|
44 * |
|
45 * A container for SIP profile data for one SIP profile. |
|
46 * Provides functions for setting and getting profile parameters and |
|
47 * serializing the profile data to a write stream and |
|
48 * reading the data from a read stream. |
|
49 * |
|
50 * @lib sipprofile.lib |
|
51 */ |
|
52 class CSIPConcreteProfile : public CBase |
|
53 { |
|
54 public: // Enumerations |
|
55 |
|
56 /** Profile states */ |
|
57 enum TStatus |
|
58 { |
|
59 /** Unregistered */ |
|
60 EUnregistered = 1, |
|
61 /** Unregistration in progress*/ |
|
62 EUnregistrationInProgress, |
|
63 /** Registration is in progress */ |
|
64 ERegistrationInProgress, |
|
65 /** Registered */ |
|
66 ERegistered |
|
67 }; |
|
68 |
|
69 public: // Constructors and destructor |
|
70 |
|
71 /** |
|
72 * Constructs an object of type CSIPConcreteProfile. |
|
73 * @return new instance |
|
74 */ |
|
75 IMPORT_C static CSIPConcreteProfile* NewL(); |
|
76 |
|
77 /** |
|
78 * Constructs an object of type CSIPConcreteProfile |
|
79 * and adds a pointer to it to the cleanup stack. |
|
80 * @return new instance |
|
81 */ |
|
82 IMPORT_C static CSIPConcreteProfile* NewLC(); |
|
83 |
|
84 /** |
|
85 * Clones profile. All non-dynamic values except profile id are copied. |
|
86 * @return new instance, the ownership is transferred |
|
87 */ |
|
88 IMPORT_C CSIPConcreteProfile* CloneL() const; |
|
89 |
|
90 /** |
|
91 * Clones profile. All values are copied. |
|
92 * @return new instance, the ownership is transferred |
|
93 */ |
|
94 IMPORT_C CSIPConcreteProfile* CloneWithDynamicValuesL() const; |
|
95 |
|
96 /** |
|
97 * Destructor. |
|
98 */ |
|
99 IMPORT_C ~CSIPConcreteProfile(); |
|
100 |
|
101 public: // New functions |
|
102 |
|
103 /** |
|
104 * Sets the profile id |
|
105 * @param aProfileId profile id |
|
106 */ |
|
107 IMPORT_C void SetId(TUint32 aProfileId); |
|
108 |
|
109 /** |
|
110 * Gets the profile Id |
|
111 * @return profile Id |
|
112 */ |
|
113 IMPORT_C TUint32 Id() const; |
|
114 |
|
115 /* |
|
116 * Sets the profile type |
|
117 * @param aProfileType the type of the profile |
|
118 */ |
|
119 IMPORT_C void SetProfileType(const TSIPProfileTypeInfo& aProfileType); |
|
120 |
|
121 /** |
|
122 * Gets profile type. |
|
123 * @return profile type |
|
124 */ |
|
125 IMPORT_C const TSIPProfileTypeInfo& ProfileType() const; |
|
126 |
|
127 /** |
|
128 * Sets the provider's name |
|
129 * @param aProviderName provider's name |
|
130 */ |
|
131 IMPORT_C void SetProviderNameL(const TDesC8& aProviderName); |
|
132 |
|
133 /** |
|
134 * Gets the provider's name |
|
135 * @return provider's name, KNullDesC8 if not defined |
|
136 */ |
|
137 IMPORT_C const TDesC8& ProviderName() const; |
|
138 |
|
139 /** |
|
140 * Sets the IAP ID for the connection |
|
141 * @param aIapId a IAP ID |
|
142 */ |
|
143 IMPORT_C void SetIapId(TUint32 aIapId); |
|
144 |
|
145 /** |
|
146 * Gets the IAP ID used by the profile |
|
147 * @return IAP ID |
|
148 */ |
|
149 IMPORT_C TUint32 IapId() const; |
|
150 |
|
151 /** |
|
152 * Sets the AOR (public user identity) used for the profile |
|
153 * @aAOR AORs to bet set |
|
154 */ |
|
155 IMPORT_C void SetAORL(const TDesC8& aAOR); |
|
156 |
|
157 /** |
|
158 * Gets the AOR (public user identity) used for the profile |
|
159 * @return the AOR |
|
160 */ |
|
161 IMPORT_C const TDesC8& AOR() const; |
|
162 |
|
163 /** |
|
164 * Gets the AOR used for the profile parsed as a URI |
|
165 * @return the AOR as a URI |
|
166 */ |
|
167 IMPORT_C const TUriC8& AORUri8() const; |
|
168 |
|
169 /** |
|
170 * Enables/disables the usage of SigComp |
|
171 * @param aOn ETrue enables SigComp for the profile, |
|
172 * EFalse disables it |
|
173 */ |
|
174 IMPORT_C void EnableSigComp(TBool aOn=ETrue); |
|
175 |
|
176 /** |
|
177 * Checks if the profile uses SigComp |
|
178 * @return ETrue if it uses, EFalse if not |
|
179 */ |
|
180 IMPORT_C TBool IsSigCompEnabled() const; |
|
181 |
|
182 /** |
|
183 * Enables/disables the usage of security negotiation |
|
184 * @param aOn ETrue enables security negotiation for the |
|
185 * profile, EFalse disables it. |
|
186 */ |
|
187 IMPORT_C void EnableSecurityNegotiation(TBool aOn=ETrue); |
|
188 |
|
189 /** |
|
190 * Checks if the profile uses SIP security negotiation |
|
191 * @return ETrue if it uses, EFalse if not |
|
192 */ |
|
193 IMPORT_C TBool IsSecurityNegotiationEnabled() const; |
|
194 |
|
195 /** |
|
196 * Enables/disables auto registration |
|
197 * @param aOn ETrue enables profile auto-registration, |
|
198 * EFalse disables it. |
|
199 */ |
|
200 IMPORT_C void SetAutoRegistrationEnabled(TBool aOn=ETrue); |
|
201 |
|
202 /** |
|
203 * Checks if the profile is marked for auto-registration |
|
204 * @return ETrue if marked, EFalse otherwise |
|
205 */ |
|
206 IMPORT_C TBool IsAutoRegistrationEnabled() const; |
|
207 |
|
208 /** |
|
209 * Sets the server's URI |
|
210 * @param aServer the type of the server |
|
211 * @param aURI a server address as a URI |
|
212 */ |
|
213 IMPORT_C void SetServerL( |
|
214 TUint32 aServer, |
|
215 const TDesC8& aURI); |
|
216 |
|
217 /** |
|
218 * Gets the server's URI |
|
219 * @param aServer the type of the server |
|
220 * @return server's URI, KNullDesC8 if not defined |
|
221 */ |
|
222 IMPORT_C const TDesC8& Server(TUint32 aServer) const; |
|
223 |
|
224 /** |
|
225 * Sets a server's parameter |
|
226 * @param aServer the type of the server |
|
227 * @param aServerParam the type of the parameter |
|
228 * @param aValue parameter's value |
|
229 */ |
|
230 IMPORT_C void SetServerParameterL( |
|
231 TUint32 aServer, |
|
232 TUint32 aServerParam, |
|
233 const TDesC8& aValue); |
|
234 |
|
235 /** |
|
236 * Gets a server's parameter |
|
237 * @param aServer the type of the server |
|
238 * @param aServerParam the type of the parameter |
|
239 * @return parameter's value, KNullDesC8 if not defined |
|
240 */ |
|
241 IMPORT_C const TDesC8& ServerParameter( |
|
242 TUint32 aServer, |
|
243 TUint32 aServerParam) const; |
|
244 |
|
245 /** |
|
246 * Sets a server's extension parameter |
|
247 * @param aServer the type of the server |
|
248 * @param aName the parameter's name |
|
249 * @param aValue parameter's value |
|
250 */ |
|
251 IMPORT_C void SetServerExtensionParameterL( |
|
252 TUint32 aServer, |
|
253 const TDesC8& aName, |
|
254 const TDesC8& aValue); |
|
255 |
|
256 /** |
|
257 * Gets a server's extension parameter |
|
258 * @param aServer the type of the server |
|
259 * @param aName the parameter's name |
|
260 * @return parameter's value, KNullDesC8 if not defined |
|
261 */ |
|
262 IMPORT_C const TDesC8& ServerExtensionParameter( |
|
263 TUint32 aServer, |
|
264 const TDesC8& aName) const; |
|
265 |
|
266 /** |
|
267 * Sets Contact-header parameters for the profile. |
|
268 * Each array element contains one parameter. |
|
269 * @param aParams parameters to set |
|
270 */ |
|
271 IMPORT_C void SetContactHeaderParamsL(const MDesC8Array& aParams); |
|
272 |
|
273 /** |
|
274 * Gets all the Contact-header params defined for the profile. |
|
275 * Each array element contains one parameter. |
|
276 * @return array of Contact-header parameters |
|
277 */ |
|
278 IMPORT_C const MDesC8Array& ContactHeaderParams() const; |
|
279 |
|
280 /** |
|
281 * Sets extra SIP headers for the profile. |
|
282 * Each array element contains one header including |
|
283 * the name and the value, for example "HeaderName: value". |
|
284 * @param aParams parameters to set |
|
285 */ |
|
286 IMPORT_C void SetSIPHeadersL(const MDesC8Array& aHeaders); |
|
287 |
|
288 /** |
|
289 * Gets all extra SIP headers defined for the profile. |
|
290 * Each array element contains one header including |
|
291 * the name and the value, for example "HeaderName: value". |
|
292 * @return array of params |
|
293 */ |
|
294 IMPORT_C const MDesC8Array& SIPHeaders() const; |
|
295 |
|
296 /** |
|
297 * Sets the user's private identity |
|
298 * @param aPrivateIdentity user's private identity |
|
299 */ |
|
300 IMPORT_C void SetPrivateIdentityL( |
|
301 const TDesC8& aPrivateIdentity); |
|
302 |
|
303 /** |
|
304 * Gets the user private identity |
|
305 * @return user's private identity, KNullDesC8 if not defined |
|
306 */ |
|
307 IMPORT_C const TDesC8& PrivateIdentity() const; |
|
308 |
|
309 /** |
|
310 * Sets an extension parameter of type TUint32. |
|
311 * @param aID parameter identifier |
|
312 * @param aValue parameter value |
|
313 */ |
|
314 IMPORT_C void SetExtensionParameterL( |
|
315 TUint32 aID, |
|
316 TUint32 aValue); |
|
317 |
|
318 /** |
|
319 * Gets an extension parameter of type TUint32. |
|
320 * @param aID parameter identifier |
|
321 * @param aParam OUT: parameter's value, if found. |
|
322 * @return KErrNone If parameter value was retrieved |
|
323 * KErrNotFound If no such parameter exists |
|
324 */ |
|
325 IMPORT_C TInt ExtensionParameter( |
|
326 TUint aID, |
|
327 TUint32& aValue) const; |
|
328 |
|
329 /** |
|
330 * Sets an extension parameter of type TBool. |
|
331 * @param aID parameter identifier |
|
332 * @param aValue parameter value |
|
333 */ |
|
334 IMPORT_C void SetExtensionParameterL( |
|
335 TUint32 aID, |
|
336 TBool aValue); |
|
337 |
|
338 /** |
|
339 * Gets an extension parameter of type TBool. |
|
340 * @param aID parameter identifier |
|
341 * @param aParam OUT: parameter's value, if found. |
|
342 * @return KErrNone If parameter value was retrieved |
|
343 * KErrNotFound If no such parameter exists |
|
344 */ |
|
345 IMPORT_C TInt ExtensionParameter( |
|
346 TUint aID, |
|
347 TBool& aValue) const; |
|
348 |
|
349 /** |
|
350 * Sets an extension parameter that is of descriptor type. |
|
351 * Empty descriptor removes the parameter. |
|
352 * @param aID parameter identifier |
|
353 * @param aValue parameter value |
|
354 */ |
|
355 IMPORT_C void SetExtensionParameterL( |
|
356 TUint32 aID, |
|
357 const TDesC8& aValue); |
|
358 |
|
359 /** |
|
360 * Gets an extension parameter that is of descriptor type. |
|
361 * @param aID parameter identifier |
|
362 * @param aParam OUT: parameter's value, if found. |
|
363 * @return KErrNone If parameter value was retrieved |
|
364 * KErrNotFound If no such parameter exists |
|
365 */ |
|
366 IMPORT_C TInt ExtensionParameter( |
|
367 TUint aID, |
|
368 TDesC8 const *& aValue) const; |
|
369 |
|
370 /** |
|
371 * Sets an extension parameters that is of descriptor array type. |
|
372 * @param aID parameter identifier |
|
373 * @param aValue parameter value |
|
374 */ |
|
375 IMPORT_C void SetExtensionParameterL( |
|
376 TUint32 aID, |
|
377 const MDesC8Array& aValue); |
|
378 |
|
379 /** |
|
380 * Gets an extension parameter that is of descriptor array type. |
|
381 * @param aID parameter identifier |
|
382 * @param aParam OUT: parameter's value, if found. |
|
383 * @return KErrNone If parameter value was retrieved |
|
384 * KErrNotFound If no such parameter exists |
|
385 */ |
|
386 IMPORT_C TInt ExtensionParameter( |
|
387 TUint aID, |
|
388 MDesC8Array const *& aValue) const; |
|
389 |
|
390 /** |
|
391 * Deserializes the profile from the stream |
|
392 * @param aReadStream stream holding serialized profile |
|
393 * @param aAll ETrue, if all values deserialized, |
|
394 * EFalse, if only non-dynamic values |
|
395 * @return new instance, the ownership is transferred |
|
396 */ |
|
397 IMPORT_C static CSIPConcreteProfile* InternalizeL( |
|
398 RReadStream& aReadStream, |
|
399 TBool aAll = ETrue); |
|
400 |
|
401 /** |
|
402 * Gets the size of the serialized profile |
|
403 * @param aAll ETrue, if all values serialized, |
|
404 * EFalse, if only non-dynamic values |
|
405 * @return size needed to serialize profile |
|
406 */ |
|
407 IMPORT_C TUint ExternalizedSizeL(TBool aAll = ETrue) const; |
|
408 |
|
409 /** |
|
410 * Serializes the profile to the stream |
|
411 * @param aWriteStream stream where profile is to be serialized |
|
412 * @param aAll ETrue, if all values serialized, |
|
413 * EFalse, if only non-dynamic values |
|
414 */ |
|
415 IMPORT_C void ExternalizeL( |
|
416 RWriteStream& aWriteStream, |
|
417 TBool aAll = ETrue) const; |
|
418 |
|
419 /** |
|
420 * Sets/resets the profile to be the default one. |
|
421 * @param aOn ETrue sets the profile as default, |
|
422 * EFalse removes the setting |
|
423 */ |
|
424 IMPORT_C void SetDefault(TBool aOn=ETrue); |
|
425 |
|
426 /** |
|
427 * Checks if the profile is the default one |
|
428 * @return ETrue if the profile is the default one, EFalse if not |
|
429 */ |
|
430 IMPORT_C TBool IsDefault() const; |
|
431 |
|
432 /** |
|
433 * Sets the negotiated security mechanism in use |
|
434 * @param aMechanism negotiated security mechanism |
|
435 */ |
|
436 IMPORT_C void SetNegotiatedSecurityMechanismL(const TDesC8& aMechanism); |
|
437 |
|
438 /** |
|
439 * Gets the negotiated security mechanism |
|
440 * @return negotiated security mechanism |
|
441 */ |
|
442 IMPORT_C const TDesC8& NegotiatedSecurityMechanism() const; |
|
443 |
|
444 /** |
|
445 * Sets the dynamic proxy address in use. |
|
446 * Dynamic proxy address is discovered on run-time, |
|
447 * for eaxmple using DHCP. |
|
448 * @param aDynamicProxy proxy address |
|
449 */ |
|
450 IMPORT_C void SetDynamicProxyL(const TDesC8& aDynamicProxy); |
|
451 |
|
452 /** |
|
453 * Gets the dynamic proxy address in use. |
|
454 * Dynamic proxy address is discovered on run-time, |
|
455 * for eaxmple using DHCP. |
|
456 * @return proxy address in use |
|
457 */ |
|
458 IMPORT_C const TDesC8& DynamicProxy() const; |
|
459 |
|
460 /** |
|
461 * Sets dynamically registered AORs for the profile |
|
462 * @param aAORs AORs to set |
|
463 */ |
|
464 IMPORT_C void SetRegisteredAORsL(const MDesC8Array& aAORs); |
|
465 |
|
466 /** |
|
467 * Gets dynamically registered AORs defined for the profile |
|
468 * @return array of AORs |
|
469 */ |
|
470 IMPORT_C const MDesC8Array& RegisteredAORs() const; |
|
471 |
|
472 /** |
|
473 * Deserialize registered AORs into profile from stream |
|
474 * @param aReadStream stream holding serialized profile |
|
475 */ |
|
476 IMPORT_C void InternalizeRegisteredAORsL(RReadStream& aReadStream); |
|
477 |
|
478 /** |
|
479 * Serialize registered AORs from profile to stream |
|
480 * @param aWriteStream stream where profile is to be serialized |
|
481 */ |
|
482 IMPORT_C void ExternalizeRegisteredAORsL( |
|
483 RWriteStream& aWriteStream) const; |
|
484 |
|
485 /** |
|
486 * Get size of serialized registered AORs from profile |
|
487 * @return size needed to serialize profile |
|
488 */ |
|
489 IMPORT_C TUint ExternalizedRegisteredAORsSizeL() const; |
|
490 |
|
491 /** |
|
492 * Sets the status of the profile |
|
493 * @param aStatus status of the profile |
|
494 */ |
|
495 IMPORT_C void SetStatus(CSIPConcreteProfile::TStatus aStatus); |
|
496 |
|
497 /** |
|
498 * Gets the status of the profile |
|
499 * @return status of the profile |
|
500 */ |
|
501 IMPORT_C CSIPConcreteProfile::TStatus Status() const; |
|
502 |
|
503 /** |
|
504 * Sets the internal registration context id of the profile. |
|
505 * In practice this is the value of MSIPRegistrationContext::ContextId() |
|
506 * for a CSIPRegistrationBinding related to the profile. |
|
507 * @param aId context id |
|
508 */ |
|
509 IMPORT_C void SetContextId(TUint32 aId); |
|
510 |
|
511 /** |
|
512 * Gets the internal registration context id of the profile. |
|
513 * In practice this is the value of MSIPRegistrationContext::ContextId() |
|
514 * for a CSIPRegistrationBinding related to the profile. |
|
515 * @return context id |
|
516 */ |
|
517 IMPORT_C TUint32 ContextId() const; |
|
518 |
|
519 /** |
|
520 * Sets last occurred error during registration |
|
521 * @param aError occurred error code |
|
522 */ |
|
523 IMPORT_C void SetLastRegistrationError(TInt aError); |
|
524 |
|
525 /** |
|
526 * Gets last occurred error during registration |
|
527 * @return last occurred error code, KErrNone if no error |
|
528 */ |
|
529 IMPORT_C TInt LastRegistrationError() const; |
|
530 |
|
531 /** |
|
532 * Sets the profile enabled |
|
533 * @param aIsEnabled ETrue if profile is enabled |
|
534 */ |
|
535 IMPORT_C void SetEnabled(TBool aIsEnabled); |
|
536 |
|
537 /** |
|
538 * Checks whether the profile has been enabled by at least one user. |
|
539 * @return ETrue if the profile has been enabled by at least one user |
|
540 */ |
|
541 IMPORT_C TBool IsEnabled() const; |
|
542 |
|
543 public: // For internal use |
|
544 |
|
545 /** |
|
546 * Sets the storage id used when updating |
|
547 * the profile to permanent storage |
|
548 * @param aId storage id |
|
549 */ |
|
550 IMPORT_C void SetStorageId(TUint32 aId); |
|
551 |
|
552 /** |
|
553 * Gets the storage id used when updating |
|
554 * the profile to permanent storage |
|
555 * @return storage id |
|
556 */ |
|
557 IMPORT_C TUint32 StorageId() const; |
|
558 |
|
559 /** |
|
560 * Gets extension parameter count of type MDesC8Array. |
|
561 * @return parameter count |
|
562 */ |
|
563 IMPORT_C TInt ExtensionDesArrayParameterCount() const; |
|
564 |
|
565 /** |
|
566 * Gets extension parameter count of type TDesC8. |
|
567 * @return parameter count |
|
568 */ |
|
569 IMPORT_C TInt ExtensionDesParameterCount() const; |
|
570 |
|
571 /** |
|
572 * Gets extension parameter count of type TUint32. |
|
573 * @return parameter count |
|
574 */ |
|
575 IMPORT_C TInt ExtensionIntParameterCount() const; |
|
576 |
|
577 /** |
|
578 * Gets the extension parameter |
|
579 * @param aIndex parameter's index in the extension array |
|
580 * @param aID OUT: parameter's identifier, if found |
|
581 * @param aValue OUT: parameter's value, if found |
|
582 * @return KErrNone If parameter value was retrieved |
|
583 * KErrNotFound If no such parameter exists |
|
584 */ |
|
585 IMPORT_C TInt ExtensionParameter( |
|
586 TInt aIndex, |
|
587 TUint& aID, |
|
588 TUint32& aValue) const; |
|
589 |
|
590 |
|
591 /** |
|
592 * Gets extension parameter count of type TBool. |
|
593 * @return parameter count |
|
594 */ |
|
595 IMPORT_C TInt ExtensionBoolParameterCount() const; |
|
596 |
|
597 /** |
|
598 * Gets the extension parameter |
|
599 * @param aIndex parameter's index in the extension array |
|
600 * @param aID OUT: parameter's identifier, if found |
|
601 * @param aValue OUT: parameter's value, if found |
|
602 * @return KErrNone If parameter value was retrieved |
|
603 * KErrNotFound If no such parameter exists |
|
604 */ |
|
605 IMPORT_C TInt ExtensionParameter( |
|
606 TInt aIndex, |
|
607 TUint& aID, |
|
608 TBool& aValue ) const; |
|
609 |
|
610 /** |
|
611 * Gets the extension parameter |
|
612 * @param aIndex parameter's index in the extension array |
|
613 * @param aID OUT: parameter's identifier, if found |
|
614 * @param aValue OUT: parameter's value, if found |
|
615 * @return KErrNone If parameter value was retrieved |
|
616 * KErrNotFound If no such parameter exists |
|
617 */ |
|
618 IMPORT_C TInt ExtensionParameter( |
|
619 TInt aIndex, |
|
620 TUint& aID, |
|
621 MDesC8Array const *& aValue ) const; |
|
622 |
|
623 /** |
|
624 * Gets the extension parameter |
|
625 * @param aIndex parameter's index in the extension array |
|
626 * @param aID OUT: parameter's identifier, if found |
|
627 * @param aValue OUT: parameter's value, if found |
|
628 * @return KErrNone If parameter value was retrieved |
|
629 * KErrNotFound If no such parameter exists |
|
630 */ |
|
631 IMPORT_C TInt ExtensionParameter( |
|
632 TInt aIndex, |
|
633 TUint& aID, |
|
634 TDesC8 const *& aValue ) const; |
|
635 |
|
636 /** |
|
637 * Gets the server extension parameter |
|
638 * @param aServer the type of the server |
|
639 * @param aIndex parameter's index in the extension array |
|
640 * @param aKey OUT: parameter's identifier, if found |
|
641 * @param aValue OUT: parameter's value, if found |
|
642 * @return KErrNone If parameter value was retrieved |
|
643 * KErrNotFound If no such parameter exists |
|
644 */ |
|
645 IMPORT_C TInt ServerExtensionParameter( |
|
646 TUint32 aServer, |
|
647 TInt aIndex, |
|
648 TDesC8 const *& aKey, |
|
649 TDesC8 const *& aValue) const; |
|
650 |
|
651 /** |
|
652 * Gets server extension parameter count |
|
653 * @param aServer the type of the server |
|
654 * @return parameter count |
|
655 */ |
|
656 IMPORT_C TInt ServerExtensionParameterCount( TUint32 aServer) const; |
|
657 |
|
658 /** |
|
659 * Gets the server parameter |
|
660 * @param aServer the type of the server |
|
661 * @param aIndex parameter's index in the extension array |
|
662 * @param aID OUT: parameter's identifier, if found |
|
663 * @param aValue OUT: parameter's value, if found |
|
664 * @return KErrNone If parameter value was retrieved |
|
665 * KErrNotFound If no such parameter exists |
|
666 */ |
|
667 IMPORT_C TInt ServerParameter( |
|
668 TUint32 aServer, |
|
669 TInt aIndex, |
|
670 TUint& aID, |
|
671 TDesC8 const *& aValue) const; |
|
672 |
|
673 /** |
|
674 * Gets server parameter count |
|
675 * @param aServer the type of the server |
|
676 * @return server parameter count |
|
677 */ |
|
678 IMPORT_C TInt ServerParameterCount(TUint32 aServer) const; |
|
679 |
|
680 /** |
|
681 * Validate the profile Parameters on being consistent |
|
682 * @return ETrue if the profile parameters are consistent. |
|
683 */ |
|
684 IMPORT_C TBool ValidateProfileParamsL(); |
|
685 |
|
686 public: // For internal use |
|
687 |
|
688 TBool operator==(const CSIPConcreteProfile& aProfile); |
|
689 |
|
690 TInt32 LastCompareResult() const; |
|
691 |
|
692 static CDesC8ArrayFlat* CopyDesArrayL(const MDesC8Array& aArray); |
|
693 |
|
694 static void ExternalizeDesArrayL(const MDesC8Array& aArray, |
|
695 RWriteStream& aWriteStream); |
|
696 |
|
697 static CDesC8ArrayFlat* InternalizeDesArrayL(RReadStream& aReadStream); |
|
698 |
|
699 enum TComparison |
|
700 { |
|
701 EId = 1, |
|
702 EName = 2, |
|
703 EIAPId = 4, |
|
704 ERegistrar = 8, |
|
705 ERegistrarParameters = 16, |
|
706 ERegistrarExtensionParameters = 32, |
|
707 EOutboundProxy = 64, |
|
708 EOutboundProxyParameters = 128, |
|
709 EOutboundProxyExtensionParameters = 256, |
|
710 EPrivateIdentity = 512, |
|
711 EAOR = 1024, |
|
712 ESigComp = 2048, |
|
713 ESecurityNegotiation = 4096, |
|
714 EAutoRegistration = 8192, |
|
715 ETypeInfo = 16384, |
|
716 EExtensionParameters = 32768, |
|
717 EProxyResolving = 65536, |
|
718 EContactHeaderParams = 131072, |
|
719 ESIPHeaders = 262144 |
|
720 }; |
|
721 |
|
722 private: // Constructors |
|
723 |
|
724 CSIPConcreteProfile(); |
|
725 void ConstructL(); |
|
726 |
|
727 private: // New functions |
|
728 |
|
729 void DoInternalizeL( |
|
730 RReadStream& aReadStream, |
|
731 TBool aAll = ETrue); |
|
732 |
|
733 const TDesC8& Parameter( |
|
734 const RPointerArray<CSIPProfileParameter>* aArray, |
|
735 const TDesC8& aName) const; |
|
736 |
|
737 void SetParameterL( |
|
738 RPointerArray<CSIPProfileParameter>* aArray, |
|
739 const TDesC8& aName, |
|
740 const TDesC8& aValue); |
|
741 |
|
742 TInt IndexOf( |
|
743 const TDesC8& aKey, |
|
744 const RPointerArray<CSIPProfileParameter>* aArray) const; |
|
745 |
|
746 void SetOutboundProxyL(const TDesC8& aOutboundProxy); |
|
747 |
|
748 void SetRegistrarL(const TDesC8& aRegistrar); |
|
749 |
|
750 void InternalizeRegistrarL(RReadStream& aReadStream); |
|
751 |
|
752 void InternalizeProxyL(RReadStream& aReadStream); |
|
753 |
|
754 void InternalizeExtensionParamsL(RReadStream& aReadStream); |
|
755 |
|
756 void CloneExtensionParamsL(CSIPConcreteProfile& aNewObject) const; |
|
757 |
|
758 TInt ExtensionIntParamIndex(TUint32 aID) const; |
|
759 |
|
760 TInt ExtensionBoolParamIndex(TUint32 aID) const; |
|
761 |
|
762 TInt ExtensionDescrParamIndex(TUint32 aID) const; |
|
763 |
|
764 TInt ExtensionDescrArrayParamIndex(TUint32 aID) const; |
|
765 |
|
766 HBufC8* CreateContactUserNameLC() const; |
|
767 |
|
768 TUint8 GetNextBits( |
|
769 const TDesC8& aBuf, |
|
770 TInt aBits, |
|
771 TUint& aCounter) const; |
|
772 |
|
773 /** |
|
774 * Clones profile. |
|
775 * @param aWithDynamicValues Should all values be copied |
|
776 * @return new instance of the profile, the ownership is transferred |
|
777 */ |
|
778 CSIPConcreteProfile* CloneL(TBool aWithDynamicValues) const; |
|
779 |
|
780 /** |
|
781 *Fetch the Snap ID* |
|
782 * @param aValue the SNAP Name |
|
783 * @return SNAP ID |
|
784 */ |
|
785 |
|
786 TUint32 FetchSNAPIDL(const TDesC8& aValue); |
|
787 |
|
788 /** |
|
789 *Fetch IAP ID* |
|
790 * @param aValue the IAP Name |
|
791 * @return IAP ID |
|
792 */ |
|
793 |
|
794 TUint32 FetchIAPIDL(const TDesC8& aValue); |
|
795 |
|
796 |
|
797 |
|
798 private: // Data |
|
799 |
|
800 // Basic data |
|
801 TSIPProfileTypeInfo iSIPProfileType; |
|
802 TUint32 iSIPProfileId; |
|
803 TUint32 iStorageId; |
|
804 TUint32 iSIPIAPId; |
|
805 HBufC8* iSIPProviderName; |
|
806 HBufC8* iSIPPrivateIdentity; |
|
807 CUri8* iSIPAORUri8; |
|
808 TBool iSIPSigComp; |
|
809 TBool iSecurityNegotiation; |
|
810 TBool iSIPAutoRegistered; |
|
811 CDesC8ArrayFlat* iSIPContactHeaderParams; |
|
812 CDesC8ArrayFlat* iSIPHeaders; |
|
813 |
|
814 // Outbound proxy related parameters |
|
815 HBufC8* iSIPOutboundProxy; |
|
816 RPointerArray<CSIPProfileParameter> iSIPOutboundProxyParameter; |
|
817 RPointerArray<CSIPProfileParameter> iSIPOutboundProxyExtParameter; |
|
818 |
|
819 // Registrar related parameters |
|
820 HBufC8* iSIPRegistrar; |
|
821 RPointerArray<CSIPProfileParameter> iSIPRegistrarParameter; |
|
822 RPointerArray<CSIPProfileParameter> iSIPRegistrarExtParameter; |
|
823 |
|
824 // Extension parameters |
|
825 RArray<TExtensionIntParam> iExtensionIntParams; |
|
826 RArray<TExtensionBoolParam> iExtensionBoolParams; |
|
827 RPointerArray<CExtensionDescrParam> iExtensionDescrParams; |
|
828 RPointerArray<CExtensionDescrArrayParam> iExtensionDescrArrayParams; |
|
829 |
|
830 // Dynamic data |
|
831 TBool iDefaultProfile; |
|
832 TBool iIsEnabled; |
|
833 TStatus iStatus; |
|
834 TUint32 iContextId; |
|
835 TInt iLastRegistrationError; |
|
836 TInt32 iLastComparisonResult; |
|
837 TBool iDynamicProxyResolving; |
|
838 HBufC8* iDynamicProxy; |
|
839 HBufC8* iSIPNegotiatedSecurityMechanism; |
|
840 CDesC8ArrayFlat* iSIPRegisteredAORs; |
|
841 |
|
842 private: // For testing purposes |
|
843 #ifdef CPPUNIT_TEST |
|
844 friend class CSIPConcreteProfileTest; |
|
845 #endif |
|
846 }; |
|
847 |
|
848 #endif // CSIPCONCRETEPROFILE_H |