realtimenetprots/sipfw/SIP/Codec/api/sipfromheader.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        : sipfromheader.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 CSIPFROMHEADER_H
       
    26 #define CSIPFROMHEADER_H
       
    27 
       
    28 //  INCLUDES
       
    29 #include "sipfromtoheaderbase.h"
       
    30 
       
    31 // CLASS DECLARATION
       
    32 /**
       
    33 * @publishedAll
       
    34 * @released
       
    35 *
       
    36 * Class provides functions for setting and getting SIP "From" header.
       
    37 *
       
    38 *  @lib sipcodec.lib
       
    39 */
       
    40 class CSIPFromHeader : public CSIPFromToHeaderBase
       
    41 	{
       
    42 	public:	// Constructors and destructor
       
    43 
       
    44 		/**
       
    45 		* Constructs a CSIPFromHeader from textual representation 
       
    46 		* of the header's value part.
       
    47 		* @param aValue a value part of a "From"-header (e.g. "<user@host>...")
       
    48 		* @return a new instance of CSIPFromHeader    
       
    49 		*/
       
    50 		IMPORT_C static CSIPFromHeader* DecodeL(const TDesC8& aValue);
       
    51 
       
    52 		/**
       
    53 		* Creates a new instance of CSIPFromHeader
       
    54 		* @pre aSIPAddress != 0
       
    55 		* @param aSIPAddress a name-address, the ownership is transferred.
       
    56 		* @return a new instance of CSIPFromHeader
       
    57 		*/
       
    58 		IMPORT_C static CSIPFromHeader* NewL(CSIPAddress* aSIPAddress);
       
    59 
       
    60 		/**
       
    61 		* Creates a new instance of CSIPFromHeader and puts it to CleanupStack
       
    62 		* @pre aSIPAddress != 0
       
    63 		* @param aSIPAddress a name-address, the ownership is transferred,
       
    64 		* @return a new instance of CSIPFromHeader
       
    65 		*/
       
    66 		IMPORT_C static CSIPFromHeader* NewLC(CSIPAddress* aSIPAddress);
       
    67 
       
    68 		/**
       
    69 		* Creates a deep-copy of a CSIPFromToHeaderBase
       
    70 		* Note that this function can be used for creating a From-header
       
    71 		* using an existing To-header.
       
    72 		* @param aHeader CSIPFromToHeaderBase to be copied
       
    73 		* @return a new instance of CSIPFromHeader
       
    74 		*/
       
    75 		IMPORT_C static CSIPFromHeader* 
       
    76 			NewL(const CSIPFromToHeaderBase& aHeader);
       
    77 
       
    78 		/**
       
    79 		* Creates a deep-copy of a CSIPFromToHeaderBase and 
       
    80 		* puts it to CleanupStack
       
    81 		* Note that this function can be used for creating a From-header
       
    82 		* using an existing To-header.
       
    83 		* @param aHeader CSIPFromToHeaderBase to be copied
       
    84 		* @return a new instance of CSIPFromHeader
       
    85 		*/
       
    86 		IMPORT_C static CSIPFromHeader* 
       
    87 			NewLC(const CSIPFromToHeaderBase& aHeader);
       
    88 
       
    89 		/**
       
    90 		* Destructor, deletes the resources of CSIPFromHeader.
       
    91 		*/
       
    92 		IMPORT_C ~CSIPFromHeader();
       
    93 
       
    94 
       
    95 	public: // New functions
       
    96 
       
    97 		/**
       
    98 		* Constructs an instance of a CSIPFromHeader from a RReadStream
       
    99 		* @param aReadStream a stream containing the value of the
       
   100 		*        externalized object (header name not included). 
       
   101 		* @return an instance of a CSIPFromHeader
       
   102 		*/
       
   103 		IMPORT_C static CSIPHeaderBase* 
       
   104 			InternalizeValueL(RReadStream& aReadStream);
       
   105 
       
   106 
       
   107 	public: // From CSIPHeaderBase
       
   108 
       
   109 		/**
       
   110 		* From CSIPHeaderBase CloneL
       
   111 		*/
       
   112 		IMPORT_C CSIPHeaderBase* CloneL() const;
       
   113 
       
   114 		/**
       
   115 		* From CSIPHeaderBase Name
       
   116 		*/
       
   117 		IMPORT_C RStringF Name() const;
       
   118 
       
   119 
       
   120 	public: // From CSIPHeaderBase, for internal use
       
   121 
       
   122         /**
       
   123         * @internalComponent
       
   124         */
       
   125 		RStringF CompactName() const;
       
   126 
       
   127 	public: // New functions, for internal use
       
   128 
       
   129 		static RPointerArray<CSIPHeaderBase> BaseDecodeL(const TDesC8& aValue);
       
   130 
       
   131 	private: // Constructors
       
   132 
       
   133 		CSIPFromHeader();
       
   134 	};
       
   135 
       
   136 #endif // CSIPFROMHEADER_H
       
   137 
       
   138 // End of File