1.1 --- a/epoc32/include/sipparameterheaderbase.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/sipparameterheaderbase.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,181 @@
1.4 -sipparameterheaderbase.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 : sipparameterheaderbase.h
1.20 +* Part of : SIP Codec
1.21 +* Interface : SDK API, SIP Codec API
1.22 +* Version : SIP/4.0
1.23 +*
1.24 +*/
1.25 +
1.26 +
1.27 +
1.28 +
1.29 +#ifndef CSIPPARAMETERHEADERBASE_H
1.30 +#define CSIPPARAMETERHEADERBASE_H
1.31 +
1.32 +// INCLUDES
1.33 +#include "sipheaderbase.h"
1.34 +#include "_sipcodecdefs.h"
1.35 +
1.36 +// FORWARD DECLARATIONS
1.37 +class CSIPParamContainerBase;
1.38 +
1.39 +// CLASS DECLARATION
1.40 +/**
1.41 +* @publishedAll
1.42 +* @released
1.43 +*
1.44 +* A base class for SIP headers that have structure
1.45 +* "mandatory part"delimiter"parameters"
1.46 +*
1.47 +* This is an abstract class and cannot be instantiated.
1.48 +*
1.49 +* @lib sipcodec.lib
1.50 +*/
1.51 +class CSIPParameterHeaderBase : public CSIPHeaderBase
1.52 + {
1.53 + public: // Constructors and destructor
1.54 +
1.55 + /**
1.56 + * Destructor, deletes the resources of CSIPParameterHeaderBase.
1.57 + */
1.58 + IMPORT_C virtual ~CSIPParameterHeaderBase();
1.59 +
1.60 +
1.61 + public: // New functions
1.62 +
1.63 + /**
1.64 + * Checks if a parameter is present
1.65 + * @param aName the name of the parameter
1.66 + * @return ETrue if present, otherwise EFalse
1.67 + */
1.68 + IMPORT_C TBool HasParam(RStringF aName) const;
1.69 +
1.70 + /**
1.71 + * Gets a parameter value
1.72 + * @pre HasParam(aName) == ETrue
1.73 + * @param aName the name of the parameter
1.74 + * @return the parameter value if present,
1.75 + * otherwise a zero-length length value.
1.76 + */
1.77 + IMPORT_C RStringF ParamValue(RStringF aName) const;
1.78 +
1.79 + /**
1.80 + * Sets a parameter with a value.
1.81 + * Takes copies of the name and value,
1.82 + * so if the RStringFs have been dynamically allocated,
1.83 + * they can be closed if necessary after the function returns.
1.84 + * @pre HasParam(aName) == EFalse
1.85 + * @param aName the name of the parameter
1.86 + * @param aValue the parameter value to set
1.87 + */
1.88 + IMPORT_C void SetParamL(RStringF aName, RStringF aValue);
1.89 +
1.90 + /**
1.91 + * Sets a parameter without a value
1.92 + * Takes copy of the name,
1.93 + * so if the RStringF has been dynamically allocated,
1.94 + * it can be closed if necessary after the function returns.
1.95 + * @pre HasParam(aName) == EFalse
1.96 + * @param aName the parameter name to set
1.97 + */
1.98 + IMPORT_C void SetParamL(RStringF aName);
1.99 +
1.100 + /**
1.101 + * Deletes a parameter
1.102 + * @param aName the parameter name to delete
1.103 + */
1.104 + IMPORT_C void DeleteParam(RStringF aName);
1.105 +
1.106 + /**
1.107 + * Gets the count of header parameters
1.108 + * @return count of header parameters
1.109 + */
1.110 + IMPORT_C TInt ParamCount() const;
1.111 +
1.112 + /**
1.113 + * Gets a header parameter name by index.
1.114 + * This function can be used when looping through
1.115 + * all the header parameters.
1.116 + * @param aIndex the index of the parameter
1.117 + * @param aName copy of the parameter name that must be
1.118 + * closed by the caller.
1.119 + * @return KErrNotFound if aIndex is invalid. Otherwise EFalse.
1.120 + */
1.121 + IMPORT_C TInt Param(TInt aIndex, RStringF& aName) const;
1.122 +
1.123 + public: // From CSIPHeaderBase
1.124 +
1.125 + /**
1.126 + * From CSIPHeaderBase ToTextValueL
1.127 + */
1.128 + IMPORT_C HBufC8* ToTextValueL() const;
1.129 +
1.130 +
1.131 + protected: // Contructors
1.132 +
1.133 + CSIPParameterHeaderBase(const TChar& aSeparator);
1.134 +
1.135 + protected: // New functions
1.136 +
1.137 + void ParseL(const TDesC8& aValue,
1.138 + TBool aIgnoreParenthesis=ETrue,
1.139 + TBool aSkipSeparatorsBeforeAt=EFalse);
1.140 +
1.141 + protected: // Virtual functions
1.142 +
1.143 + /**
1.144 + * @internalComponent
1.145 + */
1.146 + virtual TBool ParamInsertionAllowed() const;
1.147 +
1.148 + protected: // Pure virtual functions
1.149 +
1.150 + /**
1.151 + * @internalComponent
1.152 + */
1.153 + virtual HBufC8* ToTextMandatoryPartLC() const = 0;
1.154 +
1.155 + /**
1.156 + * @internalComponent
1.157 + */
1.158 + virtual void ParseMandatoryPartL(const TDesC8& aMandatoryPart) = 0;
1.159 +
1.160 + /**
1.161 + * @internalComponent
1.162 + */
1.163 + virtual const CSIPParamContainerBase& Params() const = 0;
1.164 +
1.165 + /**
1.166 + * @internalComponent
1.167 + */
1.168 + virtual CSIPParamContainerBase& Params() = 0;
1.169 +
1.170 + private: // Contructors
1.171 +
1.172 + CSIPParameterHeaderBase();
1.173 +
1.174 + private: // Data
1.175 +
1.176 + TChar iSeparator;
1.177 +
1.178 + private: // For testing purposes
1.179 +
1.180 + UNIT_TEST(CSIPParameterHeaderBaseTest)
1.181 + };
1.182 +
1.183 +#endif // CSIPPARAMETERHEADERBASE_H
1.184 +
1.185 +// End of File