epoc32/include/mw/sipextensionheader.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/sipextensionheader.h	Wed Mar 31 12:27:01 2010 +0100
     1.3 @@ -0,0 +1,186 @@
     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        : sipextensionheader.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 CSIPEXTENSIONHEADER_H
    1.29 +#define CSIPEXTENSIONHEADER_H
    1.30 +
    1.31 +//  INCLUDES
    1.32 +#include "sipheaderbase.h"
    1.33 +#include "_sipcodecdefs.h"
    1.34 +
    1.35 +
    1.36 +// CLASS DECLARATION
    1.37 +/**
    1.38 +* @publishedAll
    1.39 +* @released
    1.40 +*
    1.41 +* The class stores unknown and extension headers that are either not 
    1.42 +* supported by the current SIP codec implementation or not specified in
    1.43 +* current SIP RFC or both.
    1.44 +*
    1.45 +*  @lib sipcodec.lib
    1.46 +*/
    1.47 +class CSIPExtensionHeader : public CSIPHeaderBase
    1.48 +	{
    1.49 +	public:	// Constructors and destructor
    1.50 +
    1.51 +		/**
    1.52 +		* Creates a new instance of CSIPExtensionHeader
    1.53 +		* @param aName the full or compact name of the header
    1.54 +		* @param aValue the value of the header
    1.55 +		* @return a new instance of CSIPExtensionHeader
    1.56 +		*/
    1.57 +		IMPORT_C static CSIPExtensionHeader* 
    1.58 +			NewL(const TDesC8& aName, const TDesC8& aValue);
    1.59 +
    1.60 +		/**
    1.61 +		* Creates a new instance of CSIPExtensionHeader 
    1.62 +		* and puts it to CleanupStack
    1.63 +		* @param aName the full or compact name of the header
    1.64 +		* @param aValue the value of the header
    1.65 +		* @return a new instance of CSIPExtensionHeader
    1.66 +		*/
    1.67 +		IMPORT_C static CSIPExtensionHeader* 
    1.68 +			NewLC(const TDesC8& aName, const TDesC8& aValue);
    1.69 +
    1.70 +		/**
    1.71 +		* Destructor, deletes the resources of CSIPExtensionHeader.
    1.72 +		*/
    1.73 +		IMPORT_C ~CSIPExtensionHeader();
    1.74 +
    1.75 +
    1.76 +	public: // New functions
    1.77 +
    1.78 +		/**
    1.79 +		* Sets the header value
    1.80 +		* @param aValue the header value to be set
    1.81 +		*/
    1.82 +		IMPORT_C void SetValueL(const TDesC8& aValue);
    1.83 +
    1.84 +		/**
    1.85 +		* Gets the header value
    1.86 +		* @return the header value
    1.87 +		*/
    1.88 +		IMPORT_C const TDesC8& Value() const;
    1.89 +
    1.90 +		/**
    1.91 +		* Constructs an instance of a CSIPExtensionHeader from a RReadStream
    1.92 +		* @param aReadStream a stream containing the value of the
    1.93 +		*        externalized header object (header name not included).
    1.94 +		* @return an instance of a CSIPExtensionHeader
    1.95 +		*/
    1.96 +
    1.97 +		IMPORT_C static CSIPExtensionHeader* 
    1.98 +			InternalizeValueL(RReadStream& aReadStream);
    1.99 +
   1.100 +
   1.101 +	public: // From CSIPHeaderBase
   1.102 +
   1.103 +		/**
   1.104 +		* From CSIPHeaderBase CloneL
   1.105 +		*/
   1.106 +		IMPORT_C CSIPHeaderBase* CloneL() const;
   1.107 +
   1.108 +		/**
   1.109 +		* From CSIPHeaderBase Name
   1.110 +		*/
   1.111 +		IMPORT_C RStringF Name() const;
   1.112 +
   1.113 +		/**
   1.114 +		* From CSIPHeaderBase ToTextValueL
   1.115 +		*/
   1.116 +		IMPORT_C HBufC8* ToTextValueL() const;
   1.117 +
   1.118 +		/**
   1.119 +		* From CSIPHeaderBase ExternalizeSupported
   1.120 +		*/
   1.121 +		IMPORT_C TBool ExternalizeSupported() const;
   1.122 +
   1.123 +
   1.124 +	public: // New functions, for internal use
   1.125 +
   1.126 +		void SetNameL(const TDesC8& aName);
   1.127 +
   1.128 +	public: // From CSIPHeaderBase, for internal use
   1.129 +
   1.130 +        /**
   1.131 +        * @internalComponent
   1.132 +        */	
   1.133 +		TBool IsExtensionHeader() const;
   1.134 +		
   1.135 +        /**
   1.136 +        * @internalComponent
   1.137 +        */		
   1.138 +		TBool EncodeMultipleToOneLine() const;
   1.139 +		
   1.140 +        /**
   1.141 +        * @internalComponent
   1.142 +        */		
   1.143 +		TBool MoreThanOneAllowed() const;
   1.144 +		
   1.145 +        /**
   1.146 +        * @internalComponent
   1.147 +        */		
   1.148 +		TBool HasCompactName() const;
   1.149 +		
   1.150 +        /**
   1.151 +        * @internalComponent
   1.152 +        */		
   1.153 +		RStringF CompactName() const;
   1.154 +		
   1.155 +        /**
   1.156 +        * @internalComponent
   1.157 +        */		
   1.158 +		TPreferredPlace PreferredPlaceInMessage() const;
   1.159 +
   1.160 +	private: // From CSIPHeaderBase
   1.161 +
   1.162 +		void ExternalizeValueL(RWriteStream& aWriteStream) const;
   1.163 +
   1.164 +	private: // Constructors
   1.165 +
   1.166 +		CSIPExtensionHeader();
   1.167 +		void ConstructL(const TDesC8& aName, const TDesC8& aValue);
   1.168 +		void ConstructL(const CSIPExtensionHeader& aExtensionHeader);
   1.169 +		void DoInternalizeValueL(RReadStream& aReadStream);
   1.170 +
   1.171 +	private: // New functions
   1.172 +
   1.173 +		TBool CheckValue (const TDesC8& aValue);
   1.174 +	
   1.175 +	private: // Data
   1.176 +
   1.177 +		// data
   1.178 +		RStringF iName;
   1.179 +		HBufC8* iValue;
   1.180 +
   1.181 +	private: // For testing purposes
   1.182 +	
   1.183 +		UNIT_TEST(CSIPExtensionHeaderTest)
   1.184 +		UNIT_TEST(CSIPHeaderLookupTest)
   1.185 +	};
   1.186 +
   1.187 +#endif // CSIPEXTENSIONHEADER_H
   1.188 +
   1.189 +// End of File