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 : sipeventheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPEVENTHEADER_H
26 #define CSIPEVENTHEADER_H
31 #include "sipparameterheaderbase.h"
32 #include "_sipcodecdefs.h"
34 // FORWARD DECLARATIONS
35 class CSIPEventHeaderParams;
42 * Class provides functions for setting and getting parameters in
47 class CSIPEventHeader : public CSIPParameterHeaderBase
49 public: // Constructors and destructor
52 * Constructs a CSIPEventHeader from textual representation
53 * of the header's value part.
54 * @param aValue a value part of a "Event"-header
55 * @return a new instance of CSIPEventHeader
57 IMPORT_C static CSIPEventHeader* DecodeL(const TDesC8& aValue);
60 * Creates a new instance of CSIPEventHeader
61 * @param aEventPackage a Event-Package value
62 * @return a new instance of CSIPEventHeader
64 IMPORT_C static CSIPEventHeader* NewL(const TDesC8& aEventPackage);
67 * Creates a new instance of CSIPEventHeader and puts it to CleanupStack
68 * @param aEventPackage a Event-Package value
69 * @return a new instance of CSIPEventHeader
72 IMPORT_C static CSIPEventHeader* NewLC(const TDesC8& aEventPackage);
75 * Destructor, deletes the resources of CSIPEventHeader.
77 IMPORT_C ~CSIPEventHeader();
80 public: // New functions
83 * Compares this instance to another CSIPEventHeader instance
84 * @param aHeader a header to compare to
85 * @return ETrue if the objects are equal otherwise EFalse
87 IMPORT_C TBool operator==(const CSIPEventHeader& aHeader) const;
90 * Gets the Event-Package parameter from the "Event" header
91 * @return the Event-Package parameter
93 IMPORT_C const TDesC8& EventPackage() const;
96 * Sets the Event-Package parameter in the "Event" header;
97 * @param aEventPackage a Event-Package parameter to set
99 IMPORT_C void SetEventPackageL(const TDesC8& aEventPackage);
102 * Sets the event templates overwriting all the existing ones.
103 * @param aEventTemplates an array of event templates
105 IMPORT_C void SetEventTemplatesL(const MDesC8Array& aEventTemplates);
108 * Gets the event templates.
109 * @return a reference to the currently set event templates.
111 IMPORT_C const MDesC8Array& EventTemplates() const;
114 * Constructs an instance of a CSIPEventHeader from a RReadStream
115 * @param aReadStream a stream containing the value of the
116 * externalized object (header name not included).
117 * @return an instance of a CSIPEventHeader
119 IMPORT_C static CSIPHeaderBase*
120 InternalizeValueL(RReadStream& aReadStream);
123 public: // From CSIPHeaderBase
126 * From CSIPHeaderBase CloneL
128 IMPORT_C CSIPHeaderBase* CloneL() const;
131 * From CSIPHeaderBase Name
133 IMPORT_C RStringF Name() const;
136 public: // From CSIPHeaderBase, for internal use
141 TBool HasCompactName() const;
146 RStringF CompactName() const;
151 TPreferredPlace PreferredPlaceInMessage() const;
153 public: // New functions, for internal use
155 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
157 private: // From CSIPHeaderBase
159 void ExternalizeValueL(RWriteStream& aWriteStream) const;
161 private: // From CSIPParameterHeaderBase
163 HBufC8* ToTextMandatoryPartLC() const;
164 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
165 const CSIPParamContainerBase& Params() const;
166 CSIPParamContainerBase& Params();
168 private: // Constructors
172 void ConstructL(const TDesC8& aEventPackage);
173 void ConstructL(const CSIPEventHeader& aSIPEventHeader);
175 private: // New functions
177 void DoInternalizeValueL(RReadStream& aReadStream);
178 void CheckTemplateL(const TDesC8& aParam) const;
179 // Needed for cleanup of a RPointerArray<HBufC8>:
180 static void ResetAndDestroy(TAny* anArray);
184 HBufC8* iEventPackage;
185 CSIPEventHeaderParams* iParams;
186 CDesC8ArraySeg* iEventTemplates;
188 private: // For testing purposes
190 UNIT_TEST(CSIPEventHeaderTest)
193 #endif // CSIPEVENTHEADER_H