Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : sipacceptencodingheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPACCEPTENCODINGHEADER_H
26 #define CSIPACCEPTENCODINGHEADER_H
29 #include "sipparameterheaderbase.h"
30 #include "_sipcodecdefs.h"
32 // FORWARD DECLARATIONS
33 class CSIPAcceptHeaderParams;
40 * Class provides functions for setting and getting media types and
41 * parameters in SIP "Accept-Encoding" header.
45 class CSIPAcceptEncodingHeader : public CSIPParameterHeaderBase
47 public: // Constructors and destructor
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
56 IMPORT_C static RPointerArray<CSIPAcceptEncodingHeader>
57 DecodeL(const TDesC8& aValue);
60 * Creates a new instance of CSIPAcceptEncodingHeader
61 * @param aCodings a codings to set.
62 * @return a new instance of CSIPAcceptEncodingHeader
64 IMPORT_C static CSIPAcceptEncodingHeader* NewL(const TDesC8& aCodings);
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
72 IMPORT_C static CSIPAcceptEncodingHeader* NewLC(const TDesC8& aCodings);
75 * Destructor, deletes the resources of CSIPAcceptEncodingHeader.
77 IMPORT_C ~CSIPAcceptEncodingHeader();
80 public: // New functions
83 * Gets the codings from the "Accept-Encoding" header
86 IMPORT_C const TDesC8& Codings() const;
89 * Sets the codings in the "Accept-Encoding" header
90 * @param aCodings the codings
92 IMPORT_C void SetCodingsL(const TDesC8& aCodings);
95 * Gets the value of "q"-parameter
96 * @return the "q"-parameter value
98 IMPORT_C TReal QParameter() const;
101 * Sets the "q"-parameter value
102 * @param aQValue a "q"-parameter value to setī
104 IMPORT_C void SetQParameterL(TReal aQValue);
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
112 IMPORT_C static CSIPHeaderBase*
113 InternalizeValueL(RReadStream& aReadStream);
116 public: // From CSIPHeaderBase
119 * From CSIPHeaderBase CloneL
121 IMPORT_C CSIPHeaderBase* CloneL() const;
124 * From CSIPHeaderBase Name
126 IMPORT_C RStringF Name() const;
129 public: // From CSIPHeaderBase, for internal use
134 TBool MoreThanOneAllowed() const;
139 TPreferredPlace PreferredPlaceInMessage() const;
141 public: // New functions, for internal use
143 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
145 private: // From CSIPHeaderBase
147 void ExternalizeValueL(RWriteStream& aWriteStream) const;
149 private: // From CSIPParameterHeaderBase
151 HBufC8* ToTextMandatoryPartLC() const;
152 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
153 const CSIPParamContainerBase& Params() const;
154 CSIPParamContainerBase& Params();
156 private: // Constructors
158 CSIPAcceptEncodingHeader();
160 void ConstructL(const TDesC8& aCodings);
161 void ConstructL(const CSIPAcceptEncodingHeader& aAcceptEncodingHeader);
163 private: // New functions
165 void DoInternalizeValueL(RReadStream& aReadStream);
170 CSIPAcceptHeaderParams* iParams;
172 private: // For testing purposes
174 UNIT_TEST(CSIPAcceptEncodingHeaderTest)
177 #endif // CSIPACCEPTENCODINGHEADER_H