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 "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.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"
31 // FORWARD DECLARATIONS
32 class CSIPSecurityHeaderBaseParams;
39 * A base class for Security-Client, Security-Server and Security-Verify.
43 class CSIPSecurityHeaderBase : public CSIPParameterHeaderBase
45 public: // Constructors and destructor
48 * Destructor, deletes the resources of CSIPSecurityHeaderBase.
50 IMPORT_C virtual ~CSIPSecurityHeaderBase();
52 public: // New functions
55 * Gets the value of "q"-parameter
56 * @return the "q"-parameter value, zero if not present
58 IMPORT_C TReal PreferenceParam() const;
61 * Sets the "q"-parameter value
62 * @param aPreferenceValue a "q"-parameter value to set
64 IMPORT_C void SetPreferenceParamL(TReal aPreferenceValue);
67 * Gets the Mechanism-Name from the Security header
68 * @return a Mechanism-Name
70 IMPORT_C const TDesC8& MechanismName() const;
73 * Sets the Mechanism-Name in the Security header
74 * @param aMechanismName a Mechanism-Name
76 IMPORT_C void SetMechanismNameL(const TDesC8& aMechanismName);
78 public: // From CSIPHeaderBase, for internal use
83 TBool MoreThanOneAllowed() const;
88 TPreferredPlace PreferredPlaceInMessage() const;
90 protected: // Constructors
92 CSIPSecurityHeaderBase();
94 void ConstructL(const TDesC8& aMechanismName);
95 void ConstructL(const CSIPSecurityHeaderBase& aSecurityHeaderBase);
97 protected: // New functions
99 void DoInternalizeValueL(RReadStream& aReadStream);
101 private: // From CSIPHeaderBase
103 void ExternalizeValueL(RWriteStream& aWriteStream) const;
105 private: // From CSIPParameterHeaderBase
107 HBufC8* ToTextMandatoryPartLC() const;
108 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
109 const CSIPParamContainerBase& Params() const;
110 CSIPParamContainerBase& Params();
114 HBufC8* iMechanismName;
115 CSIPSecurityHeaderBaseParams* iParams;
117 private: // For testing purposes
119 friend class CSIPSecurityHeaderBaseTest;
123 #endif // CSIPSECURITYHEADERBASE_H