epoc32/include/sipextensionheader.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/sipextensionheader.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/sipextensionheader.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,186 @@
     1.4 -sipextensionheader.h
     1.5 +/*
     1.6 +* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.7 +* All rights reserved.
     1.8 +* This component and the accompanying materials are made available
     1.9 +* 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.10 +* which accompanies this distribution, and is available
    1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.12 +*
    1.13 +* Initial Contributors:
    1.14 +* Nokia Corporation - initial contribution.
    1.15 +*
    1.16 +* Contributors:
    1.17 +*
    1.18 +* Description:
    1.19 +* Name        : sipextensionheader.h
    1.20 +* Part of     : SIP Codec
    1.21 +* Interface   : SDK API, SIP Codec API
    1.22 +* Version     : SIP/4.0 
    1.23 +*
    1.24 +*/
    1.25 +
    1.26 +
    1.27 +
    1.28 +
    1.29 +#ifndef CSIPEXTENSIONHEADER_H
    1.30 +#define CSIPEXTENSIONHEADER_H
    1.31 +
    1.32 +//  INCLUDES
    1.33 +#include "sipheaderbase.h"
    1.34 +#include "_sipcodecdefs.h"
    1.35 +
    1.36 +
    1.37 +// CLASS DECLARATION
    1.38 +/**
    1.39 +* @publishedAll
    1.40 +* @released
    1.41 +*
    1.42 +* The class stores unknown and extension headers that are either not 
    1.43 +* supported by the current SIP codec implementation or not specified in
    1.44 +* current SIP RFC or both.
    1.45 +*
    1.46 +*  @lib sipcodec.lib
    1.47 +*/
    1.48 +class CSIPExtensionHeader : public CSIPHeaderBase
    1.49 +	{
    1.50 +	public:	// Constructors and destructor
    1.51 +
    1.52 +		/**
    1.53 +		* Creates a new instance of CSIPExtensionHeader
    1.54 +		* @param aName the full or compact name of the header
    1.55 +		* @param aValue the value of the header
    1.56 +		* @return a new instance of CSIPExtensionHeader
    1.57 +		*/
    1.58 +		IMPORT_C static CSIPExtensionHeader* 
    1.59 +			NewL(const TDesC8& aName, const TDesC8& aValue);
    1.60 +
    1.61 +		/**
    1.62 +		* Creates a new instance of CSIPExtensionHeader 
    1.63 +		* and puts it to CleanupStack
    1.64 +		* @param aName the full or compact name of the header
    1.65 +		* @param aValue the value of the header
    1.66 +		* @return a new instance of CSIPExtensionHeader
    1.67 +		*/
    1.68 +		IMPORT_C static CSIPExtensionHeader* 
    1.69 +			NewLC(const TDesC8& aName, const TDesC8& aValue);
    1.70 +
    1.71 +		/**
    1.72 +		* Destructor, deletes the resources of CSIPExtensionHeader.
    1.73 +		*/
    1.74 +		IMPORT_C ~CSIPExtensionHeader();
    1.75 +
    1.76 +
    1.77 +	public: // New functions
    1.78 +
    1.79 +		/**
    1.80 +		* Sets the header value
    1.81 +		* @param aValue the header value to be set
    1.82 +		*/
    1.83 +		IMPORT_C void SetValueL(const TDesC8& aValue);
    1.84 +
    1.85 +		/**
    1.86 +		* Gets the header value
    1.87 +		* @return the header value
    1.88 +		*/
    1.89 +		IMPORT_C const TDesC8& Value() const;
    1.90 +
    1.91 +		/**
    1.92 +		* Constructs an instance of a CSIPExtensionHeader from a RReadStream
    1.93 +		* @param aReadStream a stream containing the value of the
    1.94 +		*        externalized header object (header name not included).
    1.95 +		* @return an instance of a CSIPExtensionHeader
    1.96 +		*/
    1.97 +
    1.98 +		IMPORT_C static CSIPExtensionHeader* 
    1.99 +			InternalizeValueL(RReadStream& aReadStream);
   1.100 +
   1.101 +
   1.102 +	public: // From CSIPHeaderBase
   1.103 +
   1.104 +		/**
   1.105 +		* From CSIPHeaderBase CloneL
   1.106 +		*/
   1.107 +		IMPORT_C CSIPHeaderBase* CloneL() const;
   1.108 +
   1.109 +		/**
   1.110 +		* From CSIPHeaderBase Name
   1.111 +		*/
   1.112 +		IMPORT_C RStringF Name() const;
   1.113 +
   1.114 +		/**
   1.115 +		* From CSIPHeaderBase ToTextValueL
   1.116 +		*/
   1.117 +		IMPORT_C HBufC8* ToTextValueL() const;
   1.118 +
   1.119 +		/**
   1.120 +		* From CSIPHeaderBase ExternalizeSupported
   1.121 +		*/
   1.122 +		IMPORT_C TBool ExternalizeSupported() const;
   1.123 +
   1.124 +
   1.125 +	public: // New functions, for internal use
   1.126 +
   1.127 +		void SetNameL(const TDesC8& aName);
   1.128 +
   1.129 +	public: // From CSIPHeaderBase, for internal use
   1.130 +
   1.131 +        /**
   1.132 +        * @internalComponent
   1.133 +        */	
   1.134 +		TBool IsExtensionHeader() const;
   1.135 +		
   1.136 +        /**
   1.137 +        * @internalComponent
   1.138 +        */		
   1.139 +		TBool EncodeMultipleToOneLine() const;
   1.140 +		
   1.141 +        /**
   1.142 +        * @internalComponent
   1.143 +        */		
   1.144 +		TBool MoreThanOneAllowed() const;
   1.145 +		
   1.146 +        /**
   1.147 +        * @internalComponent
   1.148 +        */		
   1.149 +		TBool HasCompactName() const;
   1.150 +		
   1.151 +        /**
   1.152 +        * @internalComponent
   1.153 +        */		
   1.154 +		RStringF CompactName() const;
   1.155 +		
   1.156 +        /**
   1.157 +        * @internalComponent
   1.158 +        */		
   1.159 +		TPreferredPlace PreferredPlaceInMessage() const;
   1.160 +
   1.161 +	private: // From CSIPHeaderBase
   1.162 +
   1.163 +		void ExternalizeValueL(RWriteStream& aWriteStream) const;
   1.164 +
   1.165 +	private: // Constructors
   1.166 +
   1.167 +		CSIPExtensionHeader();
   1.168 +		void ConstructL(const TDesC8& aName, const TDesC8& aValue);
   1.169 +		void ConstructL(const CSIPExtensionHeader& aExtensionHeader);
   1.170 +		void DoInternalizeValueL(RReadStream& aReadStream);
   1.171 +
   1.172 +	private: // New functions
   1.173 +
   1.174 +		TBool CheckValue (const TDesC8& aValue);
   1.175 +	
   1.176 +	private: // Data
   1.177 +
   1.178 +		// data
   1.179 +		RStringF iName;
   1.180 +		HBufC8* iValue;
   1.181 +
   1.182 +	private: // For testing purposes
   1.183 +	
   1.184 +		UNIT_TEST(CSIPExtensionHeaderTest)
   1.185 +		UNIT_TEST(CSIPHeaderLookupTest)
   1.186 +	};
   1.187 +
   1.188 +#endif // CSIPEXTENSIONHEADER_H
   1.189 +
   1.190 +// End of File