epoc32/include/mw/sipauthheaderbase.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:27:01 +0100
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 epoc32/include/sipauthheaderbase.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) 2006-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          : sipauthheaderbase.h
williamr@2
    16
* Part of       : SIP Codec
williamr@2
    17
* Version       : SIP/5.0 
williamr@2
    18
*
williamr@2
    19
*/
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
#ifndef CSIPAUTHHEADERBASE_H
williamr@2
    24
#define CSIPAUTHHEADERBASE_H
williamr@2
    25
williamr@2
    26
//  INCLUDES
williamr@2
    27
#include "sipheaderbase.h"
williamr@2
    28
#include "_sipcodecdefs.h"
williamr@2
    29
williamr@2
    30
// FORWARD DECLARATIONS
williamr@2
    31
class CSIPParamContainerBase;
williamr@2
    32
williamr@2
    33
// CLASS DECLARATION
williamr@2
    34
/**
williamr@2
    35
* @publishedAll
williamr@2
    36
* @released
williamr@2
    37
*
williamr@2
    38
* A base class for SIP Authorization-, Proxy-Authenticate-, 
williamr@2
    39
* Proxy-Authorization- and WWW-Authenticate-headers
williamr@2
    40
*
williamr@2
    41
* @lib sipcodec.lib
williamr@2
    42
*/
williamr@2
    43
class CSIPAuthHeaderBase : public CSIPHeaderBase
williamr@2
    44
	{
williamr@2
    45
	public: // Constructors and destructor
williamr@2
    46
williamr@2
    47
		/**
williamr@2
    48
		* Destructor.
williamr@2
    49
		*/
williamr@2
    50
		IMPORT_C virtual ~CSIPAuthHeaderBase();
williamr@2
    51
williamr@2
    52
williamr@2
    53
	public:	// New functions
williamr@2
    54
williamr@2
    55
		/**
williamr@2
    56
		* @return the value of the auth-scheme
williamr@2
    57
		*/
williamr@2
    58
		IMPORT_C RStringF AuthScheme() const;
williamr@2
    59
williamr@2
    60
		/**
williamr@2
    61
		* Checks if a parameter is present
williamr@2
    62
		* @param aName the name of the parameter
williamr@2
    63
		* @return ETrue if present, otherwise EFalse
williamr@2
    64
		*/
williamr@2
    65
		IMPORT_C TBool HasParam(RStringF aName) const;
williamr@2
    66
williamr@2
    67
		/**
williamr@2
    68
		* Gets a parameter value
williamr@2
    69
		* @pre HasParam(aName) == ETrue
williamr@2
    70
		* @param aName the name of the parameter
williamr@2
    71
		* @return the parameter value if present,
williamr@2
    72
		*         otherwise a zero-length length value.
williamr@2
    73
		*/
williamr@2
    74
		IMPORT_C RStringF ParamValue(RStringF aName) const;
williamr@2
    75
williamr@2
    76
		/**
williamr@2
    77
		* Gets a parameter value stored as a descriptor
williamr@2
    78
		* @pre HasParam(aName) == ETrue
williamr@2
    79
		* @param aName the name of the parameter
williamr@2
    80
		* @return the parameter value if present,
williamr@2
    81
		*         otherwise a zero-length length value.
williamr@2
    82
		*/
williamr@2
    83
		IMPORT_C const TDesC8& DesParamValue(RStringF aName) const;
williamr@2
    84
williamr@2
    85
		/**
williamr@2
    86
		* Sets a parameter with a value. 
williamr@2
    87
		* Takes copies of the name and value,
williamr@2
    88
		* so if the RStringFs have been dynamically allocated,
williamr@2
    89
		* they can be closed if necessary after the function returns.
williamr@2
    90
		* @pre HasParam(aName) == EFalse
williamr@2
    91
		* @param aName the name of the parameter
williamr@2
    92
		* @param aValue the parameter value to set
williamr@2
    93
		*/
williamr@2
    94
		IMPORT_C void SetParamL(RStringF aName, RStringF aValue);
williamr@2
    95
williamr@2
    96
		/**
williamr@2
    97
		* Sets a parameter with a value. 
williamr@2
    98
		* Takes copies of the name 
williamr@2
    99
		* so if the RStringF have been dynamically allocated,
williamr@2
   100
		* they can be closed if necessary after the function returns.
williamr@2
   101
		* Stores the parameter value as a descriptor, so that the 
williamr@2
   102
		* case-sensitivity is not lost in RStringF-descriptor conversions. 
williamr@2
   103
		* @pre HasParam(aName) == EFalse
williamr@2
   104
		* @param aName the name of the parameter
williamr@2
   105
		* @param aValue the parameter value to set
williamr@2
   106
		*/
williamr@2
   107
		IMPORT_C void SetDesParamL(RStringF aName, const TDesC8& aValue);
williamr@2
   108
williamr@2
   109
		/**
williamr@2
   110
		* Sets a parameter with a value and adds double quotes 
williamr@2
   111
		* as the first and the last character in the value.
williamr@2
   112
		* Takes copy of the name,
williamr@2
   113
		* so if the RStringF has been dynamically allocated,
williamr@2
   114
		* it can be closed if necessary after the function returns.
williamr@2
   115
		* @pre HasParam(aName) == EFalse
williamr@2
   116
		* @param aName the name of the parameter
williamr@2
   117
		* @param aValue the parameter value 
williamr@2
   118
		*        to which the double quotes will be added
williamr@2
   119
		*/
williamr@2
   120
		IMPORT_C void SetParamAndAddQuotesL(RStringF aName,
williamr@2
   121
			                                const TDesC8& aValue);
williamr@2
   122
williamr@2
   123
		/**
williamr@2
   124
		* Deletes a parameter
williamr@2
   125
		* @param aName the parameter name to delete
williamr@2
   126
		*/
williamr@2
   127
		IMPORT_C void DeleteParam(RStringF aName);
williamr@2
   128
williamr@2
   129
williamr@2
   130
	public: // From CSIPHeaderBase
williamr@2
   131
williamr@2
   132
		/**
williamr@2
   133
		* From CSIPHeaderBase ExternalizeSupported
williamr@2
   134
		*/
williamr@2
   135
		IMPORT_C virtual TBool ExternalizeSupported() const;
williamr@2
   136
williamr@2
   137
williamr@2
   138
	public: // From CSIPHeaderBase, for internal use
williamr@2
   139
williamr@2
   140
		TBool EncodeMultipleToOneLine() const;
williamr@2
   141
		TBool MoreThanOneAllowed() const;
williamr@2
   142
		TPreferredPlace PreferredPlaceInMessage() const;
williamr@2
   143
        virtual HBufC8* ToTextValueL() const;
williamr@2
   144
williamr@2
   145
	protected: // Constructors
williamr@2
   146
williamr@2
   147
		CSIPAuthHeaderBase();
williamr@2
   148
		void ConstructL(RStringF aAuthScheme);
williamr@2
   149
williamr@2
   150
	protected: // New functions
williamr@2
   151
williamr@2
   152
		void SetAuthSchemeL(const TDesC8& aAuthScheme);
williamr@2
   153
        void ParseL(const TDesC8& aValue);
williamr@2
   154
        virtual const CSIPParamContainerBase& Params() const = 0;
williamr@2
   155
        virtual CSIPParamContainerBase& Params() = 0;
williamr@2
   156
williamr@2
   157
	private: // Data
williamr@2
   158
williamr@2
   159
		RStringF iAuthScheme;
williamr@2
   160
        TChar iSeparator;
williamr@2
   161
	};
williamr@2
   162
williamr@2
   163
#endif // CSIPAUTHHEADERBASE_H
williamr@2
   164
williamr@2
   165
// End of File