epoc32/include/sipcseqheader.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/sipcseqheader.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/sipcseqheader.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,168 @@
     1.4 -sipcseqheader.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        : sipcseqheader.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 CSIPCSEQHEADER_H
    1.30 +#define CSIPCSEQHEADER_H
    1.31 +
    1.32 +//  INCLUDES
    1.33 +#include "sipheaderbase.h"
    1.34 +#include "_sipcodecdefs.h"
    1.35 +
    1.36 +// CLASS DECLARATION
    1.37 +/**
    1.38 +* @publishedAll
    1.39 +* @released
    1.40 +*
    1.41 +* Class provides functions for setting and getting sequence number and
    1.42 +* method in SIP "CSeq" header.
    1.43 +*
    1.44 +*  @lib sipcodec.lib
    1.45 +*/
    1.46 +class CSIPCSeqHeader : public CSIPHeaderBase
    1.47 +	{
    1.48 +	public: // Constructors and destructor
    1.49 +
    1.50 +		/**
    1.51 +		* Constructs a CSIPCSeqHeader from textual representation 
    1.52 +		* of the header's value part.
    1.53 +		* @param aValue a value part of a "CSeq"-header (e.g. "1 REGISTER")
    1.54 +		* @return a new instance of CSIPCSeqHeader.  
    1.55 +		*/
    1.56 +		IMPORT_C static CSIPCSeqHeader* DecodeL(const TDesC8& aValue);
    1.57 +
    1.58 +		/**
    1.59 +		* Creates a new instance of CSIPCSeqHeader
    1.60 +		* @param aSeq a sequence number to set.
    1.61 +		* @param aMethod a method to set. For example "REGISTER"
    1.62 +		* @return a new instance of CSIPCSeqHeader
    1.63 +		*/
    1.64 +		IMPORT_C static CSIPCSeqHeader* NewL(TUint aSeq, RStringF aMethod);
    1.65 +
    1.66 +		/**
    1.67 +		* Creates a new instance of CSIPCSeqHeader and puts it to CleanupStack
    1.68 +		* @param aSeq a sequence number to set.
    1.69 +		* @param aMethod a method to set. For example "REGISTER"
    1.70 +		* @return a new instance of CSIPCSeqHeader
    1.71 +		*/
    1.72 +		IMPORT_C static CSIPCSeqHeader* NewLC(TUint aSeq, RStringF aMethod);
    1.73 +
    1.74 +		/**
    1.75 +		* Destructor, deletes the resources of CSIPCSeqHeader.
    1.76 +		*/
    1.77 +		IMPORT_C ~CSIPCSeqHeader();
    1.78 +
    1.79 +
    1.80 +	public: // New functions
    1.81 +
    1.82 +		/**
    1.83 +		* Gets the sequence number from the "CSeq" header
    1.84 +		* @return the current sequence number
    1.85 +		*/
    1.86 +		IMPORT_C TUint Seq() const;
    1.87 +
    1.88 +		/**
    1.89 +		* Sets the sequence number in the "CSeq" header
    1.90 +		* @param aSeq a sequence number to set
    1.91 +		*/
    1.92 +		IMPORT_C void SetSeq(TUint aSeq);
    1.93 +
    1.94 +		/**
    1.95 +		* Gets the method from the "CSeq" header
    1.96 +		* @return the method 
    1.97 +		*/
    1.98 +		IMPORT_C RStringF Method() const;
    1.99 +
   1.100 +		/**
   1.101 +		* Sets the method in the "CSeq" header
   1.102 +		* @param aMethod a method to set
   1.103 +		*/
   1.104 +		IMPORT_C void SetMethodL(RStringF aMethod);
   1.105 +
   1.106 +		/**
   1.107 +		* Constructs an instance of a CSIPCSeqHeader from a RReadStream
   1.108 +		* @param aReadStream a stream containing the value of the
   1.109 +		*	     externalized object (header name not included). 
   1.110 +		* @return an instance of a CSIPCSeqHeader
   1.111 +		*/
   1.112 +		IMPORT_C static CSIPHeaderBase* 
   1.113 +			InternalizeValueL(RReadStream& aReadStream);
   1.114 +
   1.115 +
   1.116 +	public: // From CSIPHeaderBase
   1.117 +
   1.118 +		/**
   1.119 +		* From CSIPHeaderBase CloneL
   1.120 +		*/
   1.121 +		IMPORT_C CSIPHeaderBase* CloneL() const;
   1.122 +
   1.123 +		/**
   1.124 +		* From CSIPHeaderBase Name
   1.125 +		*/
   1.126 +		IMPORT_C RStringF Name() const;
   1.127 +
   1.128 +		/**
   1.129 +		* From CSIPHeaderBase ToTextValueL
   1.130 +		*/
   1.131 +		IMPORT_C HBufC8* ToTextValueL() const;
   1.132 +
   1.133 +
   1.134 +	public: // From CSIPHeaderBase, for internal use
   1.135 +
   1.136 +        /**
   1.137 +        * @internalComponent
   1.138 +        */
   1.139 +		TPreferredPlace PreferredPlaceInMessage () const;
   1.140 +
   1.141 +	public: // New functions, for internal use
   1.142 +
   1.143 +		static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
   1.144 +
   1.145 +	private: // From CSIPHeaderBase
   1.146 +
   1.147 +		void ExternalizeValueL (RWriteStream& aWriteStream) const;
   1.148 +
   1.149 +	private: // Constructors
   1.150 +
   1.151 +		CSIPCSeqHeader();
   1.152 +		void ConstructL(TUint aCSeq, RStringF aMethod);
   1.153 +	
   1.154 +	private: // New functions
   1.155 +		
   1.156 +		void DoInternalizeValueL(RReadStream& aReadStream);
   1.157 +		void ParseL(const TDesC8& aValue);
   1.158 +		void SetMethodL(const TDesC8& aMethod);
   1.159 +
   1.160 +	private: // Data
   1.161 +
   1.162 +		TUint iSeq;
   1.163 +		RStringF iMethod;
   1.164 +
   1.165 +	private: // For testing purposes
   1.166 +	
   1.167 +		UNIT_TEST(CSIPCSeqHeaderTest)
   1.168 +	};
   1.169 +
   1.170 +#endif // CSIPCSEQHEADER_H
   1.171 +
   1.172 +// End of File