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 : sipextensionheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPEXTENSIONHEADER_H
26 #define CSIPEXTENSIONHEADER_H
29 #include "sipheaderbase.h"
30 #include "_sipcodecdefs.h"
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.
44 class CSIPExtensionHeader : public CSIPHeaderBase
46 public: // Constructors and destructor
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
54 IMPORT_C static CSIPExtensionHeader*
55 NewL(const TDesC8& aName, const TDesC8& aValue);
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
64 IMPORT_C static CSIPExtensionHeader*
65 NewLC(const TDesC8& aName, const TDesC8& aValue);
68 * Destructor, deletes the resources of CSIPExtensionHeader.
70 IMPORT_C ~CSIPExtensionHeader();
73 public: // New functions
76 * Sets the header value
77 * @param aValue the header value to be set
79 IMPORT_C void SetValueL(const TDesC8& aValue);
82 * Gets the header value
83 * @return the header value
85 IMPORT_C const TDesC8& Value() const;
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
94 IMPORT_C static CSIPExtensionHeader*
95 InternalizeValueL(RReadStream& aReadStream);
98 public: // From CSIPHeaderBase
101 * From CSIPHeaderBase CloneL
103 IMPORT_C CSIPHeaderBase* CloneL() const;
106 * From CSIPHeaderBase Name
108 IMPORT_C RStringF Name() const;
111 * From CSIPHeaderBase ToTextValueL
113 IMPORT_C HBufC8* ToTextValueL() const;
116 * From CSIPHeaderBase ExternalizeSupported
118 IMPORT_C TBool ExternalizeSupported() const;
121 public: // New functions, for internal use
123 void SetNameL(const TDesC8& aName);
125 public: // From CSIPHeaderBase, for internal use
130 TBool IsExtensionHeader() const;
135 TBool EncodeMultipleToOneLine() const;
140 TBool MoreThanOneAllowed() const;
145 TBool HasCompactName() const;
150 RStringF CompactName() const;
155 TPreferredPlace PreferredPlaceInMessage() const;
157 private: // From CSIPHeaderBase
159 void ExternalizeValueL(RWriteStream& aWriteStream) const;
161 private: // Constructors
163 CSIPExtensionHeader();
164 void ConstructL(const TDesC8& aName, const TDesC8& aValue);
165 void ConstructL(const CSIPExtensionHeader& aExtensionHeader);
166 void DoInternalizeValueL(RReadStream& aReadStream);
168 private: // New functions
170 TBool CheckValue (const TDesC8& aValue);
178 private: // For testing purposes
180 UNIT_TEST(CSIPExtensionHeaderTest)
181 UNIT_TEST(CSIPHeaderLookupTest)
184 #endif // CSIPEXTENSIONHEADER_H