author | William Roberts <williamr@symbian.org> |
Thu, 22 Jul 2010 16:33:21 +0100 | |
branch | GCC_SURGE |
changeset 51 | f39ed5e045e0 |
parent 22 | 6bb1b21d2484 |
parent 45 | 6b911d05207e |
permissions | -rw-r--r-- |
37 | 1 |
/* |
2 |
* Copyright (c) 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: A parameter class for setting call header information |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <mpeclientinformation.h> |
|
20 |
#include <StringLoader.h> |
|
21 |
#include <bautils.h> |
|
22 |
||
23 |
#include "tphonecallheaderparam.h" |
|
24 |
#include "tphonecmdparamboolean.h" |
|
25 |
#include "mphonestatemachine.h" |
|
26 |
#include "mphonecallheadermanagerutility.h" |
|
27 |
#include "cphonemainresourceresolver.h" |
|
28 |
#include "phonerssbase.h" |
|
29 |
#include "phoneui.pan" |
|
30 |
#include "cphonecenrepproxy.h" |
|
31 |
#include "telephonyvariant.hrh" |
|
32 |
#include "phoneviewcommanddefinitions.h" |
|
33 |
#include "phonelogger.h" |
|
34 |
||
35 |
// ======== MEMBER FUNCTIONS ======== |
|
36 |
||
37 |
// ----------------------------------------------------------------------------- |
|
38 |
// TPhoneCallHeaderParam::TPhoneCallHeaderParam |
|
39 |
// ----------------------------------------------------------------------------- |
|
40 |
// |
|
41 |
TPhoneCallHeaderParam::TPhoneCallHeaderParam( |
|
42 |
MPhoneCallHeaderManagerUtility& aManagerUtility, |
|
43 |
MPhoneStateMachine& aStateMachine ) |
|
44 |
: iManagerUtility ( aManagerUtility ), |
|
45 |
iStateMachine ( aStateMachine ), |
|
46 |
iCallHeaderType ( EPECallTypeUninitialized ), |
|
47 |
iSetDivertIndication ( EFalse ) |
|
48 |
{ |
|
49 |
} |
|
50 |
||
51 |
// ----------------------------------------------------------- |
|
52 |
// TPhoneCallHeaderParam::SetCallHeaderTexts |
|
53 |
// ----------------------------------------------------------- |
|
54 |
// |
|
55 |
void TPhoneCallHeaderParam::SetCallHeaderTexts( |
|
56 |
const TInt aCallId, |
|
57 |
const TBool aWaitingCall, |
|
58 |
const TBool aVideoCall, |
|
59 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
60 |
{ |
|
61 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts( ) "); |
|
62 |
||
63 |
TInt labelId(KPhoneRssCommonFirst); |
|
64 |
TInt shortLabelId( KPhoneRssCommonFirst ); |
|
65 |
||
66 |
// Fetch engine info parameters. |
|
67 |
const TBool auxLine( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) == CCCECallParameters::ECCELineTypeAux ); |
|
68 |
const TBool cli( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length()); |
|
69 |
const TBool cnap( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length()); |
|
70 |
const TInt numberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId )); |
|
71 |
||
72 |
__PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - NumberType(%d), CLI(%d)", numberType, cli ); |
|
73 |
__PHONELOG2( EBasic, EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderTexts - CNAP(%d), AuxLine(%d)", cnap, auxLine ); |
|
74 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
75 |
if ( !cli && !cnap && numberType != EPEPrivateNumber && numberType != EPEUnknownNumber ) |
37 | 76 |
{ |
77 |
if ( auxLine ) |
|
78 |
{ |
|
79 |
if ( aWaitingCall ) |
|
80 |
{ |
|
81 |
labelId = EPhoneIncomingLine2WaitingText; // waiting, line 2 |
|
82 |
shortLabelId = EPhoneIncomingLine2Text; // on line 2 |
|
83 |
} |
|
84 |
else |
|
85 |
{ |
|
86 |
labelId = EPhoneIncomingLine2Text; // on line 2 |
|
87 |
} |
|
88 |
} |
|
89 |
// If CLIR, but also network limitation(e.g. EPEUnknownNumber), then second line |
|
90 |
// should be empty in call bubble. |
|
91 |
else |
|
92 |
{ |
|
93 |
labelId = KPhoneRssCommonFirst; // No second line in call bubble |
|
94 |
} |
|
95 |
} |
|
96 |
else // Voice or video call with CLI or with CNAP. |
|
97 |
{ |
|
98 |
if ( aWaitingCall ) |
|
99 |
{ |
|
100 |
if ( auxLine ) |
|
101 |
{ |
|
102 |
labelId = EPhoneIncomingLine2WaitingText; // waiting, line 2 |
|
103 |
shortLabelId = EPhoneIncomingLine2Text; // on line 2 |
|
104 |
} |
|
105 |
else |
|
106 |
{ |
|
107 |
labelId = EPhoneCallWaitingLabel; // waiting |
|
108 |
shortLabelId = EPhoneCallWaitingLabelShort; // waiting |
|
109 |
} |
|
110 |
} |
|
111 |
else // Mo other calls |
|
112 |
{ |
|
113 |
if ( auxLine ) |
|
114 |
{ |
|
115 |
labelId = EPhoneIncomingLine2CallingText; // calling, line 2 |
|
116 |
shortLabelId = EPhoneIncomingLine2Text; // on line 2 |
|
117 |
} |
|
118 |
else |
|
119 |
{ |
|
120 |
// If CLIR, but not network limitation, then second line |
|
121 |
// (calling or video call) should be shown in call bubble. |
|
122 |
if ( aVideoCall ) |
|
123 |
{ |
|
124 |
labelId = EPhoneVideoCallIncoming; // video call |
|
125 |
shortLabelId = EPhoneVideoCallIncomingShort; // video call |
|
126 |
} |
|
127 |
else |
|
128 |
{ |
|
129 |
labelId = EPhoneIncomingCallLabel; // calling |
|
130 |
shortLabelId = EPhoneIncomingCallLabelShort; // calling |
|
131 |
} |
|
132 |
} |
|
133 |
} |
|
134 |
} |
|
135 |
__PHONELOG2( EBasic, EPhoneControl, |
|
136 |
"TPhoneCallHeaderParam::SetCallHeaderTexts - labelId(%d) , shortLabelId(%d)", |
|
137 |
labelId, shortLabelId ); |
|
138 |
iManagerUtility.LoadCallHeaderTexts( labelId, shortLabelId, aCallHeaderData ); |
|
139 |
} |
|
140 |
||
141 |
// ----------------------------------------------------------------------------- |
|
142 |
// TPhoneCallHeaderParam::SetCliParamatersL |
|
143 |
// ----------------------------------------------------------------------------- |
|
144 |
// |
|
145 |
void TPhoneCallHeaderParam::SetCliParamatersL( |
|
146 |
const TInt aCallId, |
|
147 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
148 |
{ |
|
149 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCliParamatersL( ) "); |
|
150 |
||
151 |
// Set call header number type |
|
152 |
aCallHeaderData->SetNumberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) ); |
|
153 |
||
154 |
if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && |
|
155 |
( !ContactInfoAvailable( aCallId ) ) ) |
|
156 |
{ |
|
157 |
// Set phonenumber/URI as the CLI text for the call header |
|
158 |
aCallHeaderData->SetCLIText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), |
|
159 |
TPhoneCmdParamCallHeaderData::ELeft ); |
|
160 |
||
161 |
// No contact name, use phonenumber when available. |
|
162 |
aCallHeaderData->SetParticipantListCLI( |
|
163 |
TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText ); |
|
164 |
} |
|
165 |
else |
|
166 |
{ |
|
167 |
TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection = TPhoneCmdParamCallHeaderData::ERight; |
|
168 |
TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC ); |
|
169 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
170 |
TBool secondaryCli = GetRemoteInfoDataL( aCallId, remoteInfoText ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
171 |
cnapClippingDirection = TPhoneCmdParamCallHeaderData::ELeft; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
172 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
173 |
aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
174 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
175 |
if (secondaryCli) |
37 | 176 |
{ |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
177 |
aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
178 |
cnapClippingDirection ); |
37 | 179 |
} |
180 |
} |
|
181 |
||
182 |
SetCallerImage( aCallId, aCallHeaderData ); |
|
183 |
||
184 |
// Set the Caller text |
|
185 |
if ( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 ) |
|
186 |
{ |
|
187 |
aCallHeaderData->SetCallerText( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ) ); |
|
188 |
} |
|
189 |
} |
|
190 |
||
191 |
// ----------------------------------------------------------------------------- |
|
192 |
// TPhoneCallHeaderParam::SetCallerImage |
|
193 |
// ----------------------------------------------------------------------------- |
|
194 |
// |
|
195 |
void TPhoneCallHeaderParam::SetCallerImage( |
|
196 |
const TInt aCallId, |
|
197 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
198 |
{ |
|
199 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallerImage( ) "); |
|
200 |
// Set the call header picture data if it is available |
|
201 |
if ( ( iStateMachine.PhoneEngineInfo()->CallerImage( aCallId ).Length() > 0 ) && |
|
202 |
( BaflUtils::FileExists( CCoeEnv::Static()->FsSession(), |
|
203 |
iStateMachine.PhoneEngineInfo()->CallerImage( aCallId ) ) ) ) |
|
204 |
{ |
|
205 |
aCallHeaderData->SetPicture( iStateMachine.PhoneEngineInfo()->CallerImage( aCallId ) ); |
|
206 |
} |
|
207 |
else |
|
208 |
{ |
|
209 |
// Set the thumbnail picture data if it is available |
|
210 |
aCallHeaderData->SetHasThumbnail( iStateMachine.PhoneEngineInfo()->HasCallerThumbnail( aCallId ) ); |
|
211 |
CFbsBitmap* picture = iStateMachine.PhoneEngineInfo()->CallerThumbnail( aCallId ); |
|
212 |
if ( picture ) |
|
213 |
{ |
|
214 |
aCallHeaderData->SetThumbnail( picture ); |
|
215 |
} |
|
216 |
} |
|
217 |
} |
|
218 |
||
219 |
// --------------------------------------------------------------------------- |
|
220 |
// TPhoneCallHeaderParam::SetBasicCallHeaderParamsL |
|
221 |
// --------------------------------------------------------------------------- |
|
222 |
// |
|
223 |
void TPhoneCallHeaderParam::SetBasicCallHeaderParamsL( |
|
224 |
const TInt aCallId, |
|
225 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
226 |
{ |
|
227 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetBasicCallHeaderParamsL( ) "); |
|
228 |
// Set call header call state |
|
229 |
aCallHeaderData->SetCallState( |
|
230 |
iStateMachine.PhoneEngineInfo()->CallState( aCallId ) ); |
|
231 |
||
232 |
// Set call header type |
|
233 |
aCallHeaderData->SetCallType( GetCallType( aCallId, aCallHeaderData ) ); |
|
234 |
||
235 |
// Set call header voice privacy status |
|
236 |
aCallHeaderData->SetCiphering( |
|
237 |
iStateMachine.PhoneEngineInfo()->IsSecureCall( aCallId ) ); |
|
238 |
aCallHeaderData->SetCipheringIndicatorAllowed( |
|
239 |
iStateMachine.PhoneEngineInfo()->SecureSpecified() ); |
|
240 |
||
241 |
iManagerUtility.SetPhoneNumberAvailabilityL( |
|
242 |
iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length(), |
|
243 |
ContactInfoAvailable( aCallId ) ); |
|
244 |
||
245 |
//see service provider settings API |
|
246 |
aCallHeaderData->SetServiceId( |
|
247 |
iStateMachine.PhoneEngineInfo()->ServiceId( aCallId ) ); |
|
248 |
||
249 |
// Set contact link, see virtual phonebook API |
|
250 |
aCallHeaderData->SetContactLink( |
|
251 |
iStateMachine.PhoneEngineInfo()->ContactLink( aCallId ) ); |
|
252 |
||
253 |
// Set remote phone number |
|
254 |
aCallHeaderData->SetRemotePhoneNumber( |
|
255 |
iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) ); |
|
256 |
} |
|
257 |
||
258 |
// --------------------------------------------------------------------------- |
|
259 |
// TPhoneCallHeaderParam::GetCallType |
|
260 |
// --------------------------------------------------------------------------- |
|
261 |
// |
|
262 |
TPECallType TPhoneCallHeaderParam::GetCallType( |
|
263 |
const TInt aCallId, |
|
264 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
265 |
{ |
|
266 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCallType( ) "); |
|
267 |
// Set call header type. |
|
268 |
TPECallType callType = |
|
269 |
iStateMachine.PhoneEngineInfo()->CallType( aCallId ); |
|
270 |
SetCallHeaderType( callType ); |
|
271 |
||
272 |
if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) |
|
273 |
== CCCECallParameters::ECCELineTypeAux ) |
|
274 |
{ |
|
275 |
aCallHeaderData->SetLine2( ETrue ); |
|
276 |
} |
|
277 |
||
278 |
__PHONELOG1( EBasic, EPhoneControl, |
|
279 |
"TPhoneCallHeaderParam::GetCallType() - callType: %d ", |
|
280 |
callType ) |
|
281 |
return callType; |
|
282 |
} |
|
283 |
||
284 |
// --------------------------------------------------------------------------- |
|
285 |
// TPhoneCallHeaderParam::SetCallHeaderType |
|
286 |
// --------------------------------------------------------------------------- |
|
287 |
// |
|
288 |
void TPhoneCallHeaderParam::SetCallHeaderType( |
|
289 |
TInt aCallHeaderType ) |
|
290 |
{ |
|
291 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCallHeaderType( ) "); |
|
292 |
iCallHeaderType = aCallHeaderType; |
|
293 |
__PHONELOG1( EBasic, EPhoneControl, |
|
294 |
"TPhoneCallHeaderParam::SetCallHeaderType() - iCallHeaderType: %d ", |
|
295 |
iCallHeaderType ) |
|
296 |
} |
|
297 |
||
298 |
// --------------------------------------------------------------------------- |
|
299 |
// TPhoneCallHeaderParam::CallHeaderType |
|
300 |
// --------------------------------------------------------------------------- |
|
301 |
// |
|
302 |
TInt TPhoneCallHeaderParam::CallHeaderType() const |
|
303 |
{ |
|
304 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::CallHeaderType( ) "); |
|
305 |
__PHONELOG1( EBasic, EPhoneControl, |
|
306 |
"TPhoneCallHeaderParam::CallHeaderType() - iCallHeaderType: %d ", |
|
307 |
iCallHeaderType ) |
|
308 |
return iCallHeaderType; |
|
309 |
} |
|
310 |
||
311 |
// --------------------------------------------------------------------------- |
|
312 |
// TPhoneCallHeaderParam::ContactInfoAvailable |
|
313 |
// --------------------------------------------------------------------------- |
|
314 |
// |
|
315 |
TBool TPhoneCallHeaderParam::ContactInfoAvailable( const TInt aCallId ) const |
|
316 |
{ |
|
317 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::ContactInfoAvailable( ) "); |
|
318 |
TBool contactAvailable = EFalse; |
|
319 |
if ( ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() ) || |
|
320 |
( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() ) ) |
|
321 |
{ |
|
322 |
contactAvailable = ETrue; |
|
323 |
} |
|
324 |
return contactAvailable; |
|
325 |
} |
|
326 |
||
327 |
// ----------------------------------------------------------------------------- |
|
328 |
// TPhoneCallHeaderParam::SetCliAndCnapParamatersL |
|
329 |
// ----------------------------------------------------------------------------- |
|
330 |
// |
|
331 |
void TPhoneCallHeaderParam::SetCliAndCnapParamatersL( |
|
332 |
const TInt aCallId, |
|
333 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
334 |
{ |
|
335 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetCliAndCnapParamatersL( ) "); |
|
336 |
TBuf<KCntMaxTextFieldLength> cnapText( KNullDesC ); |
|
337 |
||
338 |
// Set call header number type |
|
339 |
aCallHeaderData->SetNumberType( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) ); |
|
340 |
||
341 |
const MPEClientInformation& info = |
|
342 |
iStateMachine.PhoneEngineInfo()->CallClientInformation( aCallId ); |
|
343 |
||
344 |
if ( ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) && |
|
345 |
( !ContactInfoAvailable( aCallId ) ) && |
|
346 |
( !info.ShowNumber() ) ) |
|
347 |
{ |
|
348 |
// No contact info data available; use the phone number |
|
349 |
aCallHeaderData->SetCLIText( |
|
350 |
iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), |
|
351 |
TPhoneCmdParamCallHeaderData::ELeft); |
|
352 |
||
353 |
// No contact name, use phonenumber when available. |
|
354 |
aCallHeaderData->SetParticipantListCLI( |
|
355 |
TPhoneCmdParamCallHeaderData::EPhoneParticipantCNAPText ); |
|
356 |
} |
|
357 |
else |
|
358 |
{ |
|
359 |
TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC ); |
|
360 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
361 |
GetRemoteInfoDataL( aCallId, remoteInfoText ); |
37 | 362 |
aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight ); |
363 |
} |
|
364 |
||
365 |
// Fetch CNAP text and clipping direction |
|
366 |
TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection cnapClippingDirection; |
|
367 |
GetCNAPText( aCallId, cnapText, cnapClippingDirection ); |
|
368 |
||
369 |
// Set CNAP data |
|
370 |
aCallHeaderData->SetCNAPText( cnapText, cnapClippingDirection ); |
|
371 |
||
372 |
// Set caller image |
|
373 |
SetCallerImage( aCallId, aCallHeaderData ); |
|
374 |
||
375 |
// Set the Caller text |
|
376 |
if ( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ).Length() > 0 ) |
|
377 |
{ |
|
378 |
aCallHeaderData->SetCallerText( iStateMachine.PhoneEngineInfo()->CallerText( aCallId ) ); |
|
379 |
} |
|
380 |
||
381 |
// Set the call header CNAP data ( Contains possible CNAP name or received skype identification ). |
|
382 |
if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) ) |
|
383 |
{ |
|
384 |
aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ), |
|
385 |
TPhoneCmdParamCallHeaderData::ERight ); |
|
386 |
} |
|
387 |
} |
|
388 |
||
389 |
// --------------------------------------------------------------------------- |
|
390 |
// TPhoneCallHeaderParam::GetCNAPText |
|
391 |
// --------------------------------------------------------------------------- |
|
392 |
// |
|
393 |
void TPhoneCallHeaderParam::GetCNAPText( |
|
394 |
const TInt aCallId, |
|
395 |
TDes& aData, |
|
396 |
TPhoneCmdParamCallHeaderData::TPhoneTextClippingDirection& aDirection ) const |
|
397 |
{ |
|
398 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::GetCNAPText( ) "); |
|
399 |
||
400 |
// Set clipping direction |
|
401 |
aDirection = TPhoneCmdParamCallHeaderData::ERight; |
|
402 |
||
403 |
// If it's not a private number show further info |
|
404 |
if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) != |
|
405 |
EPEPrivateNumber ) |
|
406 |
{ |
|
407 |
if ( ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() || |
|
408 |
iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() || |
|
409 |
iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() ) && |
|
410 |
iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) |
|
411 |
{ |
|
412 |
// Use the phone number for the CNAP display |
|
413 |
aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) ); |
|
414 |
||
415 |
// Clipping direction for non-private number |
|
416 |
aDirection = TPhoneCmdParamCallHeaderData::ELeft; |
|
417 |
} |
|
418 |
} |
|
419 |
} |
|
420 |
||
421 |
// --------------------------------------------------------------------------- |
|
422 |
// TPhoneCallHeaderParam::IsFeatureSupported |
|
423 |
// --------------------------------------------------------------------------- |
|
424 |
// |
|
425 |
TBool TPhoneCallHeaderParam::IsFeatureSupported( |
|
426 |
const TInt aFeatureKey, |
|
427 |
const TInt aCallId ) const |
|
428 |
{ |
|
429 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::IsFeatureSupported( ) "); |
|
430 |
TBool featureSupport(EFalse); |
|
431 |
switch( aFeatureKey ) |
|
432 |
{ |
|
433 |
case KTelephonyLVFlagUUS: |
|
434 |
{ |
|
435 |
if( ( CPhoneCenRepProxy::Instance()->IsTelephonyFeatureSupported( aFeatureKey ) ) && |
|
436 |
( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() ) ) |
|
437 |
{ |
|
438 |
featureSupport = ETrue; |
|
439 |
} |
|
440 |
} |
|
441 |
break; |
|
442 |
default: |
|
443 |
//Do nothing. |
|
444 |
break; |
|
445 |
} |
|
446 |
__PHONELOG1( EBasic, EPhoneControl, |
|
447 |
"TPhoneCallHeaderParam::IsFeatureSupported() - featureSupport: %d ", |
|
448 |
featureSupport ) |
|
449 |
||
450 |
return featureSupport; |
|
451 |
} |
|
452 |
||
453 |
// --------------------------------------------------------------------------- |
|
454 |
// TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader |
|
455 |
// --------------------------------------------------------------------------- |
|
456 |
// |
|
457 |
void TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( |
|
458 |
const TInt aCallId, |
|
459 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
460 |
{ |
|
461 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader( ) "); |
|
462 |
if( iSetDivertIndication ) |
|
463 |
{ |
|
464 |
aCallHeaderData->SetDiverted( ETrue ); |
|
465 |
} |
|
466 |
||
467 |
if ( iStateMachine.PhoneEngineInfo()->CallALSLine( aCallId ) == CCCECallParameters::ECCELineTypeAux ) |
|
468 |
{ |
|
469 |
__PHONELOG( EBasic, EPhoneControl, |
|
470 |
"TPhoneCallHeaderParam::SetDivertIndicatorToCallHeader - CallALSLine() == CCCECallParameters::ECCELineTypeAux"); |
|
471 |
aCallHeaderData->SetLine2( ETrue ); |
|
472 |
} |
|
473 |
} |
|
474 |
||
475 |
// --------------------------------------------------------------------------- |
|
476 |
// TPhoneCallHeaderParam::SetDivertIndication |
|
477 |
// --------------------------------------------------------------------------- |
|
478 |
// |
|
479 |
void TPhoneCallHeaderParam::SetDivertIndication( const TBool aDivertIndication ) |
|
480 |
{ |
|
481 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetDivertIndication( ) "); |
|
482 |
iSetDivertIndication = aDivertIndication; |
|
483 |
__PHONELOG1( EBasic, EPhoneControl, |
|
484 |
"TPhoneCallHeaderParam::SetDivertIndication() - iSetDivertIndication: %d ", |
|
485 |
iSetDivertIndication ) |
|
486 |
} |
|
487 |
||
488 |
// --------------------------------------------------------------------------- |
|
489 |
// TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL |
|
490 |
// --------------------------------------------------------------------------- |
|
491 |
// |
|
492 |
void TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL( |
|
493 |
const TInt aCallId, |
|
494 |
const TBool aWaitingCall, |
|
495 |
const TBool aVideoCall, |
|
496 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
497 |
{ |
|
498 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetIncomingCallHeaderParamsL( ) "); |
|
499 |
// Set basic params must be called before update is called. |
|
500 |
SetBasicCallHeaderParamsL( aCallId, aCallHeaderData ); |
|
501 |
||
502 |
// Set call header labels |
|
503 |
SetCallHeaderTexts( |
|
504 |
aCallId, |
|
505 |
aWaitingCall, |
|
506 |
aVideoCall, |
|
507 |
aCallHeaderData ); |
|
508 |
||
509 |
SetCliAndCnapParamatersL( aCallId, aCallHeaderData ); |
|
510 |
||
511 |
// Set divert indication to call header if needed. |
|
512 |
SetDivertIndicatorToCallHeader( aCallId, aCallHeaderData ); |
|
513 |
} |
|
514 |
||
515 |
// --------------------------------------------------------------------------- |
|
516 |
// TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL |
|
517 |
// --------------------------------------------------------------------------- |
|
518 |
// |
|
519 |
void TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL( |
|
520 |
const TInt aCallId, |
|
521 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
522 |
{ |
|
523 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::SetOutgoingCallHeaderParamsL( ) "); |
|
524 |
// Set basic params must be called before update is called. |
|
525 |
SetBasicCallHeaderParamsL( aCallId, aCallHeaderData ); |
|
526 |
||
527 |
// Set call header labels |
|
528 |
if ( aCallHeaderData->CallType() == EPECallTypeVideo ) |
|
529 |
{ |
|
530 |
iManagerUtility.LoadCallHeaderTexts( |
|
531 |
EPhoneOutgoingVideoCallLabel, |
|
532 |
EPhoneOutgoingVideoCallLabelShort, |
|
533 |
aCallHeaderData ); |
|
534 |
} |
|
535 |
else |
|
536 |
{ |
|
537 |
iManagerUtility.LoadCallHeaderTexts( |
|
538 |
EPhoneOutgoingCallLabel, |
|
539 |
EPhoneOutgoingCallLabelShort, |
|
540 |
aCallHeaderData ); |
|
541 |
} |
|
542 |
||
543 |
SetCliParamatersL( aCallId, aCallHeaderData ); |
|
544 |
} |
|
545 |
||
546 |
// --------------------------------------------------------------------------- |
|
547 |
// TPhoneCallHeaderParam::UpdateCallHeaderInfoL |
|
548 |
// --------------------------------------------------------------------------- |
|
549 |
// |
|
550 |
void TPhoneCallHeaderParam::UpdateCallHeaderInfoL( |
|
551 |
const TInt aCallId, |
|
552 |
const TBool aWaitingCall, |
|
553 |
const TBool aVideoCall, |
|
554 |
TPhoneCmdParamCallHeaderData* aCallHeaderData ) |
|
555 |
{ |
|
556 |
__LOGMETHODSTARTEND(EPhoneControl, "TPhoneCallHeaderParam::UpdateCallHeaderInfoL( ) "); |
|
557 |
__ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
|
558 |
TBuf<KCntMaxTextFieldLength> remoteInfoText( KNullDesC ); |
|
559 |
||
560 |
// Set call header type |
|
561 |
GetCallType( aCallId, aCallHeaderData ); |
|
562 |
||
563 |
// Set CLI text for the call header |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
564 |
TBool secondaryCli = GetRemoteInfoDataL( aCallId, remoteInfoText ); |
37 | 565 |
if ( remoteInfoText != KNullDesC ) |
566 |
{ |
|
567 |
aCallHeaderData->SetCLIText( remoteInfoText, TPhoneCmdParamCallHeaderData::ERight ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
568 |
if ( secondaryCli ) |
37 | 569 |
{ |
570 |
aCallHeaderData->SetCNAPText( iStateMachine.PhoneEngineInfo()-> |
|
571 |
RemotePhoneNumber( aCallId ), TPhoneCmdParamCallHeaderData::ELeft ); |
|
572 |
} |
|
573 |
} |
|
574 |
else |
|
575 |
{ |
|
576 |
aCallHeaderData->SetCLIText( |
|
577 |
iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ), |
|
578 |
TPhoneCmdParamCallHeaderData::ERight ); |
|
579 |
} |
|
580 |
||
581 |
// If KTelephonyLVFlagUUS is enabled it will over write RemotePartyName setting. |
|
582 |
// Contains possible CNAP name or received skype identification |
|
583 |
if ( IsFeatureSupported( KTelephonyLVFlagUUS, aCallId ) ) |
|
584 |
{ |
|
585 |
TBuf<KCntMaxTextFieldLength> remotePartyName( KNullDesC ); |
|
586 |
remotePartyName.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) ); |
|
587 |
||
588 |
if ( iStateMachine.PhoneEngineInfo()->CallState( aCallId ) == EPEStateRinging ) |
|
589 |
{ |
|
590 |
// Set CNAP text |
|
591 |
aCallHeaderData->SetCNAPText( remotePartyName, TPhoneCmdParamCallHeaderData::ERight ); |
|
592 |
} |
|
593 |
else |
|
594 |
{ |
|
595 |
aCallHeaderData->SetCLIText( remotePartyName, TPhoneCmdParamCallHeaderData::ERight ); |
|
596 |
} |
|
597 |
} |
|
598 |
||
599 |
// Set call header labels |
|
600 |
SetCallHeaderTexts( |
|
601 |
aCallId, |
|
602 |
aWaitingCall, |
|
603 |
aVideoCall, |
|
604 |
aCallHeaderData ); |
|
605 |
||
606 |
// Update caller image |
|
607 |
SetCallerImage( |
|
608 |
aCallId, |
|
609 |
aCallHeaderData ); |
|
610 |
} |
|
611 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
612 |
|
37 | 613 |
|
614 |
// --------------------------------------------------------------------------- |
|
615 |
// TPhoneCallHeaderParam::GetRemoteInfoDataL |
|
616 |
// --------------------------------------------------------------------------- |
|
617 |
// |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
618 |
TBool TPhoneCallHeaderParam::GetRemoteInfoDataL( |
37 | 619 |
const TInt aCallId, |
620 |
TDes& aData ) const |
|
621 |
{ |
|
622 |
__LOGMETHODSTARTEND( EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() "); |
|
623 |
__PHONELOG1( EBasic, EPhoneControl, "TPhoneCallHeaderParam::GetRemoteInfoDataL() - call id =%d ", aCallId); |
|
624 |
__ASSERT_DEBUG( iStateMachine.PhoneEngineInfo(), Panic( EPhoneCtrlInvariant ) ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
625 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
626 |
TBool secondaryCli(EFalse); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
627 |
|
37 | 628 |
if ( aCallId == KEmergencyCallId ) |
629 |
{ |
|
630 |
// Set emergency label text |
|
631 |
iManagerUtility.LoadResource( aData, EPhoneEmergencyCallHeader ); |
|
632 |
} |
|
633 |
else |
|
634 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
635 |
const RMobileCall::TMobileCallRemoteIdentityStatus identity = iStateMachine.PhoneEngineInfo()->RemoteIdentity( aCallId ); |
37 | 636 |
// Note next if-statements are in priority order so be careful if you change order |
637 |
// or add new if-statements. |
|
638 |
if ( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ).Length() ) |
|
639 |
{ |
|
640 |
// Display the contact name if it is available |
|
641 |
aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteName( aCallId ) ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
642 |
secondaryCli = ETrue; |
37 | 643 |
} |
644 |
else if ( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ).Length() ) |
|
645 |
{ |
|
646 |
// Display the CNAP or UUS info if it is available. |
|
647 |
aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePartyName( aCallId ) ); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
648 |
secondaryCli = ETrue; |
37 | 649 |
} |
650 |
else if ( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ).Length() ) |
|
651 |
{ |
|
652 |
// Display the company name if it is available |
|
653 |
aData.Copy( iStateMachine.PhoneEngineInfo()->RemoteCompanyName( aCallId ) ); |
|
654 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
655 |
else if ( iStateMachine.PhoneEngineInfo()->CallDirection( aCallId ) == RMobileCall::EMobileTerminated ) |
37 | 656 |
{ |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
657 |
if ( EPEPrivateNumber == iStateMachine.PhoneEngineInfo()->RemotePhoneNumberType( aCallId ) ) |
37 | 658 |
{ |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
659 |
if ( EPECallTypeVoIP == CallHeaderType() ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
660 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
661 |
iManagerUtility.LoadResource( aData, iManagerUtility.Customization()->CustomizeCallHeaderText() ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
662 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
663 |
else |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
664 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
665 |
// private number |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
666 |
iManagerUtility.LoadResource( aData, EPhoneCLIWithheld ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
667 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
668 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
669 |
else if ( identity == RMobileCall::ERemoteIdentityUnavailableNoCliCoinOrPayphone || |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
670 |
identity == RMobileCall::ERemoteIdentityAvailableNoCliCoinOrPayphone ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
671 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
672 |
__PHONELOG( EBasic, EPhoneControl, "GetRemoteInfoDataL br2.5: payphone" ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
673 |
// Display "Payphone". |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
674 |
iManagerUtility.LoadResource( aData, EPhoneCLIPayphone ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
675 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
676 |
else if ( identity == RMobileCall::ERemoteIdentityUnknown ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
677 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
678 |
__PHONELOG( EBasic, EPhoneControl, "GetRemoteInfoDataL br2.6: unknown number" ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
679 |
// Display "Unknown Number". |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
680 |
iManagerUtility.LoadResource( aData, EPhoneCallCLIUnknown ); |
37 | 681 |
} |
682 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
683 |
else if ( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ).Length() ) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
684 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
685 |
// Display the number if it is available |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
686 |
aData.Copy( iStateMachine.PhoneEngineInfo()->RemotePhoneNumber( aCallId ) ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
687 |
} |
37 | 688 |
} |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
689 |
return secondaryCli; |
37 | 690 |
} |
691 |