epoc32/include/mw/sipacceptencodingheader.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/sipacceptencodingheader.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,179 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* 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
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +* Name        : sipacceptencodingheader.h
    1.19 +* Part of     : SIP Codec
    1.20 +* Interface   : SDK API, SIP Codec API
    1.21 +* Version     : SIP/4.0 
    1.22 +*
    1.23 +*/
    1.24 +
    1.25 +
    1.26 +
    1.27 +
    1.28 +#ifndef CSIPACCEPTENCODINGHEADER_H
    1.29 +#define CSIPACCEPTENCODINGHEADER_H
    1.30 +
    1.31 +//  INCLUDES
    1.32 +#include "sipparameterheaderbase.h"
    1.33 +#include "_sipcodecdefs.h"
    1.34 +
    1.35 +// FORWARD DECLARATIONS
    1.36 +class CSIPAcceptHeaderParams;
    1.37 +
    1.38 +// CLASS DECLARATION
    1.39 +/**
    1.40 +* @publishedAll
    1.41 +* @released
    1.42 +*
    1.43 +* Class provides functions for setting and getting media types and
    1.44 +* parameters in SIP "Accept-Encoding" header.
    1.45 +*
    1.46 +*  @lib sipcodec.lib
    1.47 +*/
    1.48 +class CSIPAcceptEncodingHeader : public CSIPParameterHeaderBase
    1.49 +	{
    1.50 +	public:	// Constructors and destructor
    1.51 +
    1.52 +		/**
    1.53 +		* Constructs a CSIPAcceptEncodingHeader from textual representation 
    1.54 +		* of the header's value part.
    1.55 +		* @param aValue a value part of a "Accept-Encoding"-header
    1.56 +		* @return An array containing one to many CSIPAcceptEncodingHeader
    1.57 +		*         instances
    1.58 +		*/
    1.59 +		IMPORT_C static RPointerArray<CSIPAcceptEncodingHeader> 
    1.60 +			DecodeL(const TDesC8& aValue);
    1.61 +
    1.62 +		/**
    1.63 +		* Creates a new instance of CSIPAcceptEncodingHeader
    1.64 +		* @param aCodings a codings to set.
    1.65 +		* @return a new instance of CSIPAcceptEncodingHeader
    1.66 +		*/
    1.67 +		IMPORT_C static CSIPAcceptEncodingHeader* NewL(const TDesC8& aCodings);
    1.68 +
    1.69 +		/**
    1.70 +		* Creates a new instance of CSIPAcceptEncodingHeader 
    1.71 +		* and puts it onto the cleanup stack
    1.72 +		* @param aCodings a codings to set.
    1.73 +		* @return a new instance of CSIPAcceptEncodingHeader
    1.74 +		*/
    1.75 +		IMPORT_C static CSIPAcceptEncodingHeader* NewLC(const TDesC8& aCodings);
    1.76 +
    1.77 +		/**
    1.78 +		* Destructor, deletes the resources of CSIPAcceptEncodingHeader.
    1.79 +		*/
    1.80 +		IMPORT_C ~CSIPAcceptEncodingHeader();
    1.81 +
    1.82 +	
    1.83 +	public:	// New functions  
    1.84 +
    1.85 +		/**
    1.86 +		* Gets the codings from the "Accept-Encoding" header
    1.87 +		* @return codings
    1.88 +		*/
    1.89 +		IMPORT_C const TDesC8& Codings() const;
    1.90 +
    1.91 +		/**
    1.92 +		* Sets the codings in the "Accept-Encoding" header
    1.93 +		* @param aCodings the codings
    1.94 +		*/
    1.95 +		IMPORT_C void SetCodingsL(const TDesC8& aCodings);
    1.96 +
    1.97 +		/**
    1.98 +		* Gets the value of "q"-parameter
    1.99 +		* @return the "q"-parameter value
   1.100 +		*/
   1.101 +		IMPORT_C TReal QParameter() const;
   1.102 +
   1.103 +		/**
   1.104 +		* Sets the "q"-parameter value
   1.105 +		* @param aQValue a "q"-parameter value to setī
   1.106 +		*/
   1.107 +		IMPORT_C void SetQParameterL(TReal aQValue);
   1.108 +
   1.109 +		/**
   1.110 +		* Constructs an instance of a CSIPAcceptEncodingHeader from a RReadStream
   1.111 +		* @param aReadStream a stream containing the value of the
   1.112 +		*        externalized header object (header name not included).
   1.113 +		* @return An instance of a CSIPAcceptEncodingHeader
   1.114 +		*/
   1.115 +		IMPORT_C static CSIPHeaderBase* 
   1.116 +			InternalizeValueL(RReadStream& aReadStream);
   1.117 +
   1.118 +
   1.119 +	public: // From CSIPHeaderBase
   1.120 +
   1.121 +		/**
   1.122 +		* From CSIPHeaderBase CloneL
   1.123 +		*/
   1.124 +		IMPORT_C CSIPHeaderBase* CloneL() const;
   1.125 +
   1.126 +		/**
   1.127 +		* From CSIPHeaderBase Name
   1.128 +		*/
   1.129 +		IMPORT_C RStringF Name() const;
   1.130 +
   1.131 +
   1.132 +	public: // From CSIPHeaderBase, for internal use
   1.133 +
   1.134 +        /**
   1.135 +		* @internalComponent
   1.136 +		*/
   1.137 +		TBool MoreThanOneAllowed() const;
   1.138 +		
   1.139 +        /**
   1.140 +		* @internalComponent
   1.141 +		*/		
   1.142 +		TPreferredPlace PreferredPlaceInMessage() const;
   1.143 +
   1.144 +	public: // New functions, for internal use
   1.145 +
   1.146 +		static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
   1.147 +
   1.148 +	private: // From CSIPHeaderBase
   1.149 +
   1.150 +		void ExternalizeValueL(RWriteStream& aWriteStream) const;
   1.151 +
   1.152 +	private: // From CSIPParameterHeaderBase
   1.153 +
   1.154 +		HBufC8* ToTextMandatoryPartLC() const;
   1.155 +		void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
   1.156 +		const CSIPParamContainerBase& Params() const;
   1.157 +		CSIPParamContainerBase& Params();
   1.158 +	
   1.159 +	private: // Constructors
   1.160 +
   1.161 +		CSIPAcceptEncodingHeader();
   1.162 +		void ConstructL();
   1.163 +		void ConstructL(const TDesC8& aCodings);
   1.164 +		void ConstructL(const CSIPAcceptEncodingHeader& aAcceptEncodingHeader);
   1.165 +
   1.166 +	private: // New functions
   1.167 +
   1.168 +		void DoInternalizeValueL(RReadStream& aReadStream);
   1.169 +
   1.170 +	private: // Data
   1.171 +
   1.172 +		HBufC8* iCodings;
   1.173 +		CSIPAcceptHeaderParams* iParams;
   1.174 +
   1.175 +	private: // For testing purposes
   1.176 +	
   1.177 +		UNIT_TEST(CSIPAcceptEncodingHeaderTest)
   1.178 +	};
   1.179 +
   1.180 +#endif // CSIPACCEPTENCODINGHEADER_H
   1.181 +
   1.182 +// End of File