2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Name : sipsecurityheaderbase.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPSECURITYHEADERBASE_H
26 #define CSIPSECURITYHEADERBASE_H
29 #include "sipparameterheaderbase.h"
30 #include "_sipcodecdefs.h"
32 // FORWARD DECLARATIONS
33 class CSIPSecurityHeaderBaseParams;
40 * A base class for Security-Client, Security-Server and Security-Verify.
44 class CSIPSecurityHeaderBase : public CSIPParameterHeaderBase
46 public: // Constructors and destructor
49 * Destructor, deletes the resources of CSIPSecurityHeaderBase.
51 IMPORT_C virtual ~CSIPSecurityHeaderBase();
53 public: // New functions
56 * Gets the value of "q"-parameter
57 * @return the "q"-parameter value, zero if not present
59 IMPORT_C TReal PreferenceParam() const;
62 * Sets the "q"-parameter value
63 * @param aPreferenceValue a "q"-parameter value to set
65 IMPORT_C void SetPreferenceParamL(TReal aPreferenceValue);
68 * Gets the Mechanism-Name from the Security header
69 * @return a Mechanism-Name
71 IMPORT_C const TDesC8& MechanismName() const;
74 * Sets the Mechanism-Name in the Security header
75 * @param aMechanismName a Mechanism-Name
77 IMPORT_C void SetMechanismNameL(const TDesC8& aMechanismName);
79 public: // From CSIPHeaderBase, for internal use
84 TBool MoreThanOneAllowed() const;
89 TPreferredPlace PreferredPlaceInMessage() const;
91 protected: // Constructors
93 CSIPSecurityHeaderBase();
95 void ConstructL(const TDesC8& aMechanismName);
96 void ConstructL(const CSIPSecurityHeaderBase& aSecurityHeaderBase);
98 protected: // New functions
100 void DoInternalizeValueL(RReadStream& aReadStream);
102 private: // From CSIPHeaderBase
104 void ExternalizeValueL(RWriteStream& aWriteStream) const;
106 private: // From CSIPParameterHeaderBase
108 HBufC8* ToTextMandatoryPartLC() const;
109 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
110 const CSIPParamContainerBase& Params() const;
111 CSIPParamContainerBase& Params();
115 HBufC8* iMechanismName;
116 CSIPSecurityHeaderBaseParams* iParams;
118 private: // For testing purposes
120 UNIT_TEST(CSIPSecurityHeaderBaseTest)
123 #endif // CSIPSECURITYHEADERBASE_H