|
1 /* |
|
2 * Copyright (c) 2006-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 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMMDATACALLTSY_H |
|
21 #define CMMDATACALLTSY_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "cmmcalltsy.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CMmDataLineTsy; |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * CMmDataCallTsy contains extended data call functionality that is |
|
33 * mode-dependent. |
|
34 */ |
|
35 NONSHARABLE_CLASS( CMmDataCallTsy ) : public CMmCallTsy |
|
36 { |
|
37 public: // Constructors and destructor |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 * @param aMmPhone Pointer to the Phone object |
|
42 * @param aMmLine Pointer to the Line from which this call object |
|
43 * has been created. |
|
44 * @param aMode Call mode |
|
45 * @param aName Name of this call |
|
46 * @param aMessageManager Pointer to the Message Manager object |
|
47 * @return CMmDataCallTsy* Created call object |
|
48 */ |
|
49 static CMmDataCallTsy* NewL( CMmPhoneTsy* aMmPhone, |
|
50 CMmDataLineTsy* aMmLine, RMobilePhone::TMobileService aMode, |
|
51 TDes& aName, CMmMessageManagerBase* aMessageManager ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CMmDataCallTsy(); |
|
57 |
|
58 // New functions |
|
59 |
|
60 /** |
|
61 * Complete dial request |
|
62 * |
|
63 * |
|
64 * @param aResult Result of the request |
|
65 */ |
|
66 void CompleteDial( TInt aResult ); |
|
67 |
|
68 /** |
|
69 * Complete dialnofdn request |
|
70 * |
|
71 * @param aResult Result of the request |
|
72 */ |
|
73 void CompleteDialNoFdn( TInt aResult ); |
|
74 |
|
75 /** |
|
76 * Complete hang up |
|
77 * |
|
78 * |
|
79 * @param aResult Result of the request |
|
80 */ |
|
81 void CompleteHangUp( TInt aResult ); |
|
82 |
|
83 /** |
|
84 * Complete answering to the incoming call |
|
85 * |
|
86 * |
|
87 * @param aResult Result of the request |
|
88 */ |
|
89 void CompleteAnswerIncomingCall( TInt aResult ); |
|
90 |
|
91 /** |
|
92 * Complete status change notification |
|
93 * |
|
94 * |
|
95 * @param aResult Result of the request |
|
96 * @param aDataPackage: new call status value |
|
97 */ |
|
98 void CompleteNotifyStatusChange( TInt aResult, |
|
99 CMmDataPackage* aDataPackage ); |
|
100 |
|
101 /** |
|
102 * Complete a NotifyMobileDataCallCapsChange request. |
|
103 * |
|
104 * |
|
105 */ |
|
106 void CompleteNotifyMobileDataCallCapsChange(); |
|
107 |
|
108 /** |
|
109 * Complete a SetDynamicHscsdParams request. |
|
110 * |
|
111 * |
|
112 * @param aErrorCode Error value for completion |
|
113 */ |
|
114 void CompleteSetDynamicHscsdParams( TInt aErrorCode ); |
|
115 |
|
116 /** |
|
117 * Complete a NotifyHscsdInfoChange request. |
|
118 * |
|
119 * |
|
120 */ |
|
121 void CompleteNotifyHscsdInfoChange(); |
|
122 |
|
123 /** |
|
124 * Returns request mode for given IPC number |
|
125 * |
|
126 * |
|
127 * @param aIpc IPC number of the request |
|
128 * @return Request mode |
|
129 */ |
|
130 CTelObject::TReqMode ReqModeL( const TInt aIpc ); |
|
131 |
|
132 /** |
|
133 * Returns number of slots to be used for a given IPC |
|
134 * |
|
135 * |
|
136 * @param aIpc IPC number of the request |
|
137 * @return Number of slots for this request |
|
138 */ |
|
139 TInt NumberOfSlotsL( const TInt aIpc ); |
|
140 |
|
141 /** |
|
142 * Cancels request that's IPC number and request handle are given as |
|
143 * parameters |
|
144 * |
|
145 * |
|
146 * @param aIpc: IPC number of the request |
|
147 * @param aTsyReqHandle Request handle from ETel server |
|
148 * @return KErrNone/KErrNotSupported |
|
149 */ |
|
150 TInt CancelService( const TInt aIpc, |
|
151 const TTsyReqHandle aTsyReqHandle ); |
|
152 |
|
153 /** |
|
154 * Register given notification |
|
155 * |
|
156 * |
|
157 * @param aIpc IPC number of the request |
|
158 * @return Result of the request |
|
159 */ |
|
160 TInt RegisterNotification( const TInt aIpc ); |
|
161 |
|
162 /** |
|
163 * Deregister given notification |
|
164 * |
|
165 * |
|
166 * @param aIpc IPC number of the request |
|
167 * @return Result of the request |
|
168 */ |
|
169 TInt DeregisterNotification( const TInt aIpc ); |
|
170 |
|
171 /** |
|
172 * Transfers call ownership. |
|
173 * |
|
174 * |
|
175 * @param aTsyReqHandle TSY request handle |
|
176 * @return KErrNone |
|
177 */ |
|
178 TInt TransferOwnership( const TTsyReqHandle aTsyReqHandle ); |
|
179 |
|
180 /** |
|
181 * Acquires ownership. |
|
182 * |
|
183 * |
|
184 * @param aTsyReqHandle TSY request handle |
|
185 * @return KErrNone |
|
186 */ |
|
187 TInt AcquireOwnership( const TTsyReqHandle aTsyReqHandle ); |
|
188 |
|
189 /** |
|
190 * Cancels method for AcquireOwnership. |
|
191 * |
|
192 * |
|
193 * @param aTsyReqHandle TSY request handle |
|
194 * @return KErrNone |
|
195 */ |
|
196 TInt AcquireOwnershipCancel( const TTsyReqHandle aTsyReqHandle ); |
|
197 |
|
198 /** |
|
199 * Relinquishes ownership. |
|
200 * |
|
201 * |
|
202 * @return KErrNone |
|
203 */ |
|
204 TInt RelinquishOwnership(); |
|
205 |
|
206 /** |
|
207 * Get call ownership status. |
|
208 * |
|
209 * |
|
210 * @param aTsyReqHandle TSY request handle |
|
211 * @param aOwnershipStatus Ownership status |
|
212 * @return KErrNone |
|
213 */ |
|
214 TInt GetOwnershipStatus( |
|
215 const TTsyReqHandle aTsyReqHandle, |
|
216 RCall::TOwnershipStatus* aOwnershipStatus ); |
|
217 |
|
218 /** |
|
219 * Dials a call. |
|
220 * |
|
221 * |
|
222 * @param aTsyReqHandle Tsy request handle |
|
223 * @param aCallParams Call parameters |
|
224 * @param aTelNumber Phone number to be called |
|
225 * @return KErrNone or KErrNotSupported |
|
226 */ |
|
227 TInt Dial( const TTsyReqHandle aTsyReqHandle, |
|
228 const TDesC8* aCallParams, TDesC* aTelNumber ); |
|
229 |
|
230 /** |
|
231 * Dials a call using NoFdnCheck feature. |
|
232 * |
|
233 * @param aTsyReqHandle Tsy request handle |
|
234 * @param aCallParams Call parameters |
|
235 * @param aTelNumber Phone number to be called |
|
236 * @return KErrNone or KErrNotSupported |
|
237 */ |
|
238 TInt DialNoFdnCheck( const TTsyReqHandle aTsyReqHandle, |
|
239 const TDesC8* aCallParams, TDesC* aTelNumber ); |
|
240 |
|
241 #ifdef TF_LOGGING_ENABLED |
|
242 /** |
|
243 * Overloads original ReqCompleted for logging purposes |
|
244 * |
|
245 * @param aTsyReqHandle TSY request handle |
|
246 * @param aError error value |
|
247 */ |
|
248 virtual void ReqCompleted( const TTsyReqHandle aTsyReqHandle, |
|
249 const TInt aError ); |
|
250 #endif |
|
251 |
|
252 /** |
|
253 * Answers to an incoming call |
|
254 * |
|
255 * |
|
256 * @param aTsyReqHandle Request handle from the ETel server |
|
257 * @param aCallParams Call parameters |
|
258 * @return KErrNone/KErrNotSupported |
|
259 */ |
|
260 TInt AnswerIncomingCall( const TTsyReqHandle aTsyReqHandle, |
|
261 const TDesC8* /*aCallParams*/ ); |
|
262 |
|
263 /** |
|
264 * Cancels answering to an incoming call |
|
265 * |
|
266 * |
|
267 * @param aTsyReqHandle Request handle from the ETel server |
|
268 * @return KErrNone/KErrNotSupported |
|
269 */ |
|
270 TInt AnswerIncomingCallCancel( const TTsyReqHandle aTsyReqHandle ); |
|
271 |
|
272 /** |
|
273 * Hangs up the call |
|
274 * |
|
275 * |
|
276 * @param aTsyReqHandle Request handle from ETel server |
|
277 * @return KErrNone/KErrNotSupported |
|
278 */ |
|
279 TInt HangUp( const TTsyReqHandle aTsyReqHandle ); |
|
280 |
|
281 /** |
|
282 * Returns bearer service information to the client. |
|
283 * |
|
284 * |
|
285 * @param aTsyReqHandle TSY request handle |
|
286 * @param aBearerService Contains Bearer service info on return |
|
287 * @return KErrNone |
|
288 */ |
|
289 TInt GetBearerServiceInfo( const TTsyReqHandle aTsyReqHandle, |
|
290 RCall::TBearerService* aBearerService ); |
|
291 |
|
292 /** |
|
293 * Set correct data call attributes, depending on parameter extension. |
|
294 * |
|
295 * |
|
296 * @param aTsyReqHandle Tsy request handle |
|
297 * @param aCallParams Call parameters |
|
298 * @return KErrNone/KErrArgument |
|
299 */ |
|
300 TInt Connect( const TTsyReqHandle aTsyReqHandle, |
|
301 const TDesC8* aCallParams ); |
|
302 |
|
303 /** |
|
304 * Cancels connecting of a (data) call |
|
305 * |
|
306 * |
|
307 * @param aTsyReqHandle Tsy request handle |
|
308 * @return KErrNone |
|
309 */ |
|
310 TInt ConnectCancel( const TTsyReqHandle /*aTsyReqHandle*/ ); |
|
311 |
|
312 /** |
|
313 * Loans the dataport to the client. |
|
314 * |
|
315 * |
|
316 * @param aTsyReqHandle TSY request handle |
|
317 * @param aCommPort Comm port |
|
318 * @return KErrNone |
|
319 */ |
|
320 TInt LoanDataPort( const TTsyReqHandle aTsyReqHandle, |
|
321 RCall::TCommPort* aCommPort ); |
|
322 |
|
323 /** |
|
324 * Cancels dataport loaning. |
|
325 * |
|
326 * |
|
327 * @param aTsyReqHandle Tsy request handle |
|
328 * @return KErrNone |
|
329 */ |
|
330 TInt LoanDataPortCancel( const TTsyReqHandle aTsyReqHandle ); |
|
331 |
|
332 /** |
|
333 * Recovers the dataport from the client. |
|
334 * |
|
335 * |
|
336 * @param aTsyReqHandle |
|
337 * @return KErrNone |
|
338 */ |
|
339 TInt RecoverDataPort( const TTsyReqHandle aTsyReqHandle ); |
|
340 |
|
341 /** |
|
342 * Recovers the dataport from the client and relinquishes ownership. |
|
343 * |
|
344 * |
|
345 * @return KErrNone |
|
346 */ |
|
347 TInt RecoverDataPortAndRelinquishOwnership(); |
|
348 |
|
349 #ifdef REQHANDLE_TIMER |
|
350 /** |
|
351 * Calls the appropriate complete method due timer expiration |
|
352 * |
|
353 * |
|
354 * @param aReqHandleType TSY request handle type. |
|
355 * @param aError Error value for completion |
|
356 */ |
|
357 void Complete( TInt aReqHandleType, TInt aError ); |
|
358 #endif |
|
359 |
|
360 protected: // New functions |
|
361 |
|
362 /** |
|
363 * Get data call caps. |
|
364 * |
|
365 * |
|
366 * @param const TTsyReqHandle aTsyReqHandle: Tsy request handle |
|
367 * @param TDes8* aCaps: Capabilities |
|
368 * @return KErrNone |
|
369 */ |
|
370 TInt GetMobileDataCallCaps( const TTsyReqHandle aTsyReqHandle, |
|
371 TDes8* aCaps ); |
|
372 |
|
373 /** |
|
374 * Notifies client when the data call capabilities change. |
|
375 * |
|
376 * |
|
377 * @param aTsyReqHandle TSY Request handle |
|
378 * @param aCaps Contains Mobile call capabilities on return |
|
379 * @return KErrNone |
|
380 */ |
|
381 TInt NotifyMobileDataCallCapsChange( |
|
382 const TTsyReqHandle /*aTsyReqHandle*/, |
|
383 TDes8* aCaps ); |
|
384 |
|
385 /** |
|
386 * Cancels MobileDataCallCaps change notifications. |
|
387 * |
|
388 * |
|
389 * @param aTsyReqHandle TSY request handle to be cancelled |
|
390 * @return KErrNone |
|
391 */ |
|
392 TInt NotifyMobileDataCallCapsChangeCancel( |
|
393 const TTsyReqHandle aTsyReqHandle ); |
|
394 |
|
395 /** |
|
396 * Set HSCSD dynamic data parameters. |
|
397 * |
|
398 * |
|
399 * @param aTsyReqHandle TSY request handle |
|
400 * @param aAiur, |
|
401 * @param aRxTimeslots |
|
402 * @return KErrNone |
|
403 */ |
|
404 TInt SetDynamicHscsdParams( const TTsyReqHandle aTsyReqHandle, |
|
405 RMobileCall::TMobileCallAiur* aAiur, TInt* aRxTimeslots ); |
|
406 |
|
407 /** |
|
408 * Cancel set HSCSD dynamic data parameters. |
|
409 * |
|
410 * |
|
411 * @param aTsyReqHandle |
|
412 * @return KErrNone |
|
413 */ |
|
414 TInt SetDynamicHscsdParamsCancel( |
|
415 const TTsyReqHandle /*aTsyReqHandle*/ ) const; |
|
416 |
|
417 /** |
|
418 * Get current HSCSD info. |
|
419 * |
|
420 * |
|
421 * @param aTsyReqHandle Tsy request handle |
|
422 * @param aHSCSDInfo Current HSCSD info |
|
423 * @return KErrNone |
|
424 */ |
|
425 TInt GetCurrentHscsdInfo( const TTsyReqHandle aTsyReqHandle, |
|
426 TDes8* aHSCSDInfo ); |
|
427 |
|
428 /** |
|
429 * Notify HSCSD info change. |
|
430 * |
|
431 * |
|
432 * @param aTsyReqHandle Tsy request handle |
|
433 * @param aHSCSDInfo Contains current HSCSD info on return |
|
434 * @return TInt KErrNone |
|
435 */ |
|
436 TInt NotifyHscsdInfoChange( const TTsyReqHandle /*aTsyReqHandle*/, |
|
437 TDes8* aHSCSDInfo ); |
|
438 |
|
439 /** |
|
440 * Cancels HSCSD info change notifications. |
|
441 * |
|
442 * |
|
443 * @param aTsyReqHandle TSY request handle to be cancelled |
|
444 * @return KErrNone |
|
445 */ |
|
446 TInt NotifyHscsdInfoChangeCancel( const TTsyReqHandle aTsyReqHandle ); |
|
447 |
|
448 /** |
|
449 * Starts to answer an incoming call. |
|
450 * |
|
451 * |
|
452 */ |
|
453 void CallComingForWaitingCall(); |
|
454 |
|
455 /** |
|
456 * Returns ETrue if the call object is "used" data call object |
|
457 * |
|
458 * |
|
459 * @return Value of iIsFinishedDataCall boolean |
|
460 */ |
|
461 TBool IsFinishedData() const; |
|
462 |
|
463 private: // Constructors and destructor |
|
464 |
|
465 /** |
|
466 * C++ default constructor. |
|
467 */ |
|
468 CMmDataCallTsy(); |
|
469 |
|
470 private: // Functions from base classes |
|
471 |
|
472 /** |
|
473 * Initialises miscellaneous internal attributes |
|
474 * |
|
475 * |
|
476 */ |
|
477 void InitInternalAttributes(); |
|
478 |
|
479 /** |
|
480 * DoExtFuncL is called by the server when it has a "extended", |
|
481 * i.e. non-core ETel request for the TSY. To process a request handle, |
|
482 * request type and request data are passed to the TSY. |
|
483 * |
|
484 * |
|
485 * @param aTsyReqHandle Request handle from ETel server |
|
486 * @param aIpc IPC number of the request |
|
487 * @param aPackage Reference to the input parameters. |
|
488 * @return KErrNone/KErrNotSupported |
|
489 */ |
|
490 TInt DoExtFuncL( const TTsyReqHandle aTsyReqHandle, const TInt aIpc, |
|
491 const TDataPackage& aPackage ); |
|
492 |
|
493 /** |
|
494 * Resets the status of the call |
|
495 * |
|
496 * |
|
497 */ |
|
498 void ClearCallStatus(); |
|
499 |
|
500 #ifdef REQHANDLE_TIMER |
|
501 |
|
502 /** |
|
503 * Chooses the type of response, automatic or common |
|
504 * |
|
505 * |
|
506 * @param aReqHandleType TSY request handle type. |
|
507 * @param aTsyReqHandle TSY request handle to be stored. |
|
508 */ |
|
509 void SetTypeOfResponse( const TInt aReqHandleType, |
|
510 const TTsyReqHandle aTsyReqHandle ); |
|
511 #endif |
|
512 |
|
513 private: // New functions |
|
514 |
|
515 /** |
|
516 * Get Data Call RLP Range. |
|
517 * |
|
518 * |
|
519 * @param aTsyReqHandle |
|
520 * @param aRLPVersion |
|
521 * @param aRLPRange |
|
522 * @return KErrNotSupported |
|
523 */ |
|
524 TInt GetMobileDataCallRLPRange( const TTsyReqHandle aTsyReqHandle, |
|
525 TInt* /*aRLPVersion*/, |
|
526 TDes8* /*aRLPRange*/ ); |
|
527 |
|
528 private: // Data |
|
529 |
|
530 /** |
|
531 * Boolean that indicates if this call object is finished data call. |
|
532 * Required as Symbian CSD agent in situation where first data call |
|
533 * fails due wrong number and it then opens second data call, which |
|
534 * dials correct number. Call status notifications go to wrong call |
|
535 * object (the first one) and causes problems for clients. |
|
536 */ |
|
537 TBool iIsFinishedDataCall; |
|
538 |
|
539 /** |
|
540 * Dataport loaned to client |
|
541 */ |
|
542 RCall::TCommPort iLoanedCommPort; |
|
543 |
|
544 /** |
|
545 * Pointer to data call caps |
|
546 */ |
|
547 TDes8* iRetDataCallCaps; |
|
548 |
|
549 /** |
|
550 * Pointer to HSCSD info |
|
551 */ |
|
552 TDes8* iRetHscsdInfo; |
|
553 |
|
554 }; |
|
555 |
|
556 #endif // CMMDATACALLTSY_H |
|
557 |
|
558 // End of File |