Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 2003-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 : SdpBandwidthField.h
17 * Interface : SDK API, SDP Codec API
24 #ifndef CSDPBANDWIDTHFIELD_H
25 #define CSDPBANDWIDTHFIELD_H
29 #include <stringpool.h>
32 // FORWARD DECLARATIONS
41 * This class encapsulates the bandwidth field of
42 * the Session Description Protocol.
44 * The normative reference for correct formatting and values is
45 * draft-ietf-mmusic-sdp-new-14 unless specified otherwise in
46 * member documentation. The implementation supports this normative
47 * reference, but does not enforce it fully.
51 class CSdpBandwidthField : public CBase
53 public:// Constructors and destructor
55 * Constructs a new bandwidth field.
57 * @param aText A string containing a correctly
58 * formatted field value terminated by a CRLF.
59 * @return a new instance.
61 IMPORT_C static CSdpBandwidthField* DecodeL(const TDesC8& aText);
64 * Constructs a new bandwidth field and adds the pointer to the
67 * @param aText A string containing a correctly
68 * formatted field value terminated by a CRLF.
69 * @return a new instance.
71 IMPORT_C static CSdpBandwidthField* DecodeLC(const TDesC8& aText);
74 * Constructs a new bandwidth field.
76 * @param aModifier Bandwidth modifier.
77 * @param aValue Bandwidth value.
78 * @return a new instance.
80 IMPORT_C static CSdpBandwidthField* NewL(RStringF aModifier,
84 * Constructs a new bandwidth field and adds the pointer to the
87 * @param aModifier Bandwidth modifier.
88 * @param aValue Bandwidth value.
89 * @return a new instance.
91 IMPORT_C static CSdpBandwidthField* NewLC(RStringF aModifier,
96 * Deletes the resources held by the instance.
98 IMPORT_C ~CSdpBandwidthField();
100 public: // New functions
102 * Outputs the field formatted according to SDP syntax and including
103 * the terminating CRLF.
105 * @param aStream Stream used for output. On return
106 * the stream includes correctly formatted bandwidth field.
108 IMPORT_C void EncodeL(RWriteStream& aStream) const;
111 * Creates a new instance that is equal to the target.
113 * @return a new instance.
115 IMPORT_C CSdpBandwidthField * CloneL() const;
118 * Compares this instance to another for equality.
120 * @param aObj The instance to compare to.
121 * @return ETrue if equal, EFalse if not.
123 IMPORT_C TBool operator == (const CSdpBandwidthField& aObj) const;
126 * Gets the bandwidth modifier.
128 * @return The modifier that can be pre-defined in the
129 * SDP string table or defined by the user.
131 IMPORT_C RStringF Modifier() const;
134 * Sets the bandwidth modifier.
136 * @param aModifier A valid bandwidth modifier name.
138 IMPORT_C void SetModifier(RStringF aModifier);
141 * Gets the bandwidth value.
145 IMPORT_C TUint32 Value() const;
148 * Sets the bandwidth value.
150 * @param aValue The Value.
152 IMPORT_C void SetValue(TUint32 aValue);
156 * Externalize the instance in a memory optimized format.
158 * @param aStream The stream used for externalization.
160 void ExternalizeL(RWriteStream& aStream) const;
163 * Create a new instance from value created with ExternalizeL().
165 * @param aStream The stream used for internalization.
166 * @return The new instance.
168 static CSdpBandwidthField* InternalizeL(RReadStream& aStream);
171 CSdpBandwidthField();
172 void ConstructL(const TDesC8& aText);
173 void ConstructL(RStringF aModifier, TUint32 aValue);
174 void ConstructL(const TDesC8& aModifier, TUint32 aValue);
177 * Copies given modifier to iModifier. If aModifier is none of
178 * predefined ones, new modifier is added to stringPool.
180 * @param aModifier Given modifier
182 void CopyModifierL(const TDesC8& aModifier);
187 RStringPool iStringPool;
190 #endif // CSDPBANDWIDTHFIELD_H