realtimenetprots/sipfw/SIP/Codec/api/sipacceptcontactheader.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004-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 "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Name        : sipacceptcontactheader.h
       
    16 * Part of     : SIP Codec
       
    17 * Interface   : SDK API, SIP Codec API
       
    18 * Version     : SIP/4.0 
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CSIPACCEPTCONTACTHEADER_H
       
    26 #define CSIPACCEPTCONTACTHEADER_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "sipparameterheaderbase.h"
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CSIPAcceptContactHeaderParams;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36 * @publishedAll
       
    37 * @released
       
    38 *
       
    39 * Class provides functions for setting and getting parameters in SIP 
       
    40 * "Accept-Contact" header.
       
    41 *
       
    42 *  @lib sipcodec.lib
       
    43 */
       
    44 class CSIPAcceptContactHeader : public CSIPParameterHeaderBase
       
    45 	{
       
    46 	public:	// Constructors and destructor
       
    47 
       
    48 		/**
       
    49 		* Constructs a CSIPAcceptContactHeader from textual representation 
       
    50 		* of the header's value part.
       
    51 		* @param aValue a value part of a "Accept-Contact"-header 
       
    52 		*        (e.g. "*;param=value")
       
    53 		* @return an array containing one to many instances 
       
    54         *         of CSIPAcceptContactHeader   
       
    55 		*/
       
    56 		IMPORT_C static RPointerArray<CSIPAcceptContactHeader>
       
    57             DecodeL(const TDesC8& aValue);
       
    58 
       
    59 		/**
       
    60 		* Creates a new instance of CSIPAcceptContactHeader
       
    61 		* @return a new instance of CSIPAcceptContactHeader
       
    62 		*/
       
    63         IMPORT_C static CSIPAcceptContactHeader* NewL();
       
    64 
       
    65 		/**
       
    66 		* Creates a new instance of CSIPAcceptContactHeader
       
    67         * On return the new instance has left to the CleanupStack.
       
    68 		* @return a new instance of CSIPAcceptContactHeader
       
    69 		*/
       
    70         IMPORT_C static CSIPAcceptContactHeader* NewLC();
       
    71 
       
    72         /**
       
    73 		* Destructor, deletes the resources of CSIPAcceptContactHeader.
       
    74 		*/
       
    75 		IMPORT_C virtual ~CSIPAcceptContactHeader();
       
    76 
       
    77 
       
    78 	public: // New functions
       
    79 
       
    80 		/**
       
    81 		* Compares this instance to another "Accept-Contact" header object.
       
    82 		* Two Accept-Contact-headers are equal, 
       
    83 		* if both contain exactly the same parameters. 
       
    84 		* The order of the parameters is not sufficient.
       
    85 		* @param aHeader a header to compare to
       
    86 		* @return ETrue, if the objects are equal otherwise EFalse
       
    87 		*/
       
    88 		IMPORT_C TBool operator==(const CSIPAcceptContactHeader& aHeader) const;
       
    89 
       
    90         /**
       
    91 		* Constructs an instance of a CSIPAcceptContactHeader from a RReadStream
       
    92 		* @param aReadStream a stream containing the value of the
       
    93 		*        externalized object (header name not included). 
       
    94 		* @return an instance of a CSIPAcceptContactHeader
       
    95 		*/
       
    96 		IMPORT_C static CSIPHeaderBase* 
       
    97             InternalizeValueL(RReadStream& aReadStream);
       
    98         
       
    99 
       
   100 	public: // From CSIPHeaderBase
       
   101 
       
   102 		/**
       
   103 		* From CSIPHeaderBase CloneL
       
   104 		*/
       
   105 		IMPORT_C CSIPHeaderBase* CloneL() const;
       
   106 
       
   107 		/**
       
   108 		* From CSIPHeaderBase Name
       
   109 		*/
       
   110 		IMPORT_C RStringF Name() const;
       
   111 
       
   112 
       
   113 	public: // From CSIPHeaderBase, for internal use
       
   114 
       
   115         /**
       
   116 		* @internalComponent
       
   117 		*/
       
   118         TBool HasCompactName() const;
       
   119         
       
   120         /**
       
   121 		* @internalComponent
       
   122 		*/        
       
   123         RStringF CompactName() const;
       
   124         
       
   125         /**
       
   126 		* @internalComponent
       
   127 		*/        
       
   128         TBool MoreThanOneAllowed() const;
       
   129         
       
   130         /**
       
   131 		* @internalComponent
       
   132 		*/        
       
   133 		TPreferredPlace PreferredPlaceInMessage() const;
       
   134 
       
   135 	public: // New functions, for internal use
       
   136 
       
   137 		static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
       
   138 
       
   139 	private: // From CSIPHeaderBase
       
   140 
       
   141 		void ExternalizeValueL(RWriteStream& aWriteStream) const;
       
   142 
       
   143 	private: // From CSIPParameterHeaderBase
       
   144 
       
   145 		HBufC8* ToTextMandatoryPartLC() const;
       
   146 		void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
       
   147 		const CSIPParamContainerBase& Params() const;
       
   148 		CSIPParamContainerBase& Params();
       
   149 
       
   150 	private: // Constructors
       
   151 
       
   152         CSIPAcceptContactHeader();
       
   153         void ConstructL();
       
   154 		void ConstructL(const CSIPAcceptContactHeader& aAcceptContactHeader);
       
   155 
       
   156 	private: // New functions
       
   157 
       
   158 		void DoInternalizeValueL(RReadStream& aReadStream);
       
   159 
       
   160 	private: // Data
       
   161 
       
   162 		CSIPAcceptContactHeaderParams* iParams;
       
   163 
       
   164 	private: // For testing purposes
       
   165 #ifdef CPPUNIT_TEST	
       
   166 		friend class CSIPAcceptContactHeaderTest;
       
   167 #endif
       
   168 	};
       
   169 
       
   170 #endif // CSIPACCEPTCONTACTHEADER_H
       
   171 
       
   172 // End of File