00001 /* 00002 * ============================================================================= 00003 * Name : SdpFmtAttributeField.h 00004 * Part of : SDP Codec 00005 * Interface : SDK API, SDP Codec API 00006 * Description : 00007 * Version : 1.0 00008 * 00009 * Copyright (c) 2003 Nokia Corporation. 00010 * This material, including documentation and any related 00011 * computer programs, is protected by copyright controlled by 00012 * Nokia Corporation. All rights are reserved. Copying, 00013 * including reproducing, storing, adapting or translating, any 00014 * or all of this material requires the prior written consent of 00015 * Nokia Corporation. This material also contains confidential 00016 * information which may not be disclosed to others without the 00017 * prior written consent of Nokia Corporation. 00018 * ============================================================================= 00019 */ 00020 00021 #ifndef CSDPFMTATTRIBUTEFIELD_H 00022 #define CSDPFMTATTRIBUTEFIELD_H 00023 00024 // INCLUDES 00025 #include <e32base.h> 00026 #include <stringpool.h> 00027 #include "_sdpdefs.h" 00028 00029 // FORWARD DECLARATIONS 00030 class RReadStream; 00031 class RWriteStream; 00032 class CSdpAttributeField; 00033 class TSdpRtpmapValue; 00034 00035 // CLASS DECLARATION 00051 class CSdpFmtAttributeField : public CBase 00052 { 00053 public: // Constructors and destructor 00061 IMPORT_C static CSdpFmtAttributeField* DecodeL( const TDesC8& aText ); 00062 00071 IMPORT_C static CSdpFmtAttributeField* DecodeLC( const TDesC8& aText); 00072 00084 IMPORT_C static CSdpFmtAttributeField* NewL( 00085 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue ); 00086 00099 IMPORT_C static CSdpFmtAttributeField* NewLC( 00100 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue ); 00101 00105 IMPORT_C ~CSdpFmtAttributeField(); 00106 00107 public: // New functions 00108 00116 IMPORT_C void EncodeL( RWriteStream& aStream ) const; 00117 00123 IMPORT_C CSdpFmtAttributeField * CloneL() const; 00124 00131 IMPORT_C TBool operator== ( const CSdpFmtAttributeField& aObj ) const; 00132 00139 IMPORT_C RStringF Attribute() const; 00140 00146 IMPORT_C const TDesC8& Format() const; 00147 00153 IMPORT_C const TDesC8& Value() const; 00154 00168 IMPORT_C void SetL( 00169 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue ); 00170 00171 public: // Internal to codec 00172 00178 void ExternalizeL( RWriteStream& aStream ) const; 00179 00186 static CSdpFmtAttributeField* InternalizeL( RReadStream& aStream ); 00187 00193 const CSdpAttributeField* AttributeField() const; 00194 00195 private: // New methods 00196 00203 void DoInternalizeL( RReadStream& aStream ); 00204 00210 void FormatValueParamsL( CSdpAttributeField* aField ); 00211 00212 private: // Construction and destruction 00213 00217 CSdpFmtAttributeField(); 00218 00225 void ConstructL( const TDesC8& aText ); 00226 00237 void ConstructL( 00238 RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue ); 00239 00240 00246 void DecodeFormatL(const TDesC8& aText); 00247 00248 __DECLARE_TEST; 00249 00250 private: 00251 00252 RStringPool iPool; 00253 CSdpAttributeField* iAttributeField; 00255 TPtrC8 iFormat; 00257 TPtrC8 iValuePart; 00258 }; 00259 00260 // CSDPFMTATTRIBUTEFIELD_H 00261 #endif