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 : sipretryafterheader.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPRETRYAFTERHEADER_H
26 #define CSIPRETRYAFTERHEADER_H
29 #include "sipparameterheaderbase.h"
30 #include "_sipcodecdefs.h"
32 // FORWARD DECLARATIONS
33 class CSIPRetryAfterHeaderParams;
40 * Class provides functions for setting and getting parameters in SIP
41 * "Retry-After" header.
45 class CSIPRetryAfterHeader : public CSIPParameterHeaderBase
47 public: // Constructors and destructor
50 * Constructs a CSIPRetryAfterHeader from textual representation
51 * of the header's value part.
52 * @param aValue a value part of a "Retry-After"-header
53 * (e.g. "18000;duration=3600")
54 * @return a new instance of CSIPRetryAfterHeader
56 IMPORT_C static CSIPRetryAfterHeader* DecodeL(const TDesC8& aValue);
59 * Creates a new instance of CSIPRetryAfterHeader
60 * @param aRetryAfter a retry after value.
61 * @return a new instance of CSIPRetryAfterHeader
63 IMPORT_C static CSIPRetryAfterHeader* NewL(TUint aRetryAfter);
66 * Creates a new instance of CSIPRetryAfterHeader
67 * On return the new instance has left to the CleanupStack.
68 * @param aRetryAfter a retry after value.
69 * @return a new instance of CSIPRetryAfterHeader
71 IMPORT_C static CSIPRetryAfterHeader* NewLC(TUint aRetryAfter);
74 * Destructor, deletes the resources of CSIPRetryAfterHeader.
76 IMPORT_C virtual ~CSIPRetryAfterHeader();
79 public: // New functions
82 * Sets the retry after value
83 * @param aValue a new retry after value to set.
85 IMPORT_C void SetRetryAfter(TUint aValue);
88 * Gets the retry after value
89 * @return a retry after value
91 IMPORT_C TUint RetryAfter() const;
94 * Gets the comment value
95 * @return a comment value or KNullDesC8
97 IMPORT_C const TDesC8& Comment() const;
100 * Gets the value of the "duration"-parameter
101 * @return the "duration"-parameter, or
102 * KErrNotFound if the parameter is not present.
104 IMPORT_C TInt DurationParam() const;
107 * Sets the "duration"-parameter
108 * @pre aDurationParam >= 0
109 * @param aDurationParam a "duration"-parameter value to set
111 IMPORT_C void SetDurationParamL(TInt aDurationParam);
114 * Constructs an instance of a CSIPRetryAfterHeader 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 CSIPRetryAfterHeader
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
138 TPreferredPlace PreferredPlaceInMessage() const;
140 public: // New functions, for internal use
142 static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
144 private: // From CSIPHeaderBase
146 void ExternalizeValueL(RWriteStream& aWriteStream) const;
148 private: // From CSIPParameterHeaderBase
150 HBufC8* ToTextMandatoryPartLC() const;
151 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
152 const CSIPParamContainerBase& Params() const;
153 CSIPParamContainerBase& Params();
155 private: // Constructors
157 CSIPRetryAfterHeader();
158 CSIPRetryAfterHeader(TUint aRetryAfter);
160 void ConstructL(const CSIPRetryAfterHeader& aRetryAfterHeader);
162 private: // New functions
164 void DoInternalizeValueL(RReadStream& aReadStream);
170 CSIPRetryAfterHeaderParams* iParams;
172 private: // For testing purposes
174 UNIT_TEST(CSIPRetryAfterHeaderTest)
177 #endif // end of CSIPRETRYAFTERHEADER_H