1.1 --- a/epoc32/include/sipauthheaderbase.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipauthheaderbase.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,165 @@
1.4 -sipauthheaderbase.h
1.5 +/*
1.6 +* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
1.7 +* All rights reserved.
1.8 +* This component and the accompanying materials are made available
1.9 +* 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
1.10 +* which accompanies this distribution, and is available
1.11 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.12 +*
1.13 +* Initial Contributors:
1.14 +* Nokia Corporation - initial contribution.
1.15 +*
1.16 +* Contributors:
1.17 +*
1.18 +* Description:
1.19 +* Name : sipauthheaderbase.h
1.20 +* Part of : SIP Codec
1.21 +* Version : SIP/5.0
1.22 +*
1.23 +*/
1.24 +
1.25 +
1.26 +
1.27 +#ifndef CSIPAUTHHEADERBASE_H
1.28 +#define CSIPAUTHHEADERBASE_H
1.29 +
1.30 +// INCLUDES
1.31 +#include "sipheaderbase.h"
1.32 +#include "_sipcodecdefs.h"
1.33 +
1.34 +// FORWARD DECLARATIONS
1.35 +class CSIPParamContainerBase;
1.36 +
1.37 +// CLASS DECLARATION
1.38 +/**
1.39 +* @publishedAll
1.40 +* @released
1.41 +*
1.42 +* A base class for SIP Authorization-, Proxy-Authenticate-,
1.43 +* Proxy-Authorization- and WWW-Authenticate-headers
1.44 +*
1.45 +* @lib sipcodec.lib
1.46 +*/
1.47 +class CSIPAuthHeaderBase : public CSIPHeaderBase
1.48 + {
1.49 + public: // Constructors and destructor
1.50 +
1.51 + /**
1.52 + * Destructor.
1.53 + */
1.54 + IMPORT_C virtual ~CSIPAuthHeaderBase();
1.55 +
1.56 +
1.57 + public: // New functions
1.58 +
1.59 + /**
1.60 + * @return the value of the auth-scheme
1.61 + */
1.62 + IMPORT_C RStringF AuthScheme() const;
1.63 +
1.64 + /**
1.65 + * Checks if a parameter is present
1.66 + * @param aName the name of the parameter
1.67 + * @return ETrue if present, otherwise EFalse
1.68 + */
1.69 + IMPORT_C TBool HasParam(RStringF aName) const;
1.70 +
1.71 + /**
1.72 + * Gets a parameter value
1.73 + * @pre HasParam(aName) == ETrue
1.74 + * @param aName the name of the parameter
1.75 + * @return the parameter value if present,
1.76 + * otherwise a zero-length length value.
1.77 + */
1.78 + IMPORT_C RStringF ParamValue(RStringF aName) const;
1.79 +
1.80 + /**
1.81 + * Gets a parameter value stored as a descriptor
1.82 + * @pre HasParam(aName) == ETrue
1.83 + * @param aName the name of the parameter
1.84 + * @return the parameter value if present,
1.85 + * otherwise a zero-length length value.
1.86 + */
1.87 + IMPORT_C const TDesC8& DesParamValue(RStringF aName) const;
1.88 +
1.89 + /**
1.90 + * Sets a parameter with a value.
1.91 + * Takes copies of the name and value,
1.92 + * so if the RStringFs have been dynamically allocated,
1.93 + * they can be closed if necessary after the function returns.
1.94 + * @pre HasParam(aName) == EFalse
1.95 + * @param aName the name of the parameter
1.96 + * @param aValue the parameter value to set
1.97 + */
1.98 + IMPORT_C void SetParamL(RStringF aName, RStringF aValue);
1.99 +
1.100 + /**
1.101 + * Sets a parameter with a value.
1.102 + * Takes copies of the name
1.103 + * so if the RStringF have been dynamically allocated,
1.104 + * they can be closed if necessary after the function returns.
1.105 + * Stores the parameter value as a descriptor, so that the
1.106 + * case-sensitivity is not lost in RStringF-descriptor conversions.
1.107 + * @pre HasParam(aName) == EFalse
1.108 + * @param aName the name of the parameter
1.109 + * @param aValue the parameter value to set
1.110 + */
1.111 + IMPORT_C void SetDesParamL(RStringF aName, const TDesC8& aValue);
1.112 +
1.113 + /**
1.114 + * Sets a parameter with a value and adds double quotes
1.115 + * as the first and the last character in the value.
1.116 + * Takes copy of the name,
1.117 + * so if the RStringF has been dynamically allocated,
1.118 + * it can be closed if necessary after the function returns.
1.119 + * @pre HasParam(aName) == EFalse
1.120 + * @param aName the name of the parameter
1.121 + * @param aValue the parameter value
1.122 + * to which the double quotes will be added
1.123 + */
1.124 + IMPORT_C void SetParamAndAddQuotesL(RStringF aName,
1.125 + const TDesC8& aValue);
1.126 +
1.127 + /**
1.128 + * Deletes a parameter
1.129 + * @param aName the parameter name to delete
1.130 + */
1.131 + IMPORT_C void DeleteParam(RStringF aName);
1.132 +
1.133 +
1.134 + public: // From CSIPHeaderBase
1.135 +
1.136 + /**
1.137 + * From CSIPHeaderBase ExternalizeSupported
1.138 + */
1.139 + IMPORT_C virtual TBool ExternalizeSupported() const;
1.140 +
1.141 +
1.142 + public: // From CSIPHeaderBase, for internal use
1.143 +
1.144 + TBool EncodeMultipleToOneLine() const;
1.145 + TBool MoreThanOneAllowed() const;
1.146 + TPreferredPlace PreferredPlaceInMessage() const;
1.147 + virtual HBufC8* ToTextValueL() const;
1.148 +
1.149 + protected: // Constructors
1.150 +
1.151 + CSIPAuthHeaderBase();
1.152 + void ConstructL(RStringF aAuthScheme);
1.153 +
1.154 + protected: // New functions
1.155 +
1.156 + void SetAuthSchemeL(const TDesC8& aAuthScheme);
1.157 + void ParseL(const TDesC8& aValue);
1.158 + virtual const CSIPParamContainerBase& Params() const = 0;
1.159 + virtual CSIPParamContainerBase& Params() = 0;
1.160 +
1.161 + private: // Data
1.162 +
1.163 + RStringF iAuthScheme;
1.164 + TChar iSeparator;
1.165 + };
1.166 +
1.167 +#endif // CSIPAUTHHEADERBASE_H
1.168 +
1.169 +// End of File