|
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 : extensiondescrparam.h |
|
16 * Part of : SIP Profile |
|
17 * Interface : private |
|
18 * Version : 1.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 /** |
|
26 @internalComponent |
|
27 */ |
|
28 |
|
29 #ifndef CEXTENSIONDESCRPARAM_H |
|
30 #define CEXTENSIONDESCRPARAM_H |
|
31 |
|
32 // INCLUDES |
|
33 #include <e32base.h> |
|
34 #include <s32strm.h> |
|
35 |
|
36 // FORWARD DECLARATIONS |
|
37 |
|
38 // CLASS DECLARATION |
|
39 /** |
|
40 * This class represents an extension parameter whose value is a descriptor. |
|
41 */ |
|
42 NONSHARABLE_CLASS(CExtensionDescrParam) : public CBase |
|
43 { |
|
44 public: // Constructors and destructor |
|
45 |
|
46 /** |
|
47 * Constructor |
|
48 */ |
|
49 static CExtensionDescrParam* NewLC(TUint32 aID, const TDesC8& aValue); |
|
50 |
|
51 ~CExtensionDescrParam(); |
|
52 |
|
53 public: // New functions |
|
54 |
|
55 /** |
|
56 * De-serialize parameter from stream |
|
57 * @param aReadStream stream where data is read from |
|
58 */ |
|
59 static CExtensionDescrParam* InternalizeL(RReadStream& aReadStream); |
|
60 |
|
61 /** |
|
62 * Serialize parameter to stream |
|
63 * @param aWriteStream stream where parameter is to be serialized |
|
64 */ |
|
65 void ExternalizeL(RWriteStream& aWriteStream) const; |
|
66 |
|
67 TUint ExternalizedSizeL() const; |
|
68 |
|
69 /** |
|
70 * Compare two parameters |
|
71 * @param aParameter parameter to compare to |
|
72 * @return ETrue if parameters are equal |
|
73 */ |
|
74 TBool operator==(const CExtensionDescrParam& aParam) const; |
|
75 |
|
76 TUint32 ID() const; |
|
77 |
|
78 const TDesC8& Value() const; |
|
79 |
|
80 private: // Constructors |
|
81 |
|
82 CExtensionDescrParam(TUint32 aID); |
|
83 void ConstructL(const TDesC8& aValue); |
|
84 |
|
85 private: // Data |
|
86 |
|
87 TUint32 iID; |
|
88 HBufC8* iValue; // owned |
|
89 |
|
90 private: // For testing purposes |
|
91 |
|
92 #ifdef CPPUNIT_TEST |
|
93 friend class CExtensionDescrParamTest; |
|
94 #endif |
|
95 }; |
|
96 |
|
97 #endif // CEXTENSIONDESCRPARAM_H |