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 : SdpFmtAttributeField.h
17 * Interface : SDK API, SDP Codec API
24 #ifndef CSDPFMTATTRIBUTEFIELD_H
25 #define CSDPFMTATTRIBUTEFIELD_H
29 #include <stringpool.h>
32 // FORWARD DECLARATIONS
35 class CSdpAttributeField;
36 class TSdpRtpmapValue;
43 * This class encapsulates the attribute field of the Session Description
44 * Protocol for media format/payload type level attributes. Media and session
45 * level attributes are supported by the CSdpAttributeField class.
47 * The normative reference for correct formatting and values is
48 * draft-ietf-mmusic-sdp-new-14 unless specified otherwise in
49 * member documentation. The implementation supports this normative
50 * reference, but does not enforce it fully.
54 class CSdpFmtAttributeField : public CBase
56 public: // Constructors and destructor
58 * Constructs a new media format level attribute field.
60 * @param aText A string containing a correctly
61 * formatted field value terminated by a CRLF.
62 * @return a new instance.
64 IMPORT_C static CSdpFmtAttributeField* DecodeL( const TDesC8& aText );
67 * Constructs a new media format level attribute field and adds the
68 * pointer to the cleanup stack.
70 * @param aText A string containing a correctly
71 * formatted field value terminated by a CRLF.
72 * @return a new instance.
74 IMPORT_C static CSdpFmtAttributeField* DecodeLC( const TDesC8& aText);
77 * Constructs a new media level format attribute field.
79 * @param aAttribute The attribute name. It can be a pre-defined
80 * name in the SDP string pool or defined by the client.
81 * @param aFormat A valid format/payload identifier
82 * used in the format list of the media description.
83 * @param aValue A valid attribute value or an empty
84 * descriptor to omit the value part.
85 * @return a new instance.
87 IMPORT_C static CSdpFmtAttributeField* NewL(
88 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue );
91 * Constructs a new media format level attribute field and adds the
92 * pointer to the cleanup stack.
94 * @param aAttribute The attribute name. It can be a pre-defined
95 * name in the SDP string pool or defined by the client.
96 * @param aFormat A valid format/payload identifier
97 * used in the format list of the media description.
98 * @param aValue A valid attribute value or an empty
99 * descriptor to omit the value part.
100 * @return a new instance.
102 IMPORT_C static CSdpFmtAttributeField* NewLC(
103 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue );
106 * Deletes the resources held by the instance.
108 IMPORT_C ~CSdpFmtAttributeField();
110 public: // New functions
113 * Outputs the field formatted according to SDP syntax and including
114 * the terminating CRLF.
116 * @param aStream Stream used for output. On return
117 * the stream includes correctly formatted attribute field.
119 IMPORT_C void EncodeL( RWriteStream& aStream ) const;
122 * Creates a new instance that is equal to the target.
124 * @return a new instance.
126 IMPORT_C CSdpFmtAttributeField * CloneL() const;
129 * Compares this instance to another for equality.
131 * @param aObj The instance to compare to.
132 * @return ETrue if equal, EFalse if not.
134 IMPORT_C TBool operator== ( const CSdpFmtAttributeField& aObj ) const;
137 * Gets the attribute.
139 * @return The attribute name. The name can be pre-defined
140 * name in the SDP string table or defined by the client.
142 IMPORT_C RStringF Attribute() const;
147 * @return The format.
149 IMPORT_C const TDesC8& Format() const;
152 * Gets the attribute value.
154 * @return The value or an empty descriptor if there is no value part.
156 IMPORT_C const TDesC8& Value() const;
159 * Sets the attribute, format/payload type and attribute value.
161 * @param aAttribute A valid attribute name. It can be a
162 * pre-defined name in the SDP string pool or defined by
164 * @param aFormat A valid format/payload identifier
165 * used in the formatlist of the media description.
166 * @param aValue A valid attribute value or an empty
167 * descriptor to omit the value part.
168 * @leave KErrSdpCodecMediaAttributeField if aAttribute is not rtpmap
172 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue );
174 public: // Internal to codec
177 * Externalizes the object to stream
179 * @param aStream Stream where the object's state will be stored
181 void ExternalizeL( RWriteStream& aStream ) const;
184 * Creates object from the stream data
186 * @param aStream Stream where the object's state will be read
187 * @return Initialized object
189 static CSdpFmtAttributeField* InternalizeL( RReadStream& aStream );
192 * Returns attribute field
194 * @return Attribute field
196 const CSdpAttributeField* AttributeField() const;
198 private: // New methods
201 * Creates object from the stream data.
202 * Does the "2nd phase construction" of internalization.
204 * @param aStream Stream where the object's state will be read
206 void DoInternalizeL( RReadStream& aStream );
209 * Formats value parameters
211 * @param aField Attribute field object
213 void FormatValueParamsL( CSdpAttributeField* aField );
215 private: // Construction and destruction
220 CSdpFmtAttributeField();
223 * Second phase construction
225 * @param aText A string containing a correctly formatted field value
226 * terminated by a CRLF.
228 void ConstructL( const TDesC8& aText );
231 * Second phase construction
233 * @param aAttribute The attribute from the pre-defined SDP string
234 * table or defined by the user
235 * @param aFormat A valid format/payload identifier used in the format
236 * list of the media description.
237 * @param aValue A valid attribute value or an empty descriptor
238 * to omit the value part.
241 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue );
245 * Decode format parameter from string
247 * @param aText A text includeing format parameter.
249 void DecodeFormatL(const TDesC8& aText);
256 CSdpAttributeField* iAttributeField;
257 /** Pointer to the format part*/
259 /** Pointer to the format parameters*/
263 #endif // CSDPFMTATTRIBUTEFIELD_H