1 sipextensionheader.h |
1 /* |
|
2 * Copyright (c) 2004-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Name : sipextensionheader.h |
|
16 * Part of : SIP Codec |
|
17 * Interface : SDK API, SIP Codec API |
|
18 * Version : SIP/4.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CSIPEXTENSIONHEADER_H |
|
26 #define CSIPEXTENSIONHEADER_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "sipheaderbase.h" |
|
30 #include "_sipcodecdefs.h" |
|
31 |
|
32 |
|
33 // CLASS DECLARATION |
|
34 /** |
|
35 * @publishedAll |
|
36 * @released |
|
37 * |
|
38 * The class stores unknown and extension headers that are either not |
|
39 * supported by the current SIP codec implementation or not specified in |
|
40 * current SIP RFC or both. |
|
41 * |
|
42 * @lib sipcodec.lib |
|
43 */ |
|
44 class CSIPExtensionHeader : public CSIPHeaderBase |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Creates a new instance of CSIPExtensionHeader |
|
50 * @param aName the full or compact name of the header |
|
51 * @param aValue the value of the header |
|
52 * @return a new instance of CSIPExtensionHeader |
|
53 */ |
|
54 IMPORT_C static CSIPExtensionHeader* |
|
55 NewL(const TDesC8& aName, const TDesC8& aValue); |
|
56 |
|
57 /** |
|
58 * Creates a new instance of CSIPExtensionHeader |
|
59 * and puts it to CleanupStack |
|
60 * @param aName the full or compact name of the header |
|
61 * @param aValue the value of the header |
|
62 * @return a new instance of CSIPExtensionHeader |
|
63 */ |
|
64 IMPORT_C static CSIPExtensionHeader* |
|
65 NewLC(const TDesC8& aName, const TDesC8& aValue); |
|
66 |
|
67 /** |
|
68 * Destructor, deletes the resources of CSIPExtensionHeader. |
|
69 */ |
|
70 IMPORT_C ~CSIPExtensionHeader(); |
|
71 |
|
72 |
|
73 public: // New functions |
|
74 |
|
75 /** |
|
76 * Sets the header value |
|
77 * @param aValue the header value to be set |
|
78 */ |
|
79 IMPORT_C void SetValueL(const TDesC8& aValue); |
|
80 |
|
81 /** |
|
82 * Gets the header value |
|
83 * @return the header value |
|
84 */ |
|
85 IMPORT_C const TDesC8& Value() const; |
|
86 |
|
87 /** |
|
88 * Constructs an instance of a CSIPExtensionHeader from a RReadStream |
|
89 * @param aReadStream a stream containing the value of the |
|
90 * externalized header object (header name not included). |
|
91 * @return an instance of a CSIPExtensionHeader |
|
92 */ |
|
93 |
|
94 IMPORT_C static CSIPExtensionHeader* |
|
95 InternalizeValueL(RReadStream& aReadStream); |
|
96 |
|
97 |
|
98 public: // From CSIPHeaderBase |
|
99 |
|
100 /** |
|
101 * From CSIPHeaderBase CloneL |
|
102 */ |
|
103 IMPORT_C CSIPHeaderBase* CloneL() const; |
|
104 |
|
105 /** |
|
106 * From CSIPHeaderBase Name |
|
107 */ |
|
108 IMPORT_C RStringF Name() const; |
|
109 |
|
110 /** |
|
111 * From CSIPHeaderBase ToTextValueL |
|
112 */ |
|
113 IMPORT_C HBufC8* ToTextValueL() const; |
|
114 |
|
115 /** |
|
116 * From CSIPHeaderBase ExternalizeSupported |
|
117 */ |
|
118 IMPORT_C TBool ExternalizeSupported() const; |
|
119 |
|
120 |
|
121 public: // New functions, for internal use |
|
122 |
|
123 void SetNameL(const TDesC8& aName); |
|
124 |
|
125 public: // From CSIPHeaderBase, for internal use |
|
126 |
|
127 /** |
|
128 * @internalComponent |
|
129 */ |
|
130 TBool IsExtensionHeader() const; |
|
131 |
|
132 /** |
|
133 * @internalComponent |
|
134 */ |
|
135 TBool EncodeMultipleToOneLine() const; |
|
136 |
|
137 /** |
|
138 * @internalComponent |
|
139 */ |
|
140 TBool MoreThanOneAllowed() const; |
|
141 |
|
142 /** |
|
143 * @internalComponent |
|
144 */ |
|
145 TBool HasCompactName() const; |
|
146 |
|
147 /** |
|
148 * @internalComponent |
|
149 */ |
|
150 RStringF CompactName() const; |
|
151 |
|
152 /** |
|
153 * @internalComponent |
|
154 */ |
|
155 TPreferredPlace PreferredPlaceInMessage() const; |
|
156 |
|
157 private: // From CSIPHeaderBase |
|
158 |
|
159 void ExternalizeValueL(RWriteStream& aWriteStream) const; |
|
160 |
|
161 private: // Constructors |
|
162 |
|
163 CSIPExtensionHeader(); |
|
164 void ConstructL(const TDesC8& aName, const TDesC8& aValue); |
|
165 void ConstructL(const CSIPExtensionHeader& aExtensionHeader); |
|
166 void DoInternalizeValueL(RReadStream& aReadStream); |
|
167 |
|
168 private: // New functions |
|
169 |
|
170 TBool CheckValue (const TDesC8& aValue); |
|
171 |
|
172 private: // Data |
|
173 |
|
174 // data |
|
175 RStringF iName; |
|
176 HBufC8* iValue; |
|
177 |
|
178 private: // For testing purposes |
|
179 |
|
180 UNIT_TEST(CSIPExtensionHeaderTest) |
|
181 UNIT_TEST(CSIPHeaderLookupTest) |
|
182 }; |
|
183 |
|
184 #endif // CSIPEXTENSIONHEADER_H |
|
185 |
|
186 // End of File |