epoc32/include/sdprtpmapvalue.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 sdprtpmapvalue.h
     1 /*
       
     2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name          : SdpRtpmapValue.h
       
    16 * Part of       : SDP Codec
       
    17 * Interface     : SDK API, SDP Codec API
       
    18 * Version       : 1.0
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 #ifndef TSDPRTPMAPVALUE_H
       
    25 #define TSDPRTPMAPVALUE_H
       
    26 
       
    27 // INCLUDES
       
    28 #include <e32std.h>
       
    29 #include <stringpool.h>
       
    30 #include "_sdpdefs.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class RWriteStream;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37  *  @publishedAll
       
    38  *  @released
       
    39  *
       
    40  *	Utility class for manipulating the value of an rtpmap-attribute.
       
    41  *
       
    42  *	The normative reference for correct formatting and values is
       
    43  *	draft-ietf-mmusic-sdp-new-14 unless specified otherwise in
       
    44  *  member documentation. The implementation supports this normative
       
    45  *  reference, but does not enforce it fully. 
       
    46  *
       
    47  *  @lib sdpcodec.lib
       
    48  */
       
    49 class TSdpRtpmapValue
       
    50 	{
       
    51     public: // Constructors and destructor
       
    52 
       
    53 		/**
       
    54 		 *	Initializes the instance to refer to the given rtpmap components.
       
    55 		 *	The parameters must stay in scope as long as this instance exists.
       
    56 		 *	Otherwise, the member variables of this class will point to
       
    57 		 *	a released memory.
       
    58 		 *  
       
    59 		 *	@param aEncodingName Valid rtpmap encoding name value.	
       
    60 		 *	@param aClockrate Valid rtpmap clockrate value.	
       
    61 		 *	@param aEncodingParameters Valid rtpmap encoding 
       
    62          *         parameter list.	
       
    63 		 */
       
    64 		IMPORT_C TSdpRtpmapValue( 
       
    65 						const TPtrC8& aEncodingName,
       
    66 						const TPtrC8& aClockrate,
       
    67 						const TPtrC8& aEncodingParameters );
       
    68 
       
    69     public: // New functions
       
    70 
       
    71 		/**
       
    72 		 *	Tries to parse a string as an rtpmap attribute value up to the end 
       
    73 		 *	of the string or CRLF, whichever comes first, and set pointers to 
       
    74 		 *	the components found. The parameter must stay in scope as long as 
       
    75          *  this instance exists. Otherwise, the member variables of this class 
       
    76          *  will point to a released memory.
       
    77 		 *         
       
    78 		 *	@param aText String containing the value of an rtpmap attribute.
       
    79          *  @return a new instance 
       
    80 		 *	@leave  KErrArgument if parsing fails.
       
    81 		 */
       
    82 		IMPORT_C static TSdpRtpmapValue DecodeL( const TDesC8& aText );
       
    83 
       
    84 		/**
       
    85 		 *	Outputs the attribute value formatted according to SDP syntax.
       
    86 		 *  The field terminating CRLF is not included in the output.
       
    87          *  When constructing CSdpFmtAttributeField, return value of this 
       
    88          *  function can be used as aValue in CSdpFmtAttributeField::NewL
       
    89          *  (RStringF aAttribute, const TDesC8& aFormat, const TDesC8& aValue)
       
    90          *  function.
       
    91 		 * 
       
    92          *  @return Encoded value. Ovnership of buffer is changed to caller.
       
    93 		 */
       
    94 		IMPORT_C HBufC8* EncodeL() const;        
       
    95 
       
    96     public: // Data
       
    97 
       
    98 		/** 
       
    99 		* Encoding name part of an rtpmap value 
       
   100 		* @internalComponent
       
   101 		*/
       
   102 		TPtrC8 iEncName;
       
   103 
       
   104 		/** 
       
   105 		* Clockrate part of an rtpmap value. 
       
   106 		* @internalComponent
       
   107 		*/
       
   108 		TPtrC8 iClockrate;
       
   109 
       
   110 		/** 
       
   111 		* Encoding parameters part of an rtpmap value. 
       
   112 		* @internalComponent
       
   113 		*/
       
   114 		TPtrC8 iEncParams;
       
   115 	};
       
   116 
       
   117 #endif // TSDPRTPMAPVALUE_H