Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // 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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 @warning : This file contains Rose Model ID comments - please do not delete
23 #ifndef __CHEADERCODEC_H__
24 #define __CHEADERCODEC_H__
28 #include <http/framework/rheaderfield.h>
30 // Forward declarations
35 //##ModelId=3C4C18850126
36 class CHeaderCodec : public CBase
38 An abstract HTTP header codec.
40 Each instance of a concrete subclass of CHeaderCodec is associated with, and owned
41 by, a specific CProtocolHandler. It provides on-demand encoding/decoding of
42 HTTP header data, between the generic format used by clients/filters to formulate
43 requests and interpret responses, and the raw format used by
44 the transport handlers (and origin servers/gateways/etc.)
46 The CHeaderCodec has an associated instance of a sub-class of each of
47 CHeaderReader and CHeaderWriter. It delegates the actual encoding and
48 decoding function to these instances.
50 Header codecs provide a mechanism for extensibility whereby if one codec can't
51 decode (or encode) a given header, it locates a codec that can, and then delegates
52 the task to that codec instead.
60 Intended Usage: Destructor - cleans up and releases resources to the system.
62 //##ModelId=3C4C18850194
63 IMPORT_C virtual ~CHeaderCodec();
66 Encode the supplied header field. This method uses the associated
67 concrete CHeaderWriter object to do a conversion of the field into
68 raw form from the generic internal representation.
70 @param aHeader (in) A proxy for the header field to be encoded
71 @leave KErrNotSupported if a codec that supports encoding this header
74 //##ModelId=3C4C1885018C
75 IMPORT_C void EncodeHeaderL(RHeaderField& aHeader) const;
78 Decode the supplied header field. This method uses the associated
79 concrete CHeaderReader object to do a conversion of the field into
80 the generic internal representation from the raw form.
82 @param aHeader (in) A proxy for the header field to be decoded
84 @leave KErrNotSupported if a codec that supports decoding this header
88 //##ModelId=3C4C1885018A
89 IMPORT_C void DecodeHeaderL(RHeaderField& aHeader) const;
92 Intended Usage: Concrete header codec classes must implement this method to
93 indicate to the framework whether their concrete CHeaderWriter is
94 capable of encoding the named header field.
95 @param aHeaderField (in) A proxy for the header field to be encoded
96 @return A flag indicating ETrue if the field can be encoded.
98 //##ModelId=3C4C18850181
99 virtual TBool CanEncode(RStringF aHeaderField) const = 0;
102 Intended Usage: Concrete header codec classes must implement this method to
103 indicate to the framework whether their concrete CHeaderReader is
104 capable of decoding the named header field.
105 @param aHeaderField (in) A proxy for the header field to be encoded
106 @return A flag indicating ETrue if the field can be decoded.
108 //##ModelId=3C4C18850178
109 virtual TBool CanDecode(RStringF aHeaderField) const = 0;
112 Intended Usage: Concrete header codecs must be implement this method if they wish to
113 delegate the encoding/decoding of particular header fields to a
115 This would be done if the codec doesn't have the ability itself to
116 do the encode/decode but can locate an alternative that does. This
117 function may leave with a Standard Symbian OS error code. eg. KErrNoMemory
119 The caller takes ownership of the returned codec.
120 @param aHeaderField (in) A proxy for the header field to be encoded
121 @return A pointer to the new CHeaderCodec, or NULL if one couldn't be found.
122 @leave KErrNoMemory, Not enough memory to create object.
124 //##ModelId=3C4C18850176
125 virtual CHeaderCodec* FindDelegateCodecL(RStringF aHeaderField) const = 0;
127 protected: // methods
132 //##ModelId=3A914DF20273
133 IMPORT_C CHeaderCodec();
136 Second phase construction in which any necessary allocation is done
137 Implementations of this interface may leave with standard erros like KErrNoMemory if there is
138 insufficient memory for allocation in the second phase.
140 //##ModelId=3C4C1885016E
141 IMPORT_C void ConstructL();
143 protected: // attributes
145 /** The owned header writer object that does actual encoding of header fields.
147 //##ModelId=3C4C18850164
148 CHeaderWriter* iWriter;
150 /** The owned header reader object that does actual decoding of header fields.
152 //##ModelId=3C4C1885015A
153 CHeaderReader* iReader;
158 Intended Usage: Reserve a slot in the v-table to preserve future BC
160 //##ModelId=3C4C1885016D
161 inline virtual void Reserved1();
164 Intended Usage: Reserve a slot in the v-table to preserve future BC
166 //##ModelId=3C4C1885016C
167 inline virtual void Reserved2();
169 private: // attributes
171 /** The most recently-obtained delegate codec
173 //##ModelId=3C4C18850150
174 mutable CHeaderCodec* iDelegateCodec;
178 //##ModelId=3C4C188601D1
179 class CHeaderWriter : public CBase
181 An abstract HTTP header encoder. CHeaderWriter provides an interface used by its
182 owning codec to do conversion of header data from the generic internal header
183 representation to the raw representation used for a particular protocol/transport.
184 Specific sub-classes of CHeaderWriter are associated with specific protocol handlers.
192 Intended Usage: Destructor - cleans up and release resources to the system.
194 //##ModelId=3C4C188601FC
195 IMPORT_C virtual ~CHeaderWriter();
198 Intended Usage: Encodes the supplied header field. This method does a conversion
199 of the field into raw form from the generic internal representation.
201 Implementations of this interface may leave with any of KErrNotSupported, KErrHttpEncodeDoWWWAuthenticate,
202 KErrHttpEncodeAuthorization, KErrHttpEncodeDoAge, KErrHttpEncodeDoVary, KErrHttpEncodeDoContentLanguage.
204 Specific header writer sub-classes must implement this method.
205 @param aHeader (in) A proxy for the header field to be encoded
207 //##ModelId=3C4C188601FA
208 virtual void EncodeHeaderL(RHeaderField& aHeader) = 0;
210 protected: // methods
215 IMPORT_C CHeaderWriter();
218 Second phase construction in which any necessary allocation is done
219 Implementations of this interface may leave with standard errors like KErrNoMemory.
221 //##ModelId=3C4C188601F9
222 IMPORT_C void ConstructL();
227 Intended Usage: Reserve a slot in the v-table to preserve future BC
229 //##ModelId=3C4C188601F1
230 inline virtual void Reserved1();
233 Intended Usage: Reserve a slot in the v-table to preserve future BC
235 //##ModelId=3C4C188601F0
236 inline virtual void Reserved2();
240 //##ModelId=3C4C188602FE
241 class CHeaderReader : public CBase
243 An abstract HTTP header decoder. CHeaderReader provides an interface used by its
244 owning codec to do conversion of header data from the raw representation used for
245 a particular protocol/transport to the generic internal header representation.
246 Specific sub-classes of CHeaderWriter are associated with specific protocol
255 Intended Usage: Destructor - cleans up and release resources to the system.
257 //##ModelId=3C4C1886031E
258 IMPORT_C virtual ~CHeaderReader();
261 Intended Usage: Decodes the supplied header field. This method does a conversion
262 of the field from the generic internal representation into raw form.
264 Specific header reader sub-classes must implement this method.
266 Implementations of this interface may leave with any of KErrHttpDecodeAccept, KErrHttpDecodeAcceptCharset,
267 KErrHttpDecodeAcceptLanguage, KErrHttpDecodeAcceptEncoding, KErrNotSupported.
269 @param aHeader (in) A proxy for the header field to be decoded
272 //##ModelId=3C4C1886031C
273 virtual void DecodeHeaderL(RHeaderField& aHeader) = 0;
275 protected: // methods
280 IMPORT_C CHeaderReader();
283 Second phase construction in which any necessary allocation is done
284 Implementations of this interface may leave with standard errors like KErrNoMemory.
286 //##ModelId=3C4C18860315
287 IMPORT_C void ConstructL();
292 Intended Usage: Reserve a slot in the v-table to preserve future BC
294 //##ModelId=3C4C18860314
295 inline virtual void Reserved1();
298 Intended Usage: Reserve a slot in the v-table to preserve future BC
300 //##ModelId=3C4C18860313
301 inline virtual void Reserved2();
305 inline void CHeaderCodec::Reserved1()
307 inline void CHeaderCodec::Reserved2()
309 inline void CHeaderWriter::Reserved1()
311 inline void CHeaderWriter::Reserved2()
313 inline void CHeaderReader::Reserved1()
315 inline void CHeaderReader::Reserved2()
318 #endif /* __CHEADERCODEC_H__ */