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