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 : siptimestampheader.h
24 #ifndef CSIPTIMESTAMPHEADER_H
25 #define CSIPTIMESTAMPHEADER_H
28 #include "sipheaderbase.h"
29 #include "_sipcodecdefs.h"
36 * Class for a SIP Timestamp header.
40 class CSIPTimestampHeader : public CSIPHeaderBase
42 public: // Constructors and destructor
45 * Constructs a CSIPTimestampHeader from textual representation
46 * of the header's value part.
47 * @param aValue a value part of a "Timestamp"-header (e.g. "12 3.4")
48 * @returns a new instance of CSIPTimestampHeader
50 IMPORT_C static CSIPTimestampHeader* DecodeL(const TDesC8& aValue);
54 * @param aTimestamp a timestamp value to set.
55 * @param aDealy a delay value to set.
57 IMPORT_C CSIPTimestampHeader(TReal aTimestamp);
62 IMPORT_C ~CSIPTimestampHeader ();
65 public: // New functions
68 * Set the timestamp from the "Timestamp" header.
69 * @param aTimestamp a timestamp to set.
71 IMPORT_C void SetTimestamp(TReal aTimestamp);
74 * Gets the timestamp from the "Timestamp" header.
75 * @return a timestamp value.
77 IMPORT_C TReal Timestamp() const;
80 * Check if the delay-part is present
81 * @return a delay value.
83 IMPORT_C TBool HasDelay() const;
86 * Set the delay-part of the "Timestamp" header.
87 * @param aDelay a delay to set.
89 IMPORT_C void SetDelay(TReal aDelay);
92 * Gets the delay-part of the "Timestamp" header,
93 * if delay-part is present
94 * @return a delay value or zero if HasDelay() == EFalse
96 IMPORT_C TReal Delay() const;
99 * Constructs an instance of a CSIPTimestampHeader from a RReadStream
100 * @param aReadStream a stream containing the value of the
101 * externalized object (header name not included).
102 * @return an instance of a CSIPTimestampHeader
104 IMPORT_C static CSIPHeaderBase*
105 InternalizeValueL(RReadStream& aReadStream);
107 public: // From CSIPHeaderBase
110 * From CSIPHeaderBase CloneL
112 IMPORT_C CSIPHeaderBase* CloneL() const;
115 * From CSIPHeaderBase Name
117 IMPORT_C RStringF Name() const;
120 * From CSIPHeaderBase ToTextValueL
122 IMPORT_C HBufC8* ToTextValueL() const;
125 public: // From CSIPHeaderBase, for internal use
130 TPreferredPlace PreferredPlaceInMessage() const;
132 public: // New functions, for internal use
134 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
136 private: // From CSIPHeaderBase
138 void ExternalizeValueL (RWriteStream& aWriteStream) const;
140 private: // New functions
142 void ParseL(const TDesC8& aValue);
143 void DoInternalizeValueL(RReadStream& aReadStream);
151 private: // For testing purposes
153 UNIT_TEST(CSIPTimestampHeaderTest)
157 #endif // end of CSIPTIMESTAMPHEADER_H