epoc32/include/mw/sipheaderbase.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/sipheaderbase.h@2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* 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
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:
williamr@2
    15
* Name        : sipheaderbase.h
williamr@2
    16
* Part of     : SIP Codec
williamr@2
    17
* Interface   : SDK API, SIP Codec API
williamr@2
    18
* Version     : SIP/4.0 
williamr@2
    19
*
williamr@2
    20
*/
williamr@2
    21
williamr@2
    22
williamr@2
    23
williamr@2
    24
williamr@2
    25
#ifndef CSIPHEADERBASE_H
williamr@2
    26
#define CSIPHEADERBASE_H
williamr@2
    27
williamr@2
    28
//  INCLUDES
williamr@2
    29
#include <e32base.h>
williamr@2
    30
#include <s32mem.h>
williamr@2
    31
#include <stringpool.h>
williamr@2
    32
#include "_sipcodecdefs.h"
williamr@2
    33
williamr@2
    34
// CLASS DECLARATION
williamr@2
    35
/**
williamr@2
    36
* @publishedAll
williamr@2
    37
* @released
williamr@2
    38
*
williamr@2
    39
* Class provides a generic interface for all the SIP headers.
williamr@2
    40
*
williamr@2
    41
*  @lib sipcodec.lib
williamr@2
    42
*/
williamr@2
    43
class CSIPHeaderBase : public CBase
williamr@2
    44
	{
williamr@2
    45
	public: // Constructors and destructors
williamr@2
    46
williamr@2
    47
		/**
williamr@2
    48
		* Destructor, deletes the resources of CSIPHeaderBase.
williamr@2
    49
		*/
williamr@2
    50
		IMPORT_C virtual ~CSIPHeaderBase();
williamr@2
    51
williamr@2
    52
	
williamr@2
    53
	public: // New functions
williamr@2
    54
	
williamr@2
    55
		/**
williamr@2
    56
		* Creates a deep-copy of this CSIPHeaderBase object. 
williamr@2
    57
		* The function has to be implemented in each of the sub-classes.
williamr@2
    58
		* @return the deep-copied object, the ownership is transferred.
williamr@2
    59
		*/
williamr@2
    60
		IMPORT_C virtual CSIPHeaderBase* CloneL() const = 0;
williamr@2
    61
williamr@2
    62
		/**
williamr@2
    63
		* Gets the full name of the header
williamr@2
    64
		* The function is implemented in each of the sub-classes.
williamr@2
    65
		* @return the full name of the header for example "From"
williamr@2
    66
		*/
williamr@2
    67
		IMPORT_C virtual RStringF Name() const = 0;
williamr@2
    68
williamr@2
    69
		/**
williamr@2
    70
		* Encodes the header (name and value) into its textual representation.
williamr@2
    71
		* @return a textual representation of the complete header,
williamr@2
    72
		*         the ownership is transferred
williamr@2
    73
		*/
williamr@2
    74
		IMPORT_C HBufC8* ToTextL() const;
williamr@2
    75
williamr@2
    76
		/**
williamr@2
    77
		* Encodes the header (name and value) into its textual representation
williamr@2
    78
		* and pushes it to the CleanupStack.
williamr@2
    79
		* @return a textual representation of the complete header,
williamr@2
    80
		*         the ownership is transferred
williamr@2
    81
		*/
williamr@2
    82
		IMPORT_C HBufC8* ToTextLC() const;
williamr@2
    83
williamr@2
    84
		/**
williamr@2
    85
		* Encodes the header's value into its textual representation.
williamr@2
    86
		* @return a textual representation of the header's value,
williamr@2
    87
		*         the ownership is transferred
williamr@2
    88
		*/
williamr@2
    89
		IMPORT_C virtual HBufC8* ToTextValueL() const = 0;
williamr@2
    90
williamr@2
    91
		/**
williamr@2
    92
		* Encodes the header's value into its textual representation
williamr@2
    93
		* and pushes it to the CleanupStack.
williamr@2
    94
		* @return a textual representation of the header's value,
williamr@2
    95
		*         the ownership is transferred
williamr@2
    96
		*/
williamr@2
    97
		IMPORT_C HBufC8* ToTextValueLC() const;
williamr@2
    98
williamr@2
    99
		/**
williamr@2
   100
		* Writes the object to a RWriteStream
williamr@2
   101
		* @param aWriteStream a stream where the object is to be externalized
williamr@2
   102
		* @param aAddName if ETrue the name of the header is 
williamr@2
   103
		*        also written to the stream
williamr@2
   104
		*/
williamr@2
   105
		IMPORT_C void ExternalizeL(RWriteStream& aWriteStream,
williamr@2
   106
                                   TBool aAddName=ETrue) const;
williamr@2
   107
williamr@2
   108
		/**
williamr@2
   109
		* Checks, if the header supports serialization.
williamr@2
   110
		* In practice all the headers part of the API support it.
williamr@2
   111
		* @return ETrue, if the header supports serialization, 
williamr@2
   112
		*         otherwise EFalse
williamr@2
   113
		*/
williamr@2
   114
		IMPORT_C virtual TBool ExternalizeSupported() const;
williamr@2
   115
williamr@2
   116
		/**
williamr@2
   117
		* Can be used when a RPointerArray<CSIPHeaderBase> needs to be pushed
williamr@2
   118
		* to the CleanupStack for ResetAndDestroy.
williamr@2
   119
		* @param aArray an array of CSIPHeaderBase pointers, 
williamr@2
   120
		*        the ownership of the array is transferred
williamr@2
   121
		*/
williamr@2
   122
		IMPORT_C static void PushLC(RPointerArray<CSIPHeaderBase>* aArray);
williamr@2
   123
williamr@2
   124
williamr@2
   125
	public: // For internal use
williamr@2
   126
williamr@2
   127
        /**
williamr@2
   128
        * @internalComponent
williamr@2
   129
        */
williamr@2
   130
		enum TPreferredPlace
williamr@2
   131
			{
williamr@2
   132
			ETop,
williamr@2
   133
			EMiddleTop,
williamr@2
   134
			EMiddle,
williamr@2
   135
			EMiddleBottom,
williamr@2
   136
			EBottom
williamr@2
   137
			};
williamr@2
   138
williamr@2
   139
        /**
williamr@2
   140
        * @internalComponent
williamr@2
   141
        */	
williamr@2
   142
		TSglQueLink iLink;
williamr@2
   143
williamr@2
   144
        /**
williamr@2
   145
        * @internalComponent
williamr@2
   146
        */
williamr@2
   147
		virtual TBool EncodeMultipleToOneLine() const;
williamr@2
   148
		
williamr@2
   149
        /**
williamr@2
   150
        * @internalComponent
williamr@2
   151
        */		
williamr@2
   152
		virtual TBool MoreThanOneAllowed() const;
williamr@2
   153
		
williamr@2
   154
        /**
williamr@2
   155
        * @internalComponent
williamr@2
   156
        */		
williamr@2
   157
		virtual TBool IsExtensionHeader() const;
williamr@2
   158
		
williamr@2
   159
        /**
williamr@2
   160
        * @internalComponent
williamr@2
   161
        */		
williamr@2
   162
		virtual TBool HasCompactName() const;
williamr@2
   163
		
williamr@2
   164
        /**
williamr@2
   165
        * @internalComponent
williamr@2
   166
        */		
williamr@2
   167
		virtual RStringF CompactName() const;
williamr@2
   168
		
williamr@2
   169
        /**
williamr@2
   170
        * @internalComponent
williamr@2
   171
        */		
williamr@2
   172
		virtual TPreferredPlace PreferredPlaceInMessage() const = 0;
williamr@2
   173
williamr@2
   174
	protected: // Constructors
williamr@2
   175
williamr@2
   176
		CSIPHeaderBase();
williamr@2
   177
williamr@2
   178
	protected: // New functions
williamr@2
   179
williamr@2
   180
		void ExternalizeNameL(RWriteStream& aWriteStream) const;
williamr@2
   181
		
williamr@2
   182
        /**
williamr@2
   183
        * @internalComponent
williamr@2
   184
        */		
williamr@2
   185
		virtual void ExternalizeValueL(RWriteStream& aWriteStream) const;
williamr@2
   186
		
williamr@2
   187
		// Needed for cleanup of a RPointerArray<CSIPHeaderBase>:
williamr@2
   188
		static void ResetAndDestroy(TAny* anArray);
williamr@2
   189
	};
williamr@2
   190
williamr@2
   191
#endif // CSIPHEADERBASE_H
williamr@2
   192
williamr@2
   193
// End of File