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 : sipfromtoheaderbase.h
17 * Interface : SDK API, SIP Codec API
25 #ifndef CSIPFROMTOHEADERBASE_H
26 #define CSIPFROMTOHEADERBASE_H
29 #include "sipparameterheaderbase.h"
31 // FORWARD DECLARATIONS
33 class CSIPFromToHeaderParams;
40 * Class provides functions for setting and getting parameters in SIP "From"
43 * This is an abstract class and cannot be instantiated.
47 class CSIPFromToHeaderBase : public CSIPParameterHeaderBase
49 public: // Constructors and destructor
52 * Destructor, deletes the resources of CSIPFromToHeaderBase.
54 IMPORT_C virtual ~CSIPFromToHeaderBase();
57 public: // New functions
60 * Compares this instance to another "From" or "To" header object
61 * @param aHeader a header to compare to
62 * @return ETrue, if the objects are equal otherwise EFalse
64 IMPORT_C TBool operator==(const CSIPFromToHeaderBase& aHeader) const;
67 * Sets the name-address
68 * @pre aSIPAddress != 0
69 * @param aSIPAddress a name-address to set, the ownership is transferred
71 IMPORT_C void SetSIPAddressL(CSIPAddress* aSIPAddress);
74 * Gets the name-address as const
75 * @return name-address object
77 IMPORT_C const CSIPAddress& SIPAddress() const;
80 * Gets the name-address
81 * @return name-address object
83 IMPORT_C CSIPAddress& SIPAddress();
86 public: // From CSIPHeaderBase, for internal use
91 TBool HasCompactName() const;
96 TPreferredPlace PreferredPlaceInMessage() const;
98 protected: // Constructors
100 CSIPFromToHeaderBase();
102 void ConstructL(CSIPAddress* aSIPAddress);
103 void ConstructL(CSIPAddress* aSIPAddress, const TDesC8& aTag);
104 void ConstructL(const CSIPFromToHeaderBase& aSIPFromToHeaderBase);
106 protected: // New functions
108 void DoInternalizeValueL(RReadStream& aReadStream);
110 private: // From CSIPHeaderBase
112 void ExternalizeValueL(RWriteStream& aWriteStream) const;
114 private: // From CSIPParameterHeaderBase
116 HBufC8* ToTextMandatoryPartLC() const;
117 void ParseMandatoryPartL(const TDesC8& aMandatoryPart);
118 const CSIPParamContainerBase& Params() const;
119 CSIPParamContainerBase& Params();
123 CSIPAddress* iSIPAddress;
124 CSIPFromToHeaderParams* iParams;
126 private: // For testing purposes
128 friend class CSIPFromToHeaderTest;
133 #endif // CSIPFROMTOHEADERBASE_H