1 /* |
|
2 * Copyright (c) 2008-2008 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: Information container for a single call |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "cpecallinfo.h" |
|
19 #include "cpeclientinformation.h" |
|
20 |
|
21 // --------------------------------------------------------------------------- |
|
22 // Two-phased constructor. |
|
23 // --------------------------------------------------------------------------- |
|
24 // |
|
25 CPECallInfo* CPECallInfo::NewL() |
|
26 { |
|
27 CPECallInfo* self = new ( ELeave ) CPECallInfo; |
|
28 CleanupStack::PushL( self ); |
|
29 self->ConstructL(); |
|
30 CleanupStack::Pop( self ); |
|
31 return self; |
|
32 } |
|
33 |
|
34 // --------------------------------------------------------------------------- |
|
35 // Constructor. |
|
36 // --------------------------------------------------------------------------- |
|
37 // |
|
38 CPECallInfo::CPECallInfo() |
|
39 { |
|
40 Reset( EFalse ); |
|
41 } |
|
42 |
|
43 // --------------------------------------------------------------------------- |
|
44 // Second-phase constructor. |
|
45 // --------------------------------------------------------------------------- |
|
46 // |
|
47 void CPECallInfo::ConstructL() |
|
48 { |
|
49 iClientInformation = CPEClientInformation::NewL(); |
|
50 } |
|
51 |
|
52 // --------------------------------------------------------------------------- |
|
53 // Destructor. |
|
54 // --------------------------------------------------------------------------- |
|
55 // |
|
56 CPECallInfo::~CPECallInfo() |
|
57 { |
|
58 delete iClientInformation; |
|
59 } |
|
60 |
|
61 // --------------------------------------------------------------------------- |
|
62 // Resets all call information to their initial values. |
|
63 // --------------------------------------------------------------------------- |
|
64 // |
|
65 void CPECallInfo::Reset( TBool aIsConference ) |
|
66 { |
|
67 if ( iClientInformation ) |
|
68 { |
|
69 iClientInformation->Reset(); |
|
70 } |
|
71 |
|
72 if ( aIsConference ) |
|
73 { |
|
74 iCallState = EPEStateConferenceIdle; |
|
75 iConference = KPEConferenceMaster; |
|
76 } |
|
77 else |
|
78 { |
|
79 iCallState = EPEStateIdle; |
|
80 iConference = KPENormalVoiceCall; |
|
81 } |
|
82 |
|
83 _LIT( dateTimeInit, "0,0,0,0,0,0,0" ); |
|
84 iStartTime.Set( dateTimeInit ); |
|
85 |
|
86 iCallType = EPECallTypeUninitialized; |
|
87 iCallDirection = RMobileCall::EDirectionUnknown; |
|
88 iRemoteIdentity = RMobileCall::ERemoteIdentityUnknown; |
|
89 iLoggingEnabled = ETrue; |
|
90 iMissedCall = EFalse; |
|
91 iALSLine = CCCECallParameters::ECCELineTypePrimary; |
|
92 iLogForcedCompletion = EFalse; |
|
93 iWholeOutgoingPhoneNumber = KNullDesC; |
|
94 iCallServiceId = 0; |
|
95 iSecureStatus = EFalse; |
|
96 iResumeHeldCall = ETrue; |
|
97 iForwarded = EFalse; |
|
98 iService = RMobilePhone::EServiceUnspecified; |
|
99 iConferenceCaps = 0; |
|
100 iConferenceMemberName = KNullDesC; |
|
101 iConferenceMemberId = KPECallIdNotUsed; |
|
102 iNumberOfConferenceMembers = 0; |
|
103 iRemotePartyName = KNullDesC; |
|
104 iSecureSpecified = ETrue; |
|
105 iTransferTarget = KNullDesC; |
|
106 iDtmfPostFix = KNullDesC; |
|
107 iForwardAddressChoices = NULL; |
|
108 iCallIndex = KPEInvalidCallIndex; |
|
109 } |
|
110 |
|
111 // --------------------------------------------------------------------------- |
|
112 // Returns the client information of the call. |
|
113 // --------------------------------------------------------------------------- |
|
114 // |
|
115 CPEClientInformation& CPECallInfo::ClientInformation() |
|
116 { |
|
117 return *iClientInformation; |
|
118 } |
|
119 |
|
120 // --------------------------------------------------------------------------- |
|
121 // Sets the state of the call. |
|
122 // --------------------------------------------------------------------------- |
|
123 // |
|
124 void CPECallInfo::SetCallState( TPEState aState ) |
|
125 { |
|
126 iCallState = aState; |
|
127 } |
|
128 |
|
129 // --------------------------------------------------------------------------- |
|
130 // Returns the state of the call. |
|
131 // --------------------------------------------------------------------------- |
|
132 // |
|
133 TPEState CPECallInfo::CallState() const |
|
134 { |
|
135 return iCallState; |
|
136 } |
|
137 |
|
138 // --------------------------------------------------------------------------- |
|
139 // Sets the type of the call. |
|
140 // --------------------------------------------------------------------------- |
|
141 // |
|
142 void CPECallInfo::SetCallType( TPECallType aType ) |
|
143 { |
|
144 iCallType = aType; |
|
145 } |
|
146 |
|
147 // --------------------------------------------------------------------------- |
|
148 // Returns the type of the call. |
|
149 // --------------------------------------------------------------------------- |
|
150 // |
|
151 TPECallType CPECallInfo::CallType() const |
|
152 { |
|
153 return iCallType; |
|
154 } |
|
155 |
|
156 // --------------------------------------------------------------------------- |
|
157 // Sets the call control capabilites. |
|
158 // --------------------------------------------------------------------------- |
|
159 // |
|
160 void CPECallInfo::SetCallControlCaps( TPECallControlCaps aCaps ) |
|
161 { |
|
162 iCallControlCaps = aCaps; |
|
163 } |
|
164 |
|
165 // --------------------------------------------------------------------------- |
|
166 // Returns the call control capabilities. |
|
167 // --------------------------------------------------------------------------- |
|
168 // |
|
169 TPECallControlCaps CPECallInfo::CallControlCaps() const |
|
170 { |
|
171 return iCallControlCaps; |
|
172 } |
|
173 |
|
174 // --------------------------------------------------------------------------- |
|
175 // Sets the remote party name of the call as given by the network. |
|
176 // --------------------------------------------------------------------------- |
|
177 // |
|
178 void CPECallInfo::SetRemotePartyName( const TPEContactName& aName ) |
|
179 { |
|
180 iRemotePartyName = aName; |
|
181 } |
|
182 |
|
183 // --------------------------------------------------------------------------- |
|
184 // Returns the remote party name of the call as given by the network. |
|
185 // --------------------------------------------------------------------------- |
|
186 // |
|
187 const TPEContactName& CPECallInfo::RemotePartyName() const |
|
188 { |
|
189 return iRemotePartyName; |
|
190 } |
|
191 |
|
192 // --------------------------------------------------------------------------- |
|
193 // Sets the whole outgoing phone number (invalid characters removed). |
|
194 // --------------------------------------------------------------------------- |
|
195 // |
|
196 void CPECallInfo::SetWholeOutgoingPhoneNumber( const TPEPhoneNumber& aNumber ) |
|
197 { |
|
198 iWholeOutgoingPhoneNumber = aNumber; |
|
199 } |
|
200 |
|
201 // --------------------------------------------------------------------------- |
|
202 // Returns the whole outgoing phone number (invalid characters removed). |
|
203 // --------------------------------------------------------------------------- |
|
204 // |
|
205 const TPEPhoneNumber& CPECallInfo::WholeOutgoingPhoneNumber() const |
|
206 { |
|
207 return iWholeOutgoingPhoneNumber; |
|
208 } |
|
209 |
|
210 // --------------------------------------------------------------------------- |
|
211 // Sets the ALS line type of the call. |
|
212 // --------------------------------------------------------------------------- |
|
213 // |
|
214 void CPECallInfo::SetAlsLine( CCCECallParameters::TCCELineType aAlsLine ) |
|
215 { |
|
216 iALSLine = aAlsLine; |
|
217 } |
|
218 |
|
219 // --------------------------------------------------------------------------- |
|
220 // Returns the ALS line type of the call. |
|
221 // --------------------------------------------------------------------------- |
|
222 // |
|
223 CCCECallParameters::TCCELineType CPECallInfo::AlsLine() const |
|
224 { |
|
225 return iALSLine; |
|
226 } |
|
227 |
|
228 // --------------------------------------------------------------------------- |
|
229 // Sets the remote identity status of the call. |
|
230 // --------------------------------------------------------------------------- |
|
231 // |
|
232 void CPECallInfo::SetRemoteIdentity( RMobileCall::TMobileCallRemoteIdentityStatus aIdentity ) |
|
233 { |
|
234 iRemoteIdentity = aIdentity; |
|
235 } |
|
236 |
|
237 // --------------------------------------------------------------------------- |
|
238 // Returns the remote identity status of the call. |
|
239 // --------------------------------------------------------------------------- |
|
240 // |
|
241 RMobileCall::TMobileCallRemoteIdentityStatus CPECallInfo::RemoteIdentity() const |
|
242 { |
|
243 return iRemoteIdentity; |
|
244 } |
|
245 |
|
246 // --------------------------------------------------------------------------- |
|
247 // Sets the direction of the call. |
|
248 // --------------------------------------------------------------------------- |
|
249 // |
|
250 void CPECallInfo::SetCallDirection( RMobileCall::TMobileCallDirection aDirection ) |
|
251 { |
|
252 iCallDirection = aDirection; |
|
253 } |
|
254 |
|
255 // --------------------------------------------------------------------------- |
|
256 // Returns the direction of the call. |
|
257 // --------------------------------------------------------------------------- |
|
258 // |
|
259 RMobileCall::TMobileCallDirection CPECallInfo::CallDirection() const |
|
260 { |
|
261 return iCallDirection; |
|
262 } |
|
263 |
|
264 // --------------------------------------------------------------------------- |
|
265 // Sets the mobile call service type of the call. |
|
266 // --------------------------------------------------------------------------- |
|
267 // |
|
268 void CPECallInfo::SetService( RMobilePhone::TMobileService aService ) |
|
269 { |
|
270 iService = aService; |
|
271 } |
|
272 |
|
273 // --------------------------------------------------------------------------- |
|
274 // Returns the mobile call service type of the call. |
|
275 // --------------------------------------------------------------------------- |
|
276 // |
|
277 RMobilePhone::TMobileService CPECallInfo::Service() const |
|
278 { |
|
279 return iService; |
|
280 } |
|
281 |
|
282 // --------------------------------------------------------------------------- |
|
283 // Sets the conference member name of the call. |
|
284 // --------------------------------------------------------------------------- |
|
285 // |
|
286 void CPECallInfo::SetConferenceMemberName( const TName& aName ) |
|
287 { |
|
288 iConferenceMemberName = aName; |
|
289 } |
|
290 |
|
291 // --------------------------------------------------------------------------- |
|
292 // Returns the conference member name of the call. |
|
293 // --------------------------------------------------------------------------- |
|
294 // |
|
295 const TName& CPECallInfo::ConferenceMemberName() const |
|
296 { |
|
297 return iConferenceMemberName; |
|
298 } |
|
299 |
|
300 // --------------------------------------------------------------------------- |
|
301 // Sets the call start time. |
|
302 // --------------------------------------------------------------------------- |
|
303 // |
|
304 void CPECallInfo::SetStartTime( const TTime& aTime ) |
|
305 { |
|
306 iStartTime = aTime; |
|
307 } |
|
308 |
|
309 // --------------------------------------------------------------------------- |
|
310 // Returns the start time of the call. |
|
311 // --------------------------------------------------------------------------- |
|
312 // |
|
313 const TTime& CPECallInfo::StartTime() const |
|
314 { |
|
315 return iStartTime; |
|
316 } |
|
317 |
|
318 // --------------------------------------------------------------------------- |
|
319 // Sets the duration of the call. |
|
320 // --------------------------------------------------------------------------- |
|
321 // |
|
322 void CPECallInfo::SetDuration( TTimeIntervalSeconds aDuration ) |
|
323 { |
|
324 iDuration = aDuration; |
|
325 } |
|
326 |
|
327 // --------------------------------------------------------------------------- |
|
328 // Returns the duration of the call. |
|
329 // --------------------------------------------------------------------------- |
|
330 // |
|
331 TTimeIntervalSeconds CPECallInfo::Duration() const |
|
332 { |
|
333 return iDuration; |
|
334 } |
|
335 |
|
336 // --------------------------------------------------------------------------- |
|
337 // Sets the service identifier of the call. |
|
338 // --------------------------------------------------------------------------- |
|
339 // |
|
340 void CPECallInfo::SetCallServiceId( TUint32 aId ) |
|
341 { |
|
342 iCallServiceId = aId; |
|
343 } |
|
344 |
|
345 // --------------------------------------------------------------------------- |
|
346 // Returns the service identifier of the call. |
|
347 // --------------------------------------------------------------------------- |
|
348 // |
|
349 TUint32 CPECallInfo::CallServiceId() const |
|
350 { |
|
351 return iCallServiceId; |
|
352 } |
|
353 |
|
354 // --------------------------------------------------------------------------- |
|
355 // Sets conference capabilities of the call. |
|
356 // --------------------------------------------------------------------------- |
|
357 // |
|
358 void CPECallInfo::SetConferenceCaps( TUint32 aCaps ) |
|
359 { |
|
360 iConferenceCaps = aCaps; |
|
361 } |
|
362 |
|
363 // --------------------------------------------------------------------------- |
|
364 // Returns the conference capabilities of the call. |
|
365 // --------------------------------------------------------------------------- |
|
366 // |
|
367 TUint32 CPECallInfo::ConferenceCaps() const |
|
368 { |
|
369 return iConferenceCaps; |
|
370 } |
|
371 |
|
372 // --------------------------------------------------------------------------- |
|
373 // Sets the identification number of the conference master. |
|
374 // --------------------------------------------------------------------------- |
|
375 // |
|
376 void CPECallInfo::SetConference( TInt aConference ) |
|
377 { |
|
378 iConference = aConference; |
|
379 } |
|
380 |
|
381 // --------------------------------------------------------------------------- |
|
382 // Returns the identification number of the conference master. |
|
383 // --------------------------------------------------------------------------- |
|
384 // |
|
385 TInt CPECallInfo::Conference() const |
|
386 { |
|
387 return iConference; |
|
388 } |
|
389 |
|
390 // --------------------------------------------------------------------------- |
|
391 // Sets the identifier of the conference member call. |
|
392 // --------------------------------------------------------------------------- |
|
393 // |
|
394 void CPECallInfo::SetConferenceMemberId( TInt aId ) |
|
395 { |
|
396 iConferenceMemberId = aId; |
|
397 } |
|
398 |
|
399 // --------------------------------------------------------------------------- |
|
400 // Returns the identifier of the conference member call. |
|
401 // --------------------------------------------------------------------------- |
|
402 // |
|
403 TInt CPECallInfo::ConferenceMemberId() |
|
404 { |
|
405 return iConferenceMemberId; |
|
406 } |
|
407 |
|
408 // --------------------------------------------------------------------------- |
|
409 // Sets the number of conference members. |
|
410 // --------------------------------------------------------------------------- |
|
411 // |
|
412 void CPECallInfo::SetNumberOfConferenceMembers( TInt aNumberOfConferenceMembers ) |
|
413 { |
|
414 iNumberOfConferenceMembers = aNumberOfConferenceMembers; |
|
415 } |
|
416 |
|
417 // --------------------------------------------------------------------------- |
|
418 // Returns the number of conference members. |
|
419 // --------------------------------------------------------------------------- |
|
420 // |
|
421 TInt CPECallInfo::NumberOfConferenceMembers() const |
|
422 { |
|
423 return iNumberOfConferenceMembers; |
|
424 } |
|
425 |
|
426 // --------------------------------------------------------------------------- |
|
427 // Sets the forced completion indicator for logging. |
|
428 // --------------------------------------------------------------------------- |
|
429 // |
|
430 void CPECallInfo::SetLogForcedCompletion( TBool aLog ) |
|
431 { |
|
432 iLogForcedCompletion = aLog; |
|
433 } |
|
434 |
|
435 // --------------------------------------------------------------------------- |
|
436 // Returns the flag indicating if forced completion indicator for logging is used. |
|
437 // --------------------------------------------------------------------------- |
|
438 // |
|
439 TBool CPECallInfo::LogForcedCompletion() |
|
440 { |
|
441 return iLogForcedCompletion; |
|
442 } |
|
443 |
|
444 // --------------------------------------------------------------------------- |
|
445 // Enables or disables logging for the call. |
|
446 // --------------------------------------------------------------------------- |
|
447 // |
|
448 void CPECallInfo::SetLoggingEnabled( TBool aEnabled ) |
|
449 { |
|
450 iLoggingEnabled = aEnabled; |
|
451 } |
|
452 |
|
453 // --------------------------------------------------------------------------- |
|
454 // Returns if logging is enabled for the call. |
|
455 // --------------------------------------------------------------------------- |
|
456 // |
|
457 TBool CPECallInfo::LoggingEnabled() const |
|
458 { |
|
459 return iLoggingEnabled; |
|
460 } |
|
461 |
|
462 // --------------------------------------------------------------------------- |
|
463 // Sets the missed call status for the call. |
|
464 // --------------------------------------------------------------------------- |
|
465 // |
|
466 void CPECallInfo::SetMissedCall( TBool aMissedCall ) |
|
467 { |
|
468 iMissedCall = aMissedCall; |
|
469 } |
|
470 |
|
471 // --------------------------------------------------------------------------- |
|
472 // Returns the missed call status for the call. |
|
473 // --------------------------------------------------------------------------- |
|
474 // |
|
475 TBool CPECallInfo::MissedCall() const |
|
476 { |
|
477 return iMissedCall; |
|
478 } |
|
479 |
|
480 // --------------------------------------------------------------------------- |
|
481 // Sets the secure status for the call. |
|
482 // --------------------------------------------------------------------------- |
|
483 // |
|
484 void CPECallInfo::SetSecureStatus( TBool aSecureStatus ) |
|
485 { |
|
486 iSecureStatus = aSecureStatus; |
|
487 } |
|
488 |
|
489 // --------------------------------------------------------------------------- |
|
490 // Returns the secure status of the call. |
|
491 // --------------------------------------------------------------------------- |
|
492 // |
|
493 TBool CPECallInfo::SecureStatus() const |
|
494 { |
|
495 return iSecureStatus; |
|
496 } |
|
497 |
|
498 // --------------------------------------------------------------------------- |
|
499 // Sets the forwarded status for the call. |
|
500 // --------------------------------------------------------------------------- |
|
501 // |
|
502 void CPECallInfo::SetForwarded( TBool aForwarded ) |
|
503 { |
|
504 iForwarded = aForwarded; |
|
505 } |
|
506 |
|
507 // --------------------------------------------------------------------------- |
|
508 // Returns the forwarded status of the call. |
|
509 // --------------------------------------------------------------------------- |
|
510 // |
|
511 TBool CPECallInfo::Forwarded() const |
|
512 { |
|
513 return iForwarded; |
|
514 } |
|
515 |
|
516 // --------------------------------------------------------------------------- |
|
517 // Sets the resume held call status for the call. |
|
518 // --------------------------------------------------------------------------- |
|
519 // |
|
520 void CPECallInfo::SetResumeHeldCall( TBool aResume ) |
|
521 { |
|
522 iResumeHeldCall = aResume; |
|
523 } |
|
524 |
|
525 // --------------------------------------------------------------------------- |
|
526 // Returns the resume held call status of the call. |
|
527 // --------------------------------------------------------------------------- |
|
528 // |
|
529 TBool CPECallInfo::ResumeHeldCall() const |
|
530 { |
|
531 return iResumeHeldCall; |
|
532 } |
|
533 |
|
534 // --------------------------------------------------------------------------- |
|
535 // Sets the secure specified status |
|
536 // --------------------------------------------------------------------------- |
|
537 // |
|
538 void CPECallInfo::SetSecureSpecified( TBool aSecureSpecified ) |
|
539 { |
|
540 iSecureSpecified = aSecureSpecified; |
|
541 } |
|
542 |
|
543 // --------------------------------------------------------------------------- |
|
544 // Returns the secure specified status |
|
545 // --------------------------------------------------------------------------- |
|
546 // |
|
547 TBool CPECallInfo::SecureSpecified() const |
|
548 { |
|
549 return iSecureSpecified; |
|
550 } |
|
551 |
|
552 // --------------------------------------------------------------------------- |
|
553 // Returns unattended transfer target. |
|
554 // --------------------------------------------------------------------------- |
|
555 // |
|
556 const TPEPhoneNumber& CPECallInfo::UnattendedTransferTarget() const |
|
557 { |
|
558 return iTransferTarget; |
|
559 } |
|
560 |
|
561 |
|
562 // --------------------------------------------------------------------------- |
|
563 // Sets unattended transfer target. |
|
564 // --------------------------------------------------------------------------- |
|
565 // |
|
566 void CPECallInfo::SetUnattendedTransferTarget( const TPEPhoneNumber& aTarget ) |
|
567 { |
|
568 iTransferTarget = aTarget; |
|
569 } |
|
570 |
|
571 // --------------------------------------------------------------------------- |
|
572 // Returns address array for call forward. |
|
573 // --------------------------------------------------------------------------- |
|
574 // |
|
575 const CDesC8Array* CPECallInfo::ForwardAddressChoices() const |
|
576 { |
|
577 return iForwardAddressChoices; |
|
578 } |
|
579 |
|
580 |
|
581 // --------------------------------------------------------------------------- |
|
582 // Sets call forward address array. |
|
583 // --------------------------------------------------------------------------- |
|
584 // |
|
585 void CPECallInfo::SetForwardAddressChoices( const CDesC8Array* aArray ) |
|
586 { |
|
587 iForwardAddressChoices = aArray; |
|
588 } |
|
589 |
|
590 // --------------------------------------------------------------------------- |
|
591 // Sets array index. |
|
592 // --------------------------------------------------------------------------- |
|
593 // |
|
594 void CPECallInfo::SetForwardAddressIndex( TInt aIndex ) |
|
595 { |
|
596 iForwardAddressArrayIndex = aIndex; |
|
597 } |
|
598 |
|
599 // --------------------------------------------------------------------------- |
|
600 // Return dtmf postfix. |
|
601 // --------------------------------------------------------------------------- |
|
602 // |
|
603 const TPEDtmfString& CPECallInfo::DtmfPostFix() const |
|
604 { |
|
605 return iDtmfPostFix; |
|
606 } |
|
607 |
|
608 // --------------------------------------------------------------------------- |
|
609 // Sets dtmf postfix. |
|
610 // --------------------------------------------------------------------------- |
|
611 // |
|
612 void CPECallInfo::SetDtmfPostFix( const TPEDtmfString& aDtmfPostFix ) |
|
613 { |
|
614 iDtmfPostFix = aDtmfPostFix; |
|
615 } |
|
616 |
|
617 // --------------------------------------------------------------------------- |
|
618 // Sets call index |
|
619 // --------------------------------------------------------------------------- |
|
620 // |
|
621 void CPECallInfo::SetCallIndex( TInt aCallIndex ) |
|
622 { |
|
623 iCallIndex = aCallIndex; |
|
624 } |
|
625 |
|
626 // --------------------------------------------------------------------------- |
|
627 // Gets call index |
|
628 // --------------------------------------------------------------------------- |
|
629 // |
|
630 TInt CPECallInfo::CallIndex() const |
|
631 { |
|
632 return iCallIndex; |
|
633 } |
|
634 |
|
635 // --------------------------------------------------------------------------- |
|
636 // Sets the origin of a call. |
|
637 // --------------------------------------------------------------------------- |
|
638 // |
|
639 void CPECallInfo::SetCallOrigin( TPECallOrigin aOrigin ) |
|
640 { |
|
641 iCallOrigin = aOrigin; |
|
642 } |
|
643 |
|
644 // --------------------------------------------------------------------------- |
|
645 // Gets the origin of a call. |
|
646 // --------------------------------------------------------------------------- |
|
647 // |
|
648 TPECallOrigin CPECallInfo::CallOrigin() const |
|
649 { |
|
650 return iCallOrigin; |
|
651 } |
|
652 |
|
653 |
|
654 // End of File |
|