|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Name : TransactionItem.cpp |
|
15 // Part of : SIPDialogs |
|
16 // Version : SIP/4.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include "TransactionItem.h" |
|
22 #include "MTransactionUser.h" |
|
23 #include "TSIPTransportParams.h" |
|
24 |
|
25 |
|
26 // ----------------------------------------------------------------------------- |
|
27 // CTransactionItem::NewL |
|
28 // ----------------------------------------------------------------------------- |
|
29 // |
|
30 CTransactionItem* CTransactionItem::NewL (MTransactionUser& aTU, |
|
31 MTransactionOwner* aTransactionOwner, |
|
32 TTransactionId aTransactionId) |
|
33 { |
|
34 CTransactionItem* self = |
|
35 CTransactionItem::NewLC(aTU,aTransactionOwner,aTransactionId); |
|
36 CleanupStack::Pop(self); |
|
37 return self; |
|
38 } |
|
39 |
|
40 // ----------------------------------------------------------------------------- |
|
41 // CTransactionItem::NewLC |
|
42 // ----------------------------------------------------------------------------- |
|
43 // |
|
44 CTransactionItem* CTransactionItem::NewLC (MTransactionUser& aTU, |
|
45 MTransactionOwner* aTransactionOwner, |
|
46 TTransactionId aTransactionId) |
|
47 { |
|
48 CTransactionItem* self = |
|
49 new(ELeave)CTransactionItem(aTU,aTransactionOwner,aTransactionId); |
|
50 CleanupStack::PushL(self); |
|
51 return self; |
|
52 } |
|
53 |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CTransactionItem::NewL |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 CTransactionItem* CTransactionItem::NewL (MTransactionUser& aTU, |
|
59 MTransactionOwner* aTransactionOwner, |
|
60 RStringF aMethod) |
|
61 { |
|
62 CTransactionItem* self = |
|
63 CTransactionItem::NewLC(aTU,aTransactionOwner,aMethod); |
|
64 CleanupStack::Pop(self); |
|
65 return self; |
|
66 } |
|
67 |
|
68 // ----------------------------------------------------------------------------- |
|
69 // CTransactionItem::NewLC |
|
70 // ----------------------------------------------------------------------------- |
|
71 // |
|
72 CTransactionItem* CTransactionItem::NewLC (MTransactionUser& aTU, |
|
73 MTransactionOwner* aTransactionOwner, |
|
74 RStringF aMethod) |
|
75 { |
|
76 CTransactionItem* self = |
|
77 new(ELeave)CTransactionItem( |
|
78 aTU,aTransactionOwner,KEmptyTransactionId,aMethod); |
|
79 CleanupStack::PushL(self); |
|
80 return self; |
|
81 } |
|
82 |
|
83 // ----------------------------------------------------------------------------- |
|
84 // CTransactionItem::NewL |
|
85 // ----------------------------------------------------------------------------- |
|
86 // |
|
87 CTransactionItem* CTransactionItem::NewL (MTransactionUser& aTU, |
|
88 MTransactionOwner* aTransactionOwner, |
|
89 TTransactionId aTransactionId, |
|
90 RStringF aMethod) |
|
91 { |
|
92 CTransactionItem* self = |
|
93 CTransactionItem::NewLC(aTU,aTransactionOwner,aTransactionId,aMethod); |
|
94 CleanupStack::Pop(self); |
|
95 return self; |
|
96 } |
|
97 |
|
98 // ----------------------------------------------------------------------------- |
|
99 // CTransactionItem::NewLC |
|
100 // ----------------------------------------------------------------------------- |
|
101 // |
|
102 CTransactionItem* CTransactionItem::NewLC (MTransactionUser& aTU, |
|
103 MTransactionOwner* aTransactionOwner, |
|
104 TTransactionId aTransactionId, |
|
105 RStringF aMethod) |
|
106 { |
|
107 CTransactionItem* self = |
|
108 new(ELeave)CTransactionItem( |
|
109 aTU,aTransactionOwner,aTransactionId,aMethod); |
|
110 CleanupStack::PushL(self); |
|
111 return self; |
|
112 } |
|
113 |
|
114 // ----------------------------------------------------------------------------- |
|
115 // CTransactionItem::NewL |
|
116 // ----------------------------------------------------------------------------- |
|
117 // |
|
118 CTransactionItem* CTransactionItem::NewL (MTransactionUser& aTU, |
|
119 MTransactionOwner* aTransactionOwner, |
|
120 const CTransactionItemBase& aItem) |
|
121 { |
|
122 CTransactionItem* self = |
|
123 CTransactionItem::NewLC(aTU, aTransactionOwner, aItem); |
|
124 CleanupStack::Pop(self); |
|
125 return self; |
|
126 } |
|
127 |
|
128 // ----------------------------------------------------------------------------- |
|
129 // CTransactionItem::NewLC |
|
130 // ----------------------------------------------------------------------------- |
|
131 // |
|
132 CTransactionItem* CTransactionItem::NewLC (MTransactionUser& aTU, |
|
133 MTransactionOwner* aTransactionOwner, |
|
134 const CTransactionItemBase& aItem) |
|
135 { |
|
136 CTransactionItem* self = |
|
137 new(ELeave)CTransactionItem(aTU,aTransactionOwner,aItem); |
|
138 CleanupStack::PushL(self); |
|
139 return self; |
|
140 } |
|
141 |
|
142 // ----------------------------------------------------------------------------- |
|
143 // CTransactionItem::CTransactionItem |
|
144 // ----------------------------------------------------------------------------- |
|
145 // |
|
146 CTransactionItem::CTransactionItem (MTransactionUser& aTU, |
|
147 MTransactionOwner* aTransactionOwner, |
|
148 const CTransactionItemBase& aItem) |
|
149 : iTU(aTU), |
|
150 iTransactionOwner(aTransactionOwner) |
|
151 { |
|
152 Copy(aItem); |
|
153 } |
|
154 |
|
155 // ----------------------------------------------------------------------------- |
|
156 // CTransactionItem::CTransactionItem |
|
157 // ----------------------------------------------------------------------------- |
|
158 // |
|
159 CTransactionItem::CTransactionItem (MTransactionUser& aTU, |
|
160 MTransactionOwner* aTransactionOwner, |
|
161 TTransactionId aTransactionId) |
|
162 : CTransactionItemBase(aTransactionId), |
|
163 iTU(aTU), |
|
164 iTransactionOwner(aTransactionOwner) |
|
165 { |
|
166 } |
|
167 |
|
168 // ----------------------------------------------------------------------------- |
|
169 // CTransactionItem::CTransactionItem |
|
170 // ----------------------------------------------------------------------------- |
|
171 // |
|
172 CTransactionItem::CTransactionItem (MTransactionUser& aTU, |
|
173 MTransactionOwner* aTransactionOwner, |
|
174 TTransactionId aTransactionId, |
|
175 RStringF aMethod) |
|
176 : CTransactionItemBase(aTransactionId,aMethod), |
|
177 iTU(aTU), |
|
178 iTransactionOwner(aTransactionOwner) |
|
179 { |
|
180 } |
|
181 |
|
182 // ----------------------------------------------------------------------------- |
|
183 // CTransactionItem::~CTransactionItem |
|
184 // ----------------------------------------------------------------------------- |
|
185 // |
|
186 CTransactionItem::~CTransactionItem () |
|
187 { |
|
188 } |
|
189 |
|
190 // ----------------------------------------------------------------------------- |
|
191 // CTransactionItem::IsRefreshed |
|
192 // From CTransactionItemBase: |
|
193 // ----------------------------------------------------------------------------- |
|
194 // |
|
195 TBool CTransactionItem::IsRefreshed () const |
|
196 { |
|
197 return EFalse; |
|
198 } |
|
199 |
|
200 // ----------------------------------------------------------------------------- |
|
201 // CTransactionItem::ResponseReceived |
|
202 // From CTransactionItemBase: |
|
203 // ----------------------------------------------------------------------------- |
|
204 // |
|
205 void CTransactionItem::ResponseReceived (TUint /*aResponseCode*/) |
|
206 { |
|
207 } |
|
208 |
|
209 // ----------------------------------------------------------------------------- |
|
210 // CTransactionItem::SendAndGetHeadersL |
|
211 // From CTransactionItemBase: |
|
212 // ----------------------------------------------------------------------------- |
|
213 // |
|
214 MTransactionHeaders* CTransactionItem::SendAndGetHeadersL ( |
|
215 const TSIPTransportParams& aTransportParams, |
|
216 TTransactionId& aTransactionId, |
|
217 TRegistrationId aRegistrationId, |
|
218 CSIPRequest* aRequest, |
|
219 CURIContainer& aRemoteTarget) |
|
220 { |
|
221 MTransactionHeaders* headers = |
|
222 iTU.SendAndGetHeadersL (aTransactionId,aRegistrationId,aRequest, |
|
223 iTransactionOwner,aRemoteTarget, |
|
224 aTransportParams,ETrue); |
|
225 SetTransactionId (aTransactionId); |
|
226 return headers; |
|
227 } |
|
228 |
|
229 // ----------------------------------------------------------------------------- |
|
230 // CTransactionItem::SendL |
|
231 // From CTransactionItemBase: |
|
232 // ----------------------------------------------------------------------------- |
|
233 // |
|
234 void CTransactionItem::SendL (const TSIPTransportParams& aTransportParams, |
|
235 TTransactionId& aTransactionId, |
|
236 TRegistrationId aRegistrationId, |
|
237 CSIPRequest* aRequest, |
|
238 CURIContainer& aRemoteTarget) |
|
239 { |
|
240 iTU.SendL (aTransactionId,aRegistrationId,aRequest,iTransactionOwner, |
|
241 aRemoteTarget,aTransportParams,ETrue); |
|
242 SetTransactionId (aTransactionId); |
|
243 } |
|
244 |
|
245 // ----------------------------------------------------------------------------- |
|
246 // CTransactionItem::SendL |
|
247 // ----------------------------------------------------------------------------- |
|
248 // |
|
249 void CTransactionItem::SendL (const TSIPTransportParams& aTransportParams, |
|
250 CSIPResponse* aResponse, |
|
251 TBool aAddOwner) |
|
252 { |
|
253 if (aAddOwner) |
|
254 { |
|
255 iTU.SendL(Id(),aResponse,iTransactionOwner,aTransportParams); |
|
256 } |
|
257 else |
|
258 { |
|
259 iTU.SendL(Id(),aResponse,aTransportParams); |
|
260 } |
|
261 } |