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 : sipacceptlanguageheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPACCEPTLANGUAGEHEADER_H
26 #define CSIPACCEPTLANGUAGEHEADER_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-Language" header.
45 class CSIPAcceptLanguageHeader : public CSIPParameterHeaderBase
47 public: // Constructors and destructor
50 * Constructs a CSIPAcceptLanguageHeader from textual representation
51 * of the header's value part.
52 * @param aValue a value part of a "Accept-Language"-header
53 * @return an array containing one to many instances of
54 * CSIPAcceptLanguageHeader.
56 IMPORT_C static RPointerArray<CSIPAcceptLanguageHeader>
57 DecodeL(const TDesC8& aValue);
60 * Creates a new instance of CSIPAcceptLanguageHeader
61 * @param aLanguageRange a language-range to set
62 * @return a new instance of CSIPAcceptLanguageHeader
64 IMPORT_C static CSIPAcceptLanguageHeader*
65 NewL(const TDesC8& aLanguageRange);
68 * Creates a new instance of CSIPAcceptLanguageHeader and puts it onto
70 * @param aLanguageRange a language-range to set
71 * @return a new instance of CSIPAcceptLanguageHeader
73 IMPORT_C static CSIPAcceptLanguageHeader*
74 NewLC(const TDesC8& aLanguageRange);
77 * Destructor, deletes the resources of CSIPAcceptLanguageHeader.
79 IMPORT_C ~CSIPAcceptLanguageHeader();
82 public: // New functions
85 * Gets the language-range from the "Accept-Language" header
86 * @return a language-range
88 IMPORT_C const TDesC8& LanguageRange() const;
91 * Sets the language-range in the "Accept-Language" header
92 * @param aLanguageRange a language-range
94 IMPORT_C void SetLanguageRangeL(const TDesC8& aLanguageRange);
97 * Gets the value of "q"-parameter
98 * @return the "q"-parameter value
100 IMPORT_C TReal QParameter() const;
103 * Sets the "q"-parameter value
104 * @param aQValue a "q"-parameter value to set
106 IMPORT_C void SetQParameterL(TReal aQValue);
109 * Constructs an instance of a CSIPAcceptLanguageHeader from a RReadStream
110 * @param aReadStream a stream containing the value of the
111 * externalized header object (header name not included).
112 * @return an instance of a CSIPAcceptLanguageHeader
114 IMPORT_C static CSIPHeaderBase*
115 InternalizeValueL(RReadStream& aReadStream);
118 public: // From CSIPHeaderBase
121 * From CSIPHeaderBase CloneL
123 IMPORT_C CSIPHeaderBase* CloneL() const;
126 * From CSIPHeaderBase Name
128 IMPORT_C RStringF Name() const;
131 public: // From CSIPHeaderBase, for internal use
136 TBool MoreThanOneAllowed() const;
141 TPreferredPlace PreferredPlaceInMessage() const;
143 public: // New functions, for internal use
145 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
147 private: // From CSIPHeaderBase
149 void ExternalizeValueL(RWriteStream& aWriteStream) const;
151 private: // From CSIPParameterHeaderBase
153 HBufC8* ToTextMandatoryPartLC() const;
154 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
155 const CSIPParamContainerBase& Params() const;
156 CSIPParamContainerBase& Params();
158 private: // New functions
160 CSIPAcceptLanguageHeader();
162 void ConstructL(const TDesC8& aLanguageRange);
163 void ConstructL(const CSIPAcceptLanguageHeader& aAcceptLanguageHeader);
164 void DoInternalizeValueL(RReadStream& aReadStream);
168 HBufC8* iLanguageRange;
169 CSIPAcceptHeaderParams* iParams;
171 private: // For testing purposes
173 UNIT_TEST(CSIPAcceptLanguageHeaderTest)
176 #endif // CSIPACCEPTLANGUAGEHEADER_H