74
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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: A parameter class for setting call header information
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
#include <StringLoader.h>
|
|
20 |
#include <bautils.h>
|
|
21 |
|
|
22 |
#include "phonecallheaderutil.h"
|
|
23 |
#include "cphonemainresourceresolver.h"
|
|
24 |
#include "phonerssbase.h"
|
|
25 |
#include "cphonecenrepproxy.h"
|
|
26 |
#include "telephonyvariant.hrh"
|
|
27 |
#include "phoneviewcommanddefinitions.h"
|
|
28 |
#include "phonelogger.h"
|
|
29 |
|
|
30 |
// ======== MEMBER FUNCTIONS ========
|
|
31 |
|
|
32 |
// -----------------------------------------------------------------------------
|
|
33 |
// PhoneCallHeaderUtil::PhoneCallHeaderUtil
|
|
34 |
// -----------------------------------------------------------------------------
|
|
35 |
//
|
|
36 |
PhoneCallHeaderUtil::PhoneCallHeaderUtil(
|
|
37 |
MPEEngineInfo& engineInfo )
|
|
38 |
: m_engineInfo( engineInfo),
|
|
39 |
iLabelText( NULL ),
|
76
|
40 |
iCliText( NULL ),
|
|
41 |
iSecondaryCliText( NULL ),
|
|
42 |
iCallerImage( NULL ),
|
74
|
43 |
iEmergencyHeaderText( NULL ),
|
|
44 |
iAttemptingEmergencyText( NULL )
|
|
45 |
{
|
|
46 |
}
|
|
47 |
|
|
48 |
// -----------------------------------------------------------------------------
|
|
49 |
// PhoneCallHeaderUtil::~PhoneCallHeaderUtil
|
|
50 |
// -----------------------------------------------------------------------------
|
|
51 |
//
|
|
52 |
PhoneCallHeaderUtil::~PhoneCallHeaderUtil()
|
|
53 |
{
|
|
54 |
delete iLabelText;
|
76
|
55 |
delete iCliText;
|
|
56 |
delete iSecondaryCliText;
|
|
57 |
delete iCallerImage;
|
74
|
58 |
delete iEmergencyHeaderText;
|
|
59 |
delete iAttemptingEmergencyText;
|
|
60 |
}
|
|
61 |
|
|
62 |
// -----------------------------------------------------------
|
|
63 |
// PhoneCallHeaderUtil::LabelText
|
|
64 |
// -----------------------------------------------------------
|
|
65 |
//
|
|
66 |
const TDesC& PhoneCallHeaderUtil::LabelText( TInt aCallId )
|
|
67 |
{
|
|
68 |
|
|
69 |
if (iLabelText)
|
|
70 |
{
|
|
71 |
delete iLabelText;
|
|
72 |
iLabelText = NULL;
|
|
73 |
}
|
|
74 |
|
|
75 |
switch (m_engineInfo.CallState(aCallId))
|
|
76 |
{
|
|
77 |
case EPEStateDisconnecting:
|
|
78 |
{
|
|
79 |
iLabelText = LoadResource(EPhoneInCallDisconnected);
|
|
80 |
break;
|
|
81 |
}
|
|
82 |
case EPEStateHeld:
|
|
83 |
case EPEStateHeldConference:
|
|
84 |
{
|
|
85 |
iLabelText = LoadResource(EPhoneCallOnHold);
|
|
86 |
break;
|
|
87 |
}
|
|
88 |
case EPEStateConnectedConference:
|
|
89 |
{
|
|
90 |
iLabelText = LoadResource(EPhoneCLIConferenceCall);
|
|
91 |
break;
|
|
92 |
}
|
|
93 |
case EPEStateRinging:
|
|
94 |
{
|
76
|
95 |
SetCallHeaderLabelTextForRingingCall(aCallId);
|
|
96 |
break;
|
|
97 |
}
|
|
98 |
case EPEStateDialing:
|
|
99 |
{
|
|
100 |
if ( IsVideoCall(aCallId) )
|
74
|
101 |
{
|
76
|
102 |
iLabelText = LoadResource(EPhoneOutgoingVideoCallLabel);
|
|
103 |
}
|
|
104 |
else
|
|
105 |
{
|
|
106 |
iLabelText = LoadResource(EPhoneOutgoingCallLabel);
|
74
|
107 |
}
|
|
108 |
break;
|
|
109 |
}
|
|
110 |
default:
|
|
111 |
break;
|
|
112 |
}
|
|
113 |
|
|
114 |
return iLabelText ? *iLabelText : KNullDesC();
|
|
115 |
}
|
|
116 |
|
|
117 |
// -----------------------------------------------------------
|
76
|
118 |
// PhoneCallHeaderUtil::GetCliTexts
|
|
119 |
// -----------------------------------------------------------
|
|
120 |
//
|
|
121 |
void PhoneCallHeaderUtil::GetCliTexts(
|
|
122 |
TInt aCallId,
|
|
123 |
TDes& aCliText,
|
|
124 |
ClippingDirection &aCliClip,
|
|
125 |
TDes& aSecondaryCliText,
|
|
126 |
ClippingDirection &aSecondaryCliClip )
|
|
127 |
{
|
|
128 |
if ( aCallId == KEmergencyCallId )
|
|
129 |
{
|
|
130 |
// Set "Emergency call" as cli in emergency call.
|
|
131 |
aCliText = EmergencyHeaderText();
|
|
132 |
aCliClip = PhoneCallHeaderUtil::ERight;
|
|
133 |
}
|
|
134 |
else if ( aCallId == KConferenceCallId )
|
|
135 |
{
|
|
136 |
// No need for secondary cli in conference call.
|
|
137 |
GetCli( aCallId, aCliText, aCliClip );
|
|
138 |
}
|
|
139 |
else
|
|
140 |
{
|
|
141 |
GetCli( aCallId, aCliText, aCliClip );
|
|
142 |
GetSecondaryCli( aCallId, aSecondaryCliText, aSecondaryCliClip );
|
|
143 |
}
|
|
144 |
|
|
145 |
}
|
|
146 |
|
|
147 |
// -----------------------------------------------------------
|
|
148 |
// PhoneCallHeaderUtil::GetCli
|
|
149 |
// -----------------------------------------------------------
|
|
150 |
//
|
|
151 |
void PhoneCallHeaderUtil::GetCli( TInt aCallId,
|
|
152 |
TDes& aCliText,
|
|
153 |
ClippingDirection &aClipping )
|
|
154 |
{
|
|
155 |
if (iCliText)
|
|
156 |
{
|
|
157 |
delete iCliText;
|
|
158 |
iCliText = NULL;
|
|
159 |
}
|
|
160 |
|
|
161 |
if ( aCallId == KEmergencyCallId )
|
|
162 |
{
|
|
163 |
aCliText = EmergencyHeaderText();
|
|
164 |
aClipping = PhoneCallHeaderUtil::ERight;
|
|
165 |
return;
|
|
166 |
}
|
|
167 |
else if ( aCallId == KConferenceCallId )
|
|
168 |
{
|
|
169 |
iCliText = LoadResource(EPhoneCLIConferenceCall);
|
|
170 |
}
|
|
171 |
else if ( ( m_engineInfo.RemotePhoneNumber( aCallId ).Length() ) &&
|
|
172 |
( !RemoteNameAvailable( aCallId ) ) )
|
|
173 |
{
|
|
174 |
iCliText = m_engineInfo.RemotePhoneNumber( aCallId ).Alloc();
|
|
175 |
aClipping = PhoneCallHeaderUtil::ELeft;
|
|
176 |
}
|
|
177 |
else
|
|
178 |
{
|
|
179 |
TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC );
|
|
180 |
GetRemoteInfoData( aCallId, remoteInfoText );
|
|
181 |
|
|
182 |
iCliText = remoteInfoText.Alloc();
|
|
183 |
aClipping = PhoneCallHeaderUtil::ERight;
|
|
184 |
}
|
|
185 |
|
|
186 |
aCliText = iCliText ? *iCliText : KNullDesC();
|
|
187 |
}
|
|
188 |
|
|
189 |
// -----------------------------------------------------------
|
|
190 |
// PhoneCallHeaderUtil::GetSecondaryCli
|
|
191 |
// -----------------------------------------------------------
|
|
192 |
//
|
|
193 |
void PhoneCallHeaderUtil::GetSecondaryCli( TInt aCallId,
|
|
194 |
TDes& aSecondaryCliText,
|
|
195 |
ClippingDirection &aClipping )
|
|
196 |
{
|
|
197 |
if (iSecondaryCliText)
|
|
198 |
{
|
|
199 |
delete iSecondaryCliText;
|
|
200 |
iSecondaryCliText = NULL;
|
|
201 |
}
|
|
202 |
|
|
203 |
if ( IsSecondaryCliAllowed( aCallId ) )
|
|
204 |
{
|
|
205 |
if (CPhoneCenRepProxy::Instance()->
|
|
206 |
IsTelephonyFeatureSupported( KTelephonyLVFlagUUS ) &&
|
|
207 |
m_engineInfo.RemotePartyName( aCallId ).Length() )
|
|
208 |
{
|
|
209 |
iSecondaryCliText = m_engineInfo.RemotePartyName( aCallId ).Alloc();
|
|
210 |
aClipping = PhoneCallHeaderUtil::ERight;
|
|
211 |
}
|
|
212 |
else
|
|
213 |
{
|
|
214 |
iSecondaryCliText = m_engineInfo.RemotePhoneNumber( aCallId ).Alloc();
|
|
215 |
aClipping = PhoneCallHeaderUtil::ELeft;
|
|
216 |
}
|
|
217 |
}
|
|
218 |
|
|
219 |
aSecondaryCliText = iSecondaryCliText ? *iSecondaryCliText : KNullDesC();
|
|
220 |
}
|
|
221 |
|
|
222 |
// -----------------------------------------------------------
|
|
223 |
// PhoneCallHeaderUtil::RemotePhoneNumber
|
|
224 |
// -----------------------------------------------------------
|
|
225 |
//
|
|
226 |
const TDesC& PhoneCallHeaderUtil::RemotePhoneNumber( TInt aCallId ) const
|
|
227 |
{
|
|
228 |
return m_engineInfo.RemotePhoneNumber( aCallId );
|
|
229 |
}
|
|
230 |
|
|
231 |
// ---------------------------------------------------------------------------
|
|
232 |
// PhoneCallHeaderUtil::CallType
|
|
233 |
// ---------------------------------------------------------------------------
|
|
234 |
//
|
|
235 |
TInt PhoneCallHeaderUtil::CallType(
|
|
236 |
const TInt aCallId )
|
|
237 |
{
|
|
238 |
return (TInt)m_engineInfo.CallType( aCallId );
|
|
239 |
}
|
|
240 |
|
|
241 |
// ---------------------------------------------------------------------------
|
|
242 |
// PhoneCallHeaderUtil::ServiceId
|
|
243 |
// ---------------------------------------------------------------------------
|
|
244 |
//
|
|
245 |
TInt PhoneCallHeaderUtil::ServiceId(
|
|
246 |
const TInt aCallId )
|
|
247 |
{
|
|
248 |
return m_engineInfo.ServiceId( aCallId );
|
|
249 |
}
|
|
250 |
|
|
251 |
// -----------------------------------------------------------
|
|
252 |
// PhoneCallHeaderUtil::IsCallForwarded
|
|
253 |
// -----------------------------------------------------------
|
|
254 |
//
|
|
255 |
TBool PhoneCallHeaderUtil::IsCallForwarded( TInt aCallId )
|
|
256 |
{
|
|
257 |
return m_engineInfo.IncomingCallForwarded(aCallId);
|
|
258 |
}
|
|
259 |
|
|
260 |
// -----------------------------------------------------------
|
|
261 |
// PhoneCallHeaderUtil::SecureSpecified
|
|
262 |
// -----------------------------------------------------------
|
|
263 |
//
|
|
264 |
TBool PhoneCallHeaderUtil::SecureSpecified()
|
|
265 |
{
|
|
266 |
return m_engineInfo.SecureSpecified();
|
|
267 |
}
|
|
268 |
|
|
269 |
// -----------------------------------------------------------
|
|
270 |
// PhoneCallHeaderUtil::Ciphering
|
|
271 |
// -----------------------------------------------------------
|
|
272 |
//
|
|
273 |
TBool PhoneCallHeaderUtil::Ciphering( TInt aCallId )
|
|
274 |
{
|
|
275 |
return m_engineInfo.IsSecureCall( aCallId );
|
|
276 |
}
|
|
277 |
|
|
278 |
// -----------------------------------------------------------
|
|
279 |
// PhoneCallHeaderUtil::CallState
|
|
280 |
// -----------------------------------------------------------
|
|
281 |
//
|
|
282 |
TInt PhoneCallHeaderUtil::CallState( TInt aCallId ) const
|
|
283 |
{
|
|
284 |
return m_engineInfo.CallState(aCallId);
|
|
285 |
}
|
|
286 |
|
|
287 |
// -----------------------------------------------------------------------------
|
|
288 |
// PhoneCallHeaderUtil::CallerImage
|
|
289 |
// -----------------------------------------------------------------------------
|
|
290 |
//
|
|
291 |
const TDesC& PhoneCallHeaderUtil::CallerImage( const TInt aCallId )
|
|
292 |
{
|
|
293 |
if (iCallerImage)
|
|
294 |
{
|
|
295 |
delete iCallerImage;
|
|
296 |
iCallerImage = NULL;
|
|
297 |
}
|
|
298 |
|
|
299 |
// Set the call header picture data if it is available
|
|
300 |
if ( ( m_engineInfo.CallerImage( aCallId ).Length() > 0 ) &&
|
|
301 |
( BaflUtils::FileExists( CCoeEnv::Static()->FsSession(),
|
|
302 |
m_engineInfo.CallerImage( aCallId ) ) ) )
|
|
303 |
{
|
|
304 |
iCallerImage = m_engineInfo.CallerImage( aCallId ).Alloc();
|
|
305 |
}
|
|
306 |
|
|
307 |
return iCallerImage ? *iCallerImage : KNullDesC();
|
|
308 |
}
|
|
309 |
|
|
310 |
// -----------------------------------------------------------
|
74
|
311 |
// PhoneCallHeaderUtil::EmergencyHeaderText
|
|
312 |
// -----------------------------------------------------------
|
|
313 |
//
|
|
314 |
const TDesC& PhoneCallHeaderUtil::EmergencyHeaderText()
|
|
315 |
{
|
|
316 |
if (!iEmergencyHeaderText)
|
|
317 |
{
|
|
318 |
iEmergencyHeaderText = LoadResource(EPhoneEmergencyCallHeader);
|
|
319 |
}
|
|
320 |
|
|
321 |
return iEmergencyHeaderText ? *iEmergencyHeaderText : KNullDesC();
|
|
322 |
}
|
|
323 |
|
|
324 |
// -----------------------------------------------------------
|
|
325 |
// PhoneCallHeaderUtil::AttemptingEmergencyText
|
|
326 |
// -----------------------------------------------------------
|
|
327 |
//
|
|
328 |
const TDesC& PhoneCallHeaderUtil::AttemptingEmergencyText()
|
|
329 |
{
|
|
330 |
if (!iAttemptingEmergencyText)
|
|
331 |
{
|
|
332 |
iAttemptingEmergencyText = LoadResource(EPhoneAttemptingEmergencyText);
|
|
333 |
}
|
|
334 |
|
|
335 |
return iAttemptingEmergencyText ? *iAttemptingEmergencyText : KNullDesC();
|
|
336 |
}
|
|
337 |
|
76
|
338 |
// ---------------------------------------------------------------------------
|
|
339 |
// PhoneCallHeaderUtil::IsVoiceCall
|
|
340 |
// ---------------------------------------------------------------------------
|
74
|
341 |
//
|
76
|
342 |
TBool PhoneCallHeaderUtil::IsVoiceCall(TInt aCallId) const
|
74
|
343 |
{
|
76
|
344 |
if( aCallId < 0 )
|
74
|
345 |
{
|
76
|
346 |
return ( m_engineInfo.CallTypeCommand()
|
|
347 |
== EPECallTypeCSVoice ||
|
|
348 |
m_engineInfo.CallTypeCommand()
|
|
349 |
== EPECallTypeVoIP );
|
74
|
350 |
}
|
|
351 |
|
76
|
352 |
return ( m_engineInfo.CallType( aCallId )
|
|
353 |
== EPECallTypeCSVoice ||
|
|
354 |
m_engineInfo.CallType( aCallId )
|
|
355 |
== EPECallTypeVoIP );
|
74
|
356 |
}
|
|
357 |
|
|
358 |
// ---------------------------------------------------------------------------
|
76
|
359 |
// PhoneCallHeaderUtil::IsVideoCall
|
74
|
360 |
// ---------------------------------------------------------------------------
|
|
361 |
//
|
76
|
362 |
TBool PhoneCallHeaderUtil::IsVideoCall(int aCallId ) const
|
74
|
363 |
{
|
76
|
364 |
if( aCallId < 0 )
|
74
|
365 |
{
|
76
|
366 |
return ( m_engineInfo.CallTypeCommand()
|
|
367 |
== EPECallTypeVideo );
|
74
|
368 |
}
|
76
|
369 |
return ( m_engineInfo.CallType( aCallId )
|
|
370 |
== EPECallTypeVideo );
|
74
|
371 |
}
|
|
372 |
|
76
|
373 |
// -----------------------------------------------------------
|
|
374 |
// PhoneCallHeaderUtil::SetCallHeaderLabelTextForRingingCall
|
|
375 |
// -----------------------------------------------------------
|
|
376 |
//
|
|
377 |
void PhoneCallHeaderUtil::SetCallHeaderLabelTextForRingingCall( TInt aCallId )
|
74
|
378 |
{
|
76
|
379 |
__LOGMETHODSTARTEND(EPhoneControl, "PhoneCallHeaderUtil::CallHeaderLabelTextForRingingCall( ) ");
|
74
|
380 |
|
76
|
381 |
TInt labelId(0);
|
74
|
382 |
|
76
|
383 |
// Fetch engine info parameters.
|
|
384 |
const TBool auxLine( m_engineInfo.CallALSLine( aCallId ) == CCCECallParameters::ECCELineTypeAux );
|
|
385 |
const TBool cli( m_engineInfo.RemotePhoneNumber( aCallId ).Length());
|
|
386 |
const TBool cnap( m_engineInfo.RemotePartyName( aCallId ).Length());
|
|
387 |
const TBool videoCall( IsVideoCall( aCallId ) );
|
|
388 |
const TBool waitingCall( IsWaitingCall( aCallId ) );
|
|
389 |
const TInt numberType( m_engineInfo.RemotePhoneNumberType( aCallId ));
|
74
|
390 |
|
76
|
391 |
if ( !cli && !cnap && numberType != EPEPrivateNumber && numberType != EPEUnknownNumber )
|
74
|
392 |
{
|
76
|
393 |
if ( auxLine )
|
74
|
394 |
{
|
76
|
395 |
if ( waitingCall )
|
|
396 |
{
|
|
397 |
labelId = EPhoneIncomingLine2WaitingText; // waiting, line 2
|
|
398 |
}
|
|
399 |
else
|
|
400 |
{
|
|
401 |
labelId = EPhoneIncomingLine2Text; // on line 2
|
|
402 |
}
|
|
403 |
}
|
|
404 |
// If CLIR, but also network limitation(e.g. EPEUnknownNumber), then second line
|
|
405 |
// should be empty in call bubble.
|
|
406 |
else
|
|
407 |
{
|
|
408 |
labelId = KPhoneRssCommonFirst; // No second line in call bubble
|
74
|
409 |
}
|
|
410 |
}
|
76
|
411 |
else // Voice or video call with CLI or with CNAP.
|
74
|
412 |
{
|
76
|
413 |
if ( waitingCall )
|
74
|
414 |
{
|
76
|
415 |
if ( auxLine )
|
74
|
416 |
{
|
76
|
417 |
labelId = EPhoneIncomingLine2WaitingText; // waiting, line 2
|
|
418 |
}
|
|
419 |
else
|
|
420 |
{
|
|
421 |
labelId = EPhoneCallWaitingLabel; // waiting
|
74
|
422 |
}
|
|
423 |
}
|
76
|
424 |
else // Mo other calls
|
|
425 |
{
|
|
426 |
if ( auxLine )
|
|
427 |
{
|
|
428 |
labelId = EPhoneIncomingLine2CallingText; // calling, line 2
|
|
429 |
}
|
|
430 |
else
|
|
431 |
{
|
|
432 |
// If CLIR, but not network limitation, then second line
|
|
433 |
// (calling or video call) should be shown in call bubble.
|
|
434 |
if ( videoCall )
|
|
435 |
{
|
|
436 |
labelId = EPhoneVideoCallIncoming; // video call
|
|
437 |
}
|
|
438 |
else
|
|
439 |
{
|
|
440 |
labelId = EPhoneIncomingCallLabel; // calling
|
|
441 |
}
|
|
442 |
}
|
|
443 |
}
|
74
|
444 |
}
|
76
|
445 |
__PHONELOG1( EBasic, EPhoneControl, "PhoneCallHeaderUtil::SetCallHeaderTexts - labelId(%d)", labelId );
|
|
446 |
iLabelText = LoadResource(labelId) ;
|
74
|
447 |
}
|
|
448 |
|
|
449 |
// ---------------------------------------------------------------------------
|
76
|
450 |
// PhoneCallHeaderUtil::RemoteNameAvailable
|
74
|
451 |
// ---------------------------------------------------------------------------
|
|
452 |
//
|
76
|
453 |
TBool PhoneCallHeaderUtil::RemoteNameAvailable( const TInt aCallId ) const
|
74
|
454 |
{
|
76
|
455 |
__LOGMETHODSTARTEND(EPhoneControl, "PhoneCallHeaderUtil::ContactInfoAvailable( ) ");
|
74
|
456 |
|
76
|
457 |
TBool ret( m_engineInfo.RemoteName( aCallId ).Length() ||
|
|
458 |
m_engineInfo.RemoteCompanyName( aCallId ).Length() );
|
74
|
459 |
|
76
|
460 |
if ( EFalse == ret && m_engineInfo.RemotePartyName( aCallId ).Length() )
|
74
|
461 |
{
|
76
|
462 |
ret = !CPhoneCenRepProxy::Instance()->
|
|
463 |
IsTelephonyFeatureSupported( KTelephonyLVFlagUUS );
|
74
|
464 |
}
|
76
|
465 |
|
|
466 |
return ret;
|
74
|
467 |
}
|
|
468 |
|
|
469 |
// ---------------------------------------------------------------------------
|
|
470 |
// PhoneCallHeaderUtil::GetRemoteInfoDataL
|
|
471 |
// ---------------------------------------------------------------------------
|
|
472 |
//
|
76
|
473 |
void PhoneCallHeaderUtil::GetRemoteInfoData(
|
74
|
474 |
const TInt aCallId,
|
|
475 |
TDes& aData ) const
|
|
476 |
{
|
|
477 |
__LOGMETHODSTARTEND( EPhoneControl, "PhoneCallHeaderUtil::GetRemoteInfoDataL() ");
|
|
478 |
__PHONELOG1( EBasic, EPhoneControl, "PhoneCallHeaderUtil::GetRemoteInfoDataL() - call id =%d ", aCallId);
|
76
|
479 |
|
74
|
480 |
if ( aCallId == KEmergencyCallId )
|
|
481 |
{
|
|
482 |
// Set emergency label text
|
|
483 |
LoadResource( aData, EPhoneEmergencyCallHeader );
|
|
484 |
}
|
|
485 |
else
|
|
486 |
{
|
|
487 |
// Note next if-statements are in priority order so be careful if you change order
|
|
488 |
// or add new if-statements.
|
|
489 |
if ( m_engineInfo.RemoteName( aCallId ).Length() )
|
|
490 |
{
|
|
491 |
// Display the contact name if it is available
|
|
492 |
aData.Copy( m_engineInfo.RemoteName( aCallId ) );
|
|
493 |
}
|
|
494 |
else if ( m_engineInfo.RemotePartyName( aCallId ).Length() )
|
|
495 |
{
|
|
496 |
// Display the CNAP or UUS info if it is available.
|
|
497 |
aData.Copy( m_engineInfo.RemotePartyName( aCallId ) );
|
|
498 |
}
|
|
499 |
else if ( m_engineInfo.RemoteCompanyName( aCallId ).Length() )
|
|
500 |
{
|
|
501 |
// Display the company name if it is available
|
|
502 |
aData.Copy( m_engineInfo.RemoteCompanyName( aCallId ) );
|
|
503 |
}
|
|
504 |
else if ( m_engineInfo.CallDirection( aCallId ) == RMobileCall::EMobileTerminated )
|
|
505 |
{
|
76
|
506 |
const RMobileCall::TMobileCallRemoteIdentityStatus identity =
|
|
507 |
m_engineInfo.RemoteIdentity( aCallId );
|
|
508 |
|
74
|
509 |
if ( EPEPrivateNumber == m_engineInfo.RemotePhoneNumberType( aCallId ) )
|
|
510 |
{
|
76
|
511 |
if ( EPECallTypeVoIP == m_engineInfo.CallType( aCallId ) )
|
74
|
512 |
{
|
76
|
513 |
// TODO voip LoadResource( aData, iManagerUtility.Customization()->CustomizeCallHeaderText() );
|
74
|
514 |
}
|
|
515 |
else
|
|
516 |
{
|
|
517 |
// private number
|
|
518 |
LoadResource( aData, EPhoneCLIWithheld );
|
|
519 |
}
|
|
520 |
}
|
|
521 |
else if ( identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone ||
|
|
522 |
identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone )
|
|
523 |
{
|
|
524 |
// Display "Payphone".
|
|
525 |
LoadResource( aData, EPhoneCLIPayphone );
|
|
526 |
}
|
|
527 |
else if ( identity == RMobileCall::ERemoteIdentityUnknown )
|
|
528 |
{
|
|
529 |
__PHONELOG( EBasic, EPhoneControl, "GetRemoteInfoDataL : unknown number" );
|
|
530 |
// Display "Unknown Number".
|
|
531 |
LoadResource( aData, EPhoneCallCLIUnknown );
|
|
532 |
}
|
|
533 |
else if ( m_engineInfo.RemotePhoneNumber( aCallId ).Length() )
|
|
534 |
{
|
|
535 |
// Display the number if it is available
|
|
536 |
aData.Copy( m_engineInfo.RemotePhoneNumber( aCallId ) );
|
|
537 |
}
|
|
538 |
}
|
|
539 |
}
|
|
540 |
}
|
|
541 |
|
|
542 |
// -----------------------------------------------------------
|
76
|
543 |
// PhoneCallHeaderUtil::IsSecondaryCliAllowed
|
74
|
544 |
// -----------------------------------------------------------
|
|
545 |
//
|
76
|
546 |
TBool PhoneCallHeaderUtil::IsSecondaryCliAllowed( TInt aCallId )
|
74
|
547 |
{
|
76
|
548 |
TBool ret( ( aCallId != KEmergencyCallId &&
|
|
549 |
( m_engineInfo.RemoteName( aCallId ).Length() ||
|
|
550 |
m_engineInfo.RemotePartyName( aCallId ).Length() ||
|
|
551 |
m_engineInfo.RemoteCompanyName( aCallId ).Length() ) &&
|
|
552 |
m_engineInfo.RemotePhoneNumber( aCallId ).Length() ) );
|
|
553 |
|
|
554 |
if ( ret && RMobileCall::EMobileTerminated ==
|
|
555 |
m_engineInfo.CallDirection( aCallId ) )
|
74
|
556 |
{
|
76
|
557 |
const RMobileCall::TMobileCallRemoteIdentityStatus identity =
|
|
558 |
m_engineInfo.RemoteIdentity( aCallId );
|
|
559 |
|
|
560 |
if ( m_engineInfo.RemotePhoneNumberType( aCallId ) == EPEPrivateNumber ||
|
|
561 |
identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone ||
|
|
562 |
identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone ||
|
|
563 |
identity == RMobileCall::ERemoteIdentityUnknown )
|
|
564 |
{
|
|
565 |
ret = EFalse;
|
|
566 |
}
|
74
|
567 |
}
|
76
|
568 |
|
|
569 |
return ret;
|
74
|
570 |
}
|
|
571 |
|
76
|
572 |
// -----------------------------------------------------------
|
|
573 |
// PhoneCallHeaderUtil::IsWaitingCall
|
|
574 |
// -----------------------------------------------------------
|
74
|
575 |
//
|
76
|
576 |
TBool PhoneCallHeaderUtil::IsWaitingCall(int callId) const
|
74
|
577 |
{
|
76
|
578 |
bool waiting( EFalse );
|
|
579 |
if ( callId >= 0 &&
|
|
580 |
m_engineInfo.CallState( callId ) == EPEStateRinging )
|
|
581 |
{
|
|
582 |
if ( m_engineInfo.CheckIfCallStateExists(EPEStateConnected) ||
|
|
583 |
m_engineInfo.CheckIfCallStateExists(EPEStateConnectedConference) ||
|
|
584 |
m_engineInfo.CheckIfCallStateExists(EPEStateDisconnecting) ||
|
|
585 |
m_engineInfo.CheckIfCallStateExists(EPEStateHeld) ||
|
|
586 |
m_engineInfo.CheckIfCallStateExists(EPEStateHeldConference) )
|
|
587 |
{
|
|
588 |
waiting = ETrue;
|
|
589 |
}
|
|
590 |
}
|
|
591 |
return waiting;
|
74
|
592 |
}
|
|
593 |
|
|
594 |
// ---------------------------------------------------------------------------
|
|
595 |
// PhoneCallHeaderUtil::LoadResource
|
|
596 |
// ---------------------------------------------------------------------------
|
|
597 |
//
|
|
598 |
HBufC* PhoneCallHeaderUtil::LoadResource( const TInt aResource ) const
|
|
599 |
{
|
|
600 |
HBufC* ret = NULL;
|
|
601 |
|
|
602 |
TRAP_IGNORE( ret = StringLoader::LoadL(
|
|
603 |
CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ),
|
|
604 |
CCoeEnv::Static() ) );
|
|
605 |
|
|
606 |
return ret;
|
|
607 |
}
|
|
608 |
|
|
609 |
// ---------------------------------------------------------------------------
|
76
|
610 |
// PhoneCallHeaderUtil::LoadResource
|
74
|
611 |
// ---------------------------------------------------------------------------
|
|
612 |
//
|
76
|
613 |
void PhoneCallHeaderUtil::LoadResource( TDes& aData, const TInt aResource ) const
|
74
|
614 |
{
|
76
|
615 |
StringLoader::Load(
|
|
616 |
aData, CPhoneMainResourceResolver::Instance()->ResolveResourceID( aResource ),
|
|
617 |
CCoeEnv::Static() );
|
74
|
618 |
}
|
76
|
619 |
|
|
620 |
|