realtimenetprots/sipfw/SIP/Codec/api/sipcontentdispositionheader.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        : sipcontentdispositionheader.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 CSIPCONTENTDISPOSITIONHEADER_H
       
    26 #define CSIPCONTENTDISPOSITIONHEADER_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "sipparameterheaderbase.h"
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CSIPHeaderGenericParams;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36 * @publishedAll
       
    37 * @released
       
    38 *
       
    39 * Class provides functions for setting and getting parameters in 
       
    40 * SIP "Content-Disposition" header.
       
    41 *
       
    42 *  @lib sipcodec.lib
       
    43 */
       
    44 class CSIPContentDispositionHeader : public CSIPParameterHeaderBase
       
    45 	{
       
    46 	public:	// Constructors and destructor
       
    47 	
       
    48 		/**
       
    49 		* Constructs a CSIPContentDispositionHeader from textual representation 
       
    50 		* of the header's value part.
       
    51 		* @param aValue a value part of a "Content-Disposition"-header
       
    52 		* @return a new instance of CSIPContentDispositionHeader
       
    53 		*/
       
    54 		IMPORT_C static CSIPContentDispositionHeader* 
       
    55 			DecodeL (const TDesC8& aValue);
       
    56 
       
    57 		/**
       
    58 		* Creates a new instance of CSIPContentDispositionHeader
       
    59 		* @param aDispType a Disp-Type value
       
    60 		* @return a new instance of CSIPContentDispositionHeader
       
    61 		*/
       
    62 		IMPORT_C static CSIPContentDispositionHeader* 
       
    63 			NewL(const TDesC8& aDispType);
       
    64 
       
    65 		/**
       
    66 		* Creates a new instance of CSIPContentDispositionHeader 
       
    67 		* and puts it to CleanupStack
       
    68 		* @param aDispType a Disp-Type value
       
    69 		* @return a new instance of CSIPContentDispositionHeader
       
    70 		*/
       
    71 		IMPORT_C static CSIPContentDispositionHeader* 
       
    72 			NewLC(const TDesC8& aDispType);
       
    73 
       
    74 		/**
       
    75 		* Destructor. deletes the resources of CSIPContentDispositionHeader.
       
    76 		*/
       
    77 		IMPORT_C ~CSIPContentDispositionHeader();
       
    78 
       
    79 
       
    80 	public: // New functions
       
    81 
       
    82 		/**
       
    83 		* Gets the disp-type parameter from the "Content-Disposition" header
       
    84 		* @return the disp-type parameter
       
    85 		*/
       
    86 		IMPORT_C const TDesC8& DispType() const;
       
    87 
       
    88 		/**
       
    89 		* Sets the disp-type parameter in the "Content-Disposition" header; 
       
    90 		* @param aTag a disp-type parameter to set
       
    91 		*/
       
    92 		IMPORT_C void SetDispTypeL(const TDesC8& aDispType);
       
    93 	
       
    94 		/**
       
    95 		* Constructs an instance of a CSIPContentDispositionHeader 
       
    96 		* from a RReadStream
       
    97 		* @param aReadStream a stream containing the value of the
       
    98 		*        externalized object (header name not included). 
       
    99 		* @return an instance of a CSIPContentDispositionHeader
       
   100 		*/
       
   101 		IMPORT_C static CSIPHeaderBase* 
       
   102 			InternalizeValueL(RReadStream& aReadStream);
       
   103 
       
   104 
       
   105 	public: // From CSIPHeaderBase
       
   106 
       
   107 		/**
       
   108 		* From CSIPHeaderBase CloneL
       
   109 		*/
       
   110 		IMPORT_C CSIPHeaderBase* CloneL() const;
       
   111 
       
   112 		/**
       
   113 		* From CSIPHeaderBase Name
       
   114 		*/
       
   115 		IMPORT_C RStringF Name() const;
       
   116 
       
   117 
       
   118 	public: // From CSIPHeaderBase, for internal use
       
   119 
       
   120         /**
       
   121         * @internalComponent
       
   122         */	
       
   123 		TPreferredPlace PreferredPlaceInMessage() const;
       
   124 
       
   125 	public: // New functions, for internal use
       
   126 
       
   127 		static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
       
   128 
       
   129 	private: // From CSIPHeaderBase
       
   130 
       
   131 		void ExternalizeValueL(RWriteStream& aWriteStream) const;
       
   132 
       
   133 	private: // From CSIPParameterHeaderBase
       
   134 	
       
   135 		HBufC8* ToTextMandatoryPartLC() const;
       
   136 		void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
       
   137 		const CSIPParamContainerBase& Params() const;
       
   138 		CSIPParamContainerBase& Params();
       
   139 
       
   140 	private: // Constructors
       
   141 
       
   142 		CSIPContentDispositionHeader();
       
   143 		void ConstructL();
       
   144 		void ConstructL(const TDesC8& aDispType);
       
   145 		void ConstructL(const TDesC8& aDispType, const TDesC8& aHandlingParam);
       
   146 		void ConstructL(const CSIPContentDispositionHeader& aHeader);
       
   147 
       
   148 	private: // New functions
       
   149 
       
   150 		void DoInternalizeValueL(RReadStream& aReadStream);
       
   151 
       
   152 	private: // Data
       
   153 
       
   154 		HBufC8* iDispType;
       
   155 		CSIPHeaderGenericParams* iParams;
       
   156 
       
   157 	private: // For testing purposes
       
   158 #ifdef CPPUNIT_TEST	
       
   159 		friend class CSIPContentDispositionHeaderTest;
       
   160 #endif
       
   161 	};
       
   162 
       
   163 #endif // CSIPCONTENTDISPOSITIONHEADER_H
       
   164 
       
   165 // End of File