|
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 : sipacceptencodingheader.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 CSIPACCEPTENCODINGHEADER_H |
|
26 #define CSIPACCEPTENCODINGHEADER_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "sipparameterheaderbase.h" |
|
30 #include "_sipcodecdefs.h" |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CSIPAcceptHeaderParams; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * @publishedAll |
|
38 * @released |
|
39 * |
|
40 * Class provides functions for setting and getting media types and |
|
41 * parameters in SIP "Accept-Encoding" header. |
|
42 * |
|
43 * @lib sipcodec.lib |
|
44 */ |
|
45 class CSIPAcceptEncodingHeader : public CSIPParameterHeaderBase |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Constructs a CSIPAcceptEncodingHeader from textual representation |
|
51 * of the header's value part. |
|
52 * @param aValue a value part of a "Accept-Encoding"-header |
|
53 * @return An array containing one to many CSIPAcceptEncodingHeader |
|
54 * instances |
|
55 */ |
|
56 IMPORT_C static RPointerArray<CSIPAcceptEncodingHeader> |
|
57 DecodeL(const TDesC8& aValue); |
|
58 |
|
59 /** |
|
60 * Creates a new instance of CSIPAcceptEncodingHeader |
|
61 * @param aCodings a codings to set. |
|
62 * @return a new instance of CSIPAcceptEncodingHeader |
|
63 */ |
|
64 IMPORT_C static CSIPAcceptEncodingHeader* NewL(const TDesC8& aCodings); |
|
65 |
|
66 /** |
|
67 * Creates a new instance of CSIPAcceptEncodingHeader |
|
68 * and puts it onto the cleanup stack |
|
69 * @param aCodings a codings to set. |
|
70 * @return a new instance of CSIPAcceptEncodingHeader |
|
71 */ |
|
72 IMPORT_C static CSIPAcceptEncodingHeader* NewLC(const TDesC8& aCodings); |
|
73 |
|
74 /** |
|
75 * Destructor, deletes the resources of CSIPAcceptEncodingHeader. |
|
76 */ |
|
77 IMPORT_C ~CSIPAcceptEncodingHeader(); |
|
78 |
|
79 |
|
80 public: // New functions |
|
81 |
|
82 /** |
|
83 * Gets the codings from the "Accept-Encoding" header |
|
84 * @return codings |
|
85 */ |
|
86 IMPORT_C const TDesC8& Codings() const; |
|
87 |
|
88 /** |
|
89 * Sets the codings in the "Accept-Encoding" header |
|
90 * @param aCodings the codings |
|
91 */ |
|
92 IMPORT_C void SetCodingsL(const TDesC8& aCodings); |
|
93 |
|
94 /** |
|
95 * Gets the value of "q"-parameter |
|
96 * @return the "q"-parameter value |
|
97 */ |
|
98 IMPORT_C TReal QParameter() const; |
|
99 |
|
100 /** |
|
101 * Sets the "q"-parameter value |
|
102 * @param aQValue a "q"-parameter value to setī |
|
103 */ |
|
104 IMPORT_C void SetQParameterL(TReal aQValue); |
|
105 |
|
106 /** |
|
107 * Constructs an instance of a CSIPAcceptEncodingHeader from a RReadStream |
|
108 * @param aReadStream a stream containing the value of the |
|
109 * externalized header object (header name not included). |
|
110 * @return An instance of a CSIPAcceptEncodingHeader |
|
111 */ |
|
112 IMPORT_C static CSIPHeaderBase* |
|
113 InternalizeValueL(RReadStream& aReadStream); |
|
114 |
|
115 |
|
116 public: // From CSIPHeaderBase |
|
117 |
|
118 /** |
|
119 * From CSIPHeaderBase CloneL |
|
120 */ |
|
121 IMPORT_C CSIPHeaderBase* CloneL() const; |
|
122 |
|
123 /** |
|
124 * From CSIPHeaderBase Name |
|
125 */ |
|
126 IMPORT_C RStringF Name() const; |
|
127 |
|
128 |
|
129 public: // From CSIPHeaderBase, for internal use |
|
130 |
|
131 /** |
|
132 * @internalComponent |
|
133 */ |
|
134 TBool MoreThanOneAllowed() const; |
|
135 |
|
136 /** |
|
137 * @internalComponent |
|
138 */ |
|
139 TPreferredPlace PreferredPlaceInMessage() const; |
|
140 |
|
141 public: // New functions, for internal use |
|
142 |
|
143 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue); |
|
144 |
|
145 private: // From CSIPHeaderBase |
|
146 |
|
147 void ExternalizeValueL(RWriteStream& aWriteStream) const; |
|
148 |
|
149 private: // From CSIPParameterHeaderBase |
|
150 |
|
151 HBufC8* ToTextMandatoryPartLC() const; |
|
152 void ParseMandatoryPartL(const TDesC8& aMandatoryPart); |
|
153 const CSIPParamContainerBase& Params() const; |
|
154 CSIPParamContainerBase& Params(); |
|
155 |
|
156 private: // Constructors |
|
157 |
|
158 CSIPAcceptEncodingHeader(); |
|
159 void ConstructL(); |
|
160 void ConstructL(const TDesC8& aCodings); |
|
161 void ConstructL(const CSIPAcceptEncodingHeader& aAcceptEncodingHeader); |
|
162 |
|
163 private: // New functions |
|
164 |
|
165 void DoInternalizeValueL(RReadStream& aReadStream); |
|
166 |
|
167 private: // Data |
|
168 |
|
169 HBufC8* iCodings; |
|
170 CSIPAcceptHeaderParams* iParams; |
|
171 |
|
172 private: // For testing purposes |
|
173 |
|
174 UNIT_TEST(CSIPAcceptEncodingHeaderTest) |
|
175 }; |
|
176 |
|
177 #endif // CSIPACCEPTENCODINGHEADER_H |
|
178 |
|
179 // End of File |