|
1 /* |
|
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Name : sipfromtoheaderbase.h |
|
16 * Part of : SIP Codec |
|
17 * Interface : SDK API, SIP Codec API |
|
18 * Version : SIP/4.0 |
|
19 * |
|
20 */ |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CSIPFROMTOHEADERBASE_H |
|
26 #define CSIPFROMTOHEADERBASE_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "sipparameterheaderbase.h" |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CSIPAddress; |
|
33 class CSIPFromToHeaderParams; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * @publishedAll |
|
38 * @released |
|
39 * |
|
40 * Class provides functions for setting and getting parameters in SIP "From" |
|
41 * and "To" header. |
|
42 * |
|
43 * This is an abstract class and cannot be instantiated. |
|
44 * |
|
45 * @lib sipcodec.lib |
|
46 */ |
|
47 class CSIPFromToHeaderBase : public CSIPParameterHeaderBase |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 /** |
|
52 * Destructor, deletes the resources of CSIPFromToHeaderBase. |
|
53 */ |
|
54 IMPORT_C virtual ~CSIPFromToHeaderBase(); |
|
55 |
|
56 |
|
57 public: // New functions |
|
58 |
|
59 /** |
|
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 |
|
63 */ |
|
64 IMPORT_C TBool operator==(const CSIPFromToHeaderBase& aHeader) const; |
|
65 |
|
66 /** |
|
67 * Sets the name-address |
|
68 * @pre aSIPAddress != 0 |
|
69 * @param aSIPAddress a name-address to set, the ownership is transferred |
|
70 */ |
|
71 IMPORT_C void SetSIPAddressL(CSIPAddress* aSIPAddress); |
|
72 |
|
73 /** |
|
74 * Gets the name-address as const |
|
75 * @return name-address object |
|
76 */ |
|
77 IMPORT_C const CSIPAddress& SIPAddress() const; |
|
78 |
|
79 /** |
|
80 * Gets the name-address |
|
81 * @return name-address object |
|
82 */ |
|
83 IMPORT_C CSIPAddress& SIPAddress(); |
|
84 |
|
85 |
|
86 public: // From CSIPHeaderBase, for internal use |
|
87 |
|
88 /** |
|
89 * @internalComponent |
|
90 */ |
|
91 TBool HasCompactName() const; |
|
92 |
|
93 /** |
|
94 * @internalComponent |
|
95 */ |
|
96 TPreferredPlace PreferredPlaceInMessage() const; |
|
97 |
|
98 protected: // Constructors |
|
99 |
|
100 CSIPFromToHeaderBase(); |
|
101 void ConstructL(); |
|
102 void ConstructL(CSIPAddress* aSIPAddress); |
|
103 void ConstructL(CSIPAddress* aSIPAddress, const TDesC8& aTag); |
|
104 void ConstructL(const CSIPFromToHeaderBase& aSIPFromToHeaderBase); |
|
105 |
|
106 protected: // New functions |
|
107 |
|
108 void DoInternalizeValueL(RReadStream& aReadStream); |
|
109 |
|
110 private: // From CSIPHeaderBase |
|
111 |
|
112 void ExternalizeValueL(RWriteStream& aWriteStream) const; |
|
113 |
|
114 private: // From CSIPParameterHeaderBase |
|
115 |
|
116 HBufC8* ToTextMandatoryPartLC() const; |
|
117 void ParseMandatoryPartL(const TDesC8& aMandatoryPart); |
|
118 const CSIPParamContainerBase& Params() const; |
|
119 CSIPParamContainerBase& Params(); |
|
120 |
|
121 private: // Data |
|
122 |
|
123 CSIPAddress* iSIPAddress; |
|
124 CSIPFromToHeaderParams* iParams; |
|
125 |
|
126 private: // For testing purposes |
|
127 #ifdef CPPUNIT_TEST |
|
128 friend class CSIPFromToHeaderTest; |
|
129 #endif |
|
130 }; |
|
131 |
|
132 |
|
133 #endif // CSIPFROMTOHEADERBASE_H |
|
134 |
|
135 // End of File |