author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 23 Jun 2010 18:12:20 +0300 | |
changeset 45 | 6b911d05207e |
parent 37 | ba76fc04e6c2 |
child 46 | bc5a64e5bc3c |
permissions | -rw-r--r-- |
37 | 1 |
/*! |
2 |
* Copyright (c) 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: Phone UI's symbian adapter for Qt view. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#include "phoneuiqtviewadapter.h" |
|
19 |
#include "phoneuiqtviewif.h" |
|
20 |
#include "phonebubblewrapper.h" |
|
21 |
#include "tphonecmdparaminteger.h" |
|
22 |
#include "tphonecmdparamboolean.h" |
|
23 |
#include "tphonecmdparamaudioavailability.h" |
|
24 |
#include "tphonecmdparamaudiooutput.h" |
|
25 |
#include "tphonecmdparamcallstatedata.h" |
|
26 |
#include "tphonecmdparamcallheaderdata.h" |
|
27 |
#include "tphonecmdparamemergencycallheaderdata.h" |
|
28 |
#include "tphonecmdparamstring.h" |
|
29 |
#include "cphonepubsubproxy.h" |
|
30 |
#include "pevirtualengine.h" |
|
31 |
#include "cphoneringingtonecontroller.h" |
|
32 |
#include "phoneresourceadapter.h" |
|
33 |
#include "phoneui.hrh" |
|
34 |
#include "cphonemediatorfactory.h" |
|
35 |
#include "phoneuiqtbuttonscontroller.h" |
|
36 |
#include "phoneconstants.h" |
|
37 |
#include "phonenotecontroller.h" |
|
38 |
#include "telephonyservice.h" |
|
39 |
#include "phoneuicommandcontroller.h" |
|
40 |
#include "phonemessagecontroller.h" |
|
41 |
#include "phoneindicatorcontroller.h" |
|
42 |
#include "qtphonelog.h" |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
43 |
#include "phonevisibilityhandler.h" |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
44 |
|
37 | 45 |
#include <UikonInternalPSKeys.h> |
46 |
#include <bubblemanagerif.h> |
|
47 |
#include <hbaction.h> |
|
48 |
#include <pevirtualengine.h> |
|
49 |
#include <xqservicerequest.h> |
|
50 |
#include <QtGlobal> |
|
51 |
#include <xqserviceutil.h> |
|
52 |
#include <hbinstance.h> |
|
53 |
#include <QKeyEvent> |
|
54 |
#include <hbextendedlocale.h> |
|
55 |
#include <hbi18ndef.h> |
|
56 |
#include <eikenv.h> |
|
57 |
#include <w32std.h> |
|
58 |
#include <hbstringutil.h> |
|
59 |
#include <AknSgcc.h> |
|
60 |
#include <AknCapServerClient.h> |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
61 |
#include <logsservices.h> |
37 | 62 |
|
63 |
||
64 |
//CONSTANTS |
|
65 |
static const int PHONE_CALL_NOT_FOUND = -1; |
|
66 |
||
67 |
PhoneUIQtViewAdapter::PhoneUIQtViewAdapter (PhoneUIQtViewIF &view, QObject *parent) : |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
68 |
QObject (parent), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
69 |
m_view (view), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
70 |
m_idleUid(-1), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
71 |
m_bubbleWrapper(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
72 |
m_ringingtonecontroller(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
73 |
m_resourceAdapter(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
74 |
m_noteController(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
75 |
m_telephonyService(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
76 |
m_uiCommandController(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
77 |
m_messageController(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
78 |
m_indicatorController(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
79 |
m_dialpadAboutToClose(false), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
80 |
m_homeScreenToForeground(false), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
81 |
m_visibilityHandler(0), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
82 |
m_clearDialpadOnClose(true) |
37 | 83 |
{ |
84 |
m_bubbleWrapper = new PhoneBubbleWrapper(m_view.bubbleManager (), this); |
|
85 |
m_noteController = new PhoneNoteController(this); |
|
86 |
m_uiCommandController = new PhoneUiCommandController(view, this); |
|
87 |
m_messageController = new PhoneMessageController(this); |
|
88 |
||
89 |
TRAPD( error, m_ringingtonecontroller = CPhoneRingingToneController::NewL () ); |
|
90 |
qt_symbian_throwIfError(error); |
|
91 |
m_resourceAdapter = PhoneResourceAdapter::Instance(this); |
|
92 |
||
93 |
// display initial toolbar to make client area size correct |
|
94 |
TPhoneCmdParamInteger intParam; |
|
95 |
intParam.SetInteger(m_resourceAdapter->defaultToolbarResourceId()); |
|
96 |
setToolbarButtons(&intParam); |
|
97 |
||
98 |
m_telephonyService = new TelephonyService (this, this); |
|
99 |
m_indicatorController = new PhoneIndicatorController(this); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
100 |
m_visibilityHandler = new PhoneVisibilityHandler(view, this); |
37 | 101 |
} |
102 |
||
103 |
PhoneUIQtViewAdapter::~PhoneUIQtViewAdapter () |
|
104 |
{ |
|
105 |
delete m_ringingtonecontroller; |
|
106 |
} |
|
107 |
||
108 |
void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId) |
|
109 |
{ |
|
110 |
switch (aCmdId) { |
|
111 |
case EPhoneAppShutDown: |
|
112 |
{ |
|
113 |
m_view.shutdownPhoneApp(); |
|
114 |
} |
|
115 |
break; |
|
116 |
||
117 |
case EPhoneViewSetIdleTopApplication: |
|
118 |
{ |
|
119 |
TPhoneCmdParamInteger uidParam; |
|
120 |
uidParam.SetInteger (idleAppUid()); |
|
121 |
setTopApplication (&uidParam); |
|
122 |
} |
|
123 |
break; |
|
124 |
||
125 |
case EPhoneViewMuteRingToneOnAnswer: |
|
126 |
m_ringingtonecontroller->MuteRingingToneOnAnswer(); |
|
127 |
break; |
|
128 |
||
129 |
case EPhoneViewStopRingTone: |
|
130 |
m_ringingtonecontroller->StopPlaying(); |
|
131 |
break; |
|
132 |
||
133 |
case EPhoneViewMuteRingTone: |
|
134 |
m_ringingtonecontroller->MuteRingingTone(); |
|
135 |
break; |
|
136 |
||
137 |
case EPhoneViewHideNaviPaneAudioVolume: |
|
138 |
m_view.removeVolumeSlider (); |
|
139 |
break; |
|
140 |
||
141 |
case EPhoneViewOpenDialer: |
|
142 |
openDialpad(); |
|
143 |
break; |
|
144 |
||
145 |
case EPhoneViewRemoveConferenceBubble: |
|
146 |
removeConferenceBubble(); |
|
147 |
break; |
|
148 |
||
149 |
case EPhoneViewSendToBackground: |
|
150 |
case EPhoneViewBringIdleToForeground: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
151 |
m_visibilityHandler->sendToBackground(m_homeScreenToForeground); |
37 | 152 |
m_homeScreenToForeground = false; |
153 |
break; |
|
154 |
case EPhoneViewRemoveAllCallHeaders: |
|
155 |
removeAllCallHeaders(); |
|
156 |
break; |
|
157 |
case EPhoneViewRemoveNumberEntry: |
|
158 |
case EPhoneViewClearNumberEntryContent: // Fall through |
|
159 |
removeDialpad(); |
|
160 |
break; |
|
161 |
case EPhoneViewAddToConference: |
|
162 |
addToConference(); |
|
163 |
break; |
|
164 |
case EPhoneViewRemoveDtmfNote: |
|
165 |
m_noteController->removeDtmfNote(); |
|
166 |
break; |
|
167 |
case EPhoneViewRemoveNote: |
|
168 |
m_noteController->removeNote(); |
|
169 |
break; |
|
170 |
case EPhoneViewRemoveQuery: |
|
171 |
m_noteController->removeQuery(); |
|
172 |
break; |
|
173 |
case EPhoneViewRemovePhoneDialogs: |
|
174 |
m_noteController->removeNote(); |
|
175 |
m_noteController->removeQuery(); |
|
176 |
break; |
|
177 |
case EPhoneViewRemoveGlobalNote: |
|
178 |
case EPhoneViewRemoveGlobalWaitNote: |
|
179 |
m_noteController->removeGlobalWaitNote(); |
|
180 |
break; |
|
181 |
case EPhoneViewUpdateFSW: |
|
182 |
setHidden(true); |
|
183 |
break; |
|
184 |
default: |
|
185 |
break; |
|
186 |
} |
|
187 |
CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId ); |
|
188 |
} |
|
189 |
||
190 |
void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId) |
|
191 |
{ |
|
192 |
switch (aCmdId) { |
|
193 |
case EPhoneViewRemoveCallHeader: |
|
194 |
{ |
|
195 |
m_bubbleWrapper->bubbleManager().startChanges(); |
|
196 |
int bubble = m_bubbleWrapper->bubbles().value(aCallId); |
|
197 |
m_view.clearBubbleCommands(bubble); |
|
198 |
m_view.removeExpandAction(bubble); |
|
199 |
m_bubbleWrapper->removeCallHeader (aCallId); |
|
200 |
m_bubbleWrapper->bubbleManager().endChanges(); |
|
201 |
m_indicatorController->clearActiveCallData(); |
|
202 |
} |
|
203 |
break; |
|
204 |
case EPhoneViewRemoveFromConference: |
|
205 |
removeCallFromConference(aCallId); |
|
206 |
break; |
|
207 |
case EPhoneViewPrivateFromConference: |
|
208 |
setPrivateFromConference(aCallId); |
|
209 |
break; |
|
210 |
default: |
|
211 |
break; |
|
212 |
} |
|
213 |
CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId ); |
|
214 |
} |
|
215 |
||
216 |
void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TPhoneCommandParam* aCommandParam) |
|
217 |
{ |
|
218 |
switch (aCmdId) { |
|
219 |
case EPhoneViewSetTopApplication: |
|
220 |
setTopApplication (aCommandParam); |
|
221 |
break; |
|
222 |
case EPhoneViewPlayRingTone: |
|
223 |
m_ringingtonecontroller->PlayRingToneL( aCommandParam ); |
|
224 |
break; |
|
225 |
case EPhoneViewSetTouchPaneButtons: |
|
226 |
setTouchButtons (aCommandParam); |
|
227 |
setExpandActions(); |
|
228 |
break; |
|
229 |
case EPhoneViewUpdateCba: |
|
230 |
setToolbarButtons (aCommandParam); |
|
231 |
break; |
|
232 |
case EPhoneViewSetHoldFlag: |
|
233 |
setCallHoldFlag (aCommandParam); |
|
234 |
break; |
|
235 |
case EPhoneViewGetHoldFlag: |
|
236 |
callHoldFlag (aCommandParam); |
|
237 |
break; |
|
238 |
case EPhoneViewSetNaviPaneAudioVolume: |
|
239 |
setAudioVolumeSliderValue (aCommandParam); |
|
240 |
break; |
|
241 |
case EPhoneViewActivateMuteUIChanges: |
|
242 |
setMuteIndication(aCommandParam); |
|
243 |
break; |
|
244 |
case EPhoneViewGetCountOfActiveCalls: |
|
245 |
activeCallCount(aCommandParam); |
|
246 |
break; |
|
247 |
case EPhoneViewActivateAudioPathUIChanges: |
|
248 |
setAudioPath(aCommandParam); |
|
249 |
break; |
|
250 |
case EPhoneViewGetExpandedBubbleCallId: |
|
251 |
expandedBubbleCallId(aCommandParam); |
|
252 |
break; |
|
253 |
case EPhoneViewGetIsConference: |
|
254 |
isConference(aCommandParam); |
|
255 |
break; |
|
256 |
case EPhoneViewBringAppToForeground: |
|
257 |
bringToForeground(); |
|
258 |
break; |
|
259 |
case EPhoneViewShowGlobalNote: |
|
260 |
showGlobalNote(aCommandParam); |
|
261 |
break; |
|
262 |
case EPhoneViewSetNumberEntryVisible: |
|
263 |
setDialpadVisibility(aCommandParam); |
|
264 |
break; |
|
265 |
case EPhoneViewGetNumberEntryCount: |
|
266 |
getDialpadStringLength(aCommandParam); |
|
267 |
break; |
|
268 |
case EPhoneViewGetNumberFromEntry: |
|
269 |
getNumberFromDialpad(aCommandParam); |
|
270 |
break; |
|
271 |
case EPhoneViewShowNote: |
|
272 |
showNote(aCommandParam); |
|
273 |
break; |
|
274 |
case EPhoneViewShowQuery: |
|
275 |
m_noteController->showQuery(aCommandParam); |
|
276 |
break; |
|
277 |
case EPhoneViewOpenSoftRejectEditor: |
|
278 |
m_messageController->openSoftRejectMessageEditor(aCommandParam); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
279 |
m_visibilityHandler->hideDeviceDialogs(false); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
280 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
281 |
case EPhoneViewSetGlobalNotifiersDisabled: |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
282 |
hideDeviceDialogs(aCommandParam); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
283 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
284 |
case EPhoneViewLaunchLogs: |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
285 |
openLogs(aCommandParam); |
37 | 286 |
break; |
287 |
default: |
|
288 |
break; |
|
289 |
} |
|
290 |
CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, *aCommandParam ); |
|
291 |
} |
|
292 |
||
293 |
void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId, |
|
294 |
TPhoneCommandParam *aCommandParam) |
|
295 |
{ |
|
296 |
switch (aCmdId) { |
|
297 |
case EPhoneViewCreateCallHeader: |
|
298 |
createCallHeader (aCallId, aCommandParam); |
|
299 |
break; |
|
300 |
case EPhoneViewCreateEmergencyCallHeader: |
|
301 |
createEmergencyCallHeader (aCallId, aCommandParam); |
|
302 |
break; |
|
303 |
case EPhoneViewUpdateBubble: |
|
304 |
updateCallHeaderState (aCallId, aCommandParam); |
|
305 |
setExpandActions(); |
|
306 |
break; |
|
307 |
case EPhoneViewUpdateCallHeaderRemoteInfoData: |
|
308 |
updateCallHeaderRemoteInfo (aCallId, aCommandParam); |
|
309 |
break; |
|
310 |
case EPhoneViewUpdateCallHeaderRemoteInfoDataAndLabel: |
|
311 |
updateCallHeaderRemoteInfoAndLabel(aCallId, aCommandParam); |
|
312 |
break; |
|
313 |
case EPhoneViewCreateConference: |
|
314 |
createConferenceBubble(aCallId, aCommandParam); |
|
315 |
break; |
|
316 |
case EPhoneViewGetCallExistsInConference: |
|
317 |
conferenceCallId(aCallId, aCommandParam); |
|
318 |
break; |
|
319 |
case EPhoneViewUpdateCallHeaderCallDuration: |
|
320 |
{ |
|
321 |
TPhoneCmdParamInteger *time = static_cast<TPhoneCmdParamInteger *>(aCommandParam); |
|
322 |
QString duration = convertDuration(time->Integer()); |
|
323 |
PHONE_DEBUG2("call duration:", duration); |
|
324 |
int bubbleId = m_bubbleWrapper->bubbleId(aCallId); |
|
325 |
||
326 |
if (-1 != bubbleId) { |
|
327 |
m_bubbleWrapper->bubbleManager().updateCallTime(bubbleId, duration); |
|
328 |
} |
|
329 |
break; |
|
330 |
} |
|
331 |
||
332 |
case EPhoneViewCipheringInfoChange: |
|
333 |
{ |
|
334 |
handleCipheringInfoChange(aCallId, aCommandParam); |
|
335 |
break; |
|
336 |
} |
|
337 |
||
338 |
default: |
|
339 |
break; |
|
340 |
} |
|
341 |
CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId, *aCommandParam ); |
|
342 |
} |
|
343 |
||
344 |
void PhoneUIQtViewAdapter::ExecuteCommandL (TPhoneViewCommandId aCmdId, TInt aCallId, |
|
345 |
TDesC &aMessage) |
|
346 |
{ |
|
347 |
switch (aCmdId) { |
|
348 |
||
349 |
default: |
|
350 |
break; |
|
351 |
} |
|
352 |
CPhoneMediatorFactory::Instance()->Sender()->SendEvent( aCmdId, aCallId, &aMessage ); |
|
353 |
} |
|
354 |
||
355 |
TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId) |
|
356 |
{ |
|
357 |
TPhoneViewResponseId response = EPhoneViewResponseSuccess; |
|
358 |
||
359 |
switch (aCmdId) { |
|
360 |
case EPhoneIsDTMFDialerVisible: |
|
361 |
case EPhoneViewIsDTMFEditorVisible: //TODO |
|
362 |
case EPhoneIsCustomizedDialerVisible: |
|
363 |
case EPhoneViewGetNeedToSendToBackgroundStatus: |
|
364 |
// TODO: currently not supported |
|
365 |
response = EPhoneViewResponseFailed; |
|
366 |
break; |
|
367 |
case EPhoneViewIsMenuBarVisible: |
|
368 |
{ |
|
369 |
//TODO |
|
370 |
response = EPhoneViewResponseFailed; |
|
371 |
break; |
|
372 |
} |
|
373 |
case EPhoneViewGetNumberEntryIsVisibleStatus: |
|
374 |
case EPhoneViewGetNumberEntryIsUsedStatus: // Fall through |
|
375 |
{ |
|
376 |
response = (m_view.isDialpadVisible() && !m_dialpadAboutToClose) ? |
|
377 |
EPhoneViewResponseSuccess : |
|
378 |
EPhoneViewResponseFailed; |
|
379 |
break; |
|
380 |
} |
|
381 |
default: |
|
382 |
break; |
|
383 |
} |
|
384 |
||
385 |
return response; |
|
386 |
} |
|
387 |
||
388 |
TPhoneViewResponseId PhoneUIQtViewAdapter::HandleCommandL (TPhoneViewCommandId aCmdId, |
|
389 |
TPhoneCommandParam *aCommandParam) |
|
390 |
{ |
|
391 |
TPhoneViewResponseId viewResponse = EPhoneViewResponseSuccess; |
|
392 |
||
393 |
switch (aCmdId) { |
|
394 |
case EPhoneViewGetCallIdByState: |
|
395 |
viewResponse = callIdByState (aCommandParam); |
|
396 |
break; |
|
397 |
case EPhoneViewSelectedConfMember: |
|
398 |
viewResponse = getSelectedConferenceMember (aCommandParam); |
|
399 |
break; |
|
400 |
default: |
|
401 |
break; |
|
402 |
} |
|
403 |
||
404 |
return viewResponse; |
|
405 |
} |
|
406 |
||
407 |
void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId) |
|
408 |
{ |
|
409 |
switch (aCmdId) { |
|
410 |
case EPhoneSetConferenceExpanded: |
|
411 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
412 |
m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader( |
|
413 |
m_bubbleWrapper->conferenceCallList().size()); |
|
414 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
415 |
break; |
|
416 |
case EPhoneViewBeginUpdate: |
|
417 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
418 |
break; |
|
419 |
case EPhoneViewEndUpdate: |
|
420 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
421 |
break; |
|
422 |
case EPhoneViewOpenContacts: |
|
423 |
openContacts(); |
|
424 |
break; |
|
425 |
default: |
|
426 |
break; |
|
427 |
} |
|
428 |
} |
|
429 |
||
430 |
void PhoneUIQtViewAdapter::ExecuteCommand (TPhoneViewCommandId aCmdId, TPhoneCommandParam *aCommandParam) |
|
431 |
{ |
|
432 |
switch (aCmdId) { |
|
433 |
case EPhoneViewGetAudioVolumeLevel: |
|
434 |
writeAudioVolumeLevel (aCommandParam); |
|
435 |
break; |
|
436 |
case EPhoneViewGetNumberFromEntry: |
|
437 |
getNumberFromDialpad(aCommandParam); |
|
438 |
break; |
|
439 |
case EPhoneViewSetDtmfOptionsFlag: |
|
440 |
//TODO |
|
441 |
break; |
|
442 |
case EPhoneViewSetVideoCallDTMFVisibilityFlag: |
|
443 |
//TODO |
|
444 |
break; |
|
445 |
case EPhoneViewBackButtonActive: { |
|
446 |
TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam); |
|
447 |
m_view.setBackButtonVisible(param->Boolean()); |
|
448 |
} |
|
449 |
break; |
|
450 |
case EPhoneViewHsToForegroundAfterCall: { |
|
451 |
TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam); |
|
452 |
m_homeScreenToForeground = param->Boolean(); |
|
453 |
} |
|
454 |
break; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
455 |
case EPhoneViewSetIhfFlag: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
456 |
TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
457 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
458 |
PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
459 |
setButtonFlags(PhoneUIQtButtonsController::Ihf, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
460 |
param->Boolean()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
461 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
462 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
463 |
case EPhoneViewSetMuteFlag: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
464 |
TPhoneCmdParamBoolean *param = static_cast<TPhoneCmdParamBoolean *>(aCommandParam); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
465 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
466 |
PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
467 |
setButtonFlags(PhoneUIQtButtonsController::Mute, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
468 |
param->Boolean()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
469 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
470 |
break; |
37 | 471 |
default: |
472 |
break; |
|
473 |
} |
|
474 |
} |
|
475 |
||
476 |
const TDesC& PhoneUIQtViewAdapter::FetchContent () |
|
477 |
{ |
|
478 |
return KNullDesC; |
|
479 |
} |
|
480 |
||
481 |
void PhoneUIQtViewAdapter::dialpadClosed() |
|
482 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
483 |
if (m_clearDialpadOnClose) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
484 |
m_view.clearDialpad(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
485 |
} |
37 | 486 |
m_dialpadAboutToClose = true; |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
487 |
m_clearDialpadOnClose = true; |
37 | 488 |
setCallMenu(); |
489 |
} |
|
490 |
||
491 |
PhoneNoteController* PhoneUIQtViewAdapter::noteController() const |
|
492 |
{ |
|
493 |
return m_noteController; |
|
494 |
} |
|
495 |
||
496 |
void PhoneUIQtViewAdapter::keyReleased(QKeyEvent */*event*/) |
|
497 |
{ |
|
498 |
if (m_view.isDialpadVisible() && |
|
499 |
false == m_dialpadAboutToClose ) { |
|
500 |
setDialpadMenu(); |
|
501 |
} |
|
502 |
} |
|
503 |
||
504 |
void PhoneUIQtViewAdapter::handleWindowActivated() |
|
505 |
{ |
|
506 |
m_indicatorController->disableActiveCallIndicator(); |
|
507 |
} |
|
508 |
||
509 |
void PhoneUIQtViewAdapter::handleWindowDeactivated() |
|
510 |
{ |
|
511 |
m_indicatorController->enableActiveCallIndicator(); |
|
512 |
} |
|
513 |
||
514 |
void PhoneUIQtViewAdapter::setTopApplication (TPhoneCommandParam *commandParam) |
|
515 |
{ |
|
516 |
TPhoneCmdParamInteger *integerParam = static_cast<TPhoneCmdParamInteger *> (commandParam); |
|
517 |
CPhonePubSubProxy::Instance()->ChangePropertyValue( |
|
518 |
KPSUidUikon, |
|
519 |
KUikVideoCallTopApp, |
|
520 |
integerParam->Integer() ); |
|
521 |
||
522 |
// Hide the Phone icon if it is not the top application |
|
523 |
// TODO: how to do this? |
|
524 |
} |
|
525 |
||
526 |
int PhoneUIQtViewAdapter::idleAppUid () |
|
527 |
{ |
|
528 |
// <-- QT HS START --> |
|
529 |
/* if ( m_idleUid == -1 ) { |
|
530 |
// Get Idle's UID from PubSub. |
|
531 |
m_idleUid = CPhonePubSubProxy::Instance()->Value (KPSUidAiInformation, |
|
532 |
KActiveIdleUid ); |
|
533 |
}*/ |
|
534 |
m_idleUid=0x20022F35; |
|
535 |
// <-- QT HS END --> |
|
536 |
return m_idleUid; |
|
537 |
} |
|
538 |
||
539 |
void PhoneUIQtViewAdapter::createCallHeader( |
|
540 |
int callId, |
|
541 |
TPhoneCommandParam *commandParam ) |
|
542 |
{ |
|
543 |
PHONE_DEBUG("PhoneUIQtViewAdapter::createCallHeader"); |
|
544 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData); |
|
545 |
||
546 |
TPhoneCmdParamCallHeaderData &data = |
|
547 |
static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam); |
|
548 |
||
549 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
550 |
||
551 |
if (m_bubbleWrapper->bubbleManager().isConferenceExpanded()) |
|
552 |
{ |
|
553 |
m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(false); |
|
554 |
} |
|
555 |
||
556 |
int bubble = m_bubbleWrapper->createCallHeader (callId); |
|
557 |
m_bubbleWrapper->setState (callId, bubble, data.CallState ()); |
|
558 |
m_bubbleWrapper->setCli (bubble, data.CLIText ()); |
|
559 |
m_bubbleWrapper->setServiceId(callId, data.ServiceId()); |
|
560 |
m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ()); |
|
561 |
m_bubbleWrapper->setLabel (bubble, data.LabelText ()); |
|
562 |
m_bubbleWrapper->setCallType (bubble, data.CallType ()); |
|
563 |
m_bubbleWrapper->setDivert (bubble, data.Diverted ()); |
|
564 |
m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering()); |
|
565 |
||
566 |
if (data.Picture().Length()) { |
|
567 |
QString imagePath = |
|
568 |
QString::fromUtf16(data.Picture().Ptr(),data.Picture().Length()); |
|
569 |
m_bubbleWrapper->bubbleManager().setCallObjectImage(bubble,imagePath); |
|
570 |
} else { |
|
571 |
m_bubbleWrapper->bubbleManager().setCallObjectFromTheme(bubble); |
|
572 |
} |
|
573 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
574 |
||
575 |
if (1 == m_bubbleWrapper->bubbles().keys().count()) { |
|
576 |
setHidden(false); |
|
577 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
578 |
m_indicatorController->setActiveCallData(); |
37 | 579 |
} |
580 |
||
581 |
void PhoneUIQtViewAdapter::createEmergencyCallHeader( |
|
582 |
int callId, |
|
583 |
TPhoneCommandParam *commandParam) |
|
584 |
{ |
|
585 |
PHONE_DEBUG("PhoneUIQtViewAdapter::createEmergencyCallHeader"); |
|
586 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdEmergencyCallHeaderData); |
|
587 |
||
588 |
TPhoneCmdParamEmergencyCallHeaderData &data = |
|
589 |
static_cast<TPhoneCmdParamEmergencyCallHeaderData &> (*commandParam); |
|
590 |
||
591 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
592 |
int bubble = m_bubbleWrapper->createCallHeader (callId); |
|
593 |
m_bubbleWrapper->setLabel (bubble, data.LabelText ()); |
|
594 |
m_bubbleWrapper->setCli (bubble, data.HeaderText ()); |
|
595 |
m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering()); |
|
596 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
597 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
598 |
m_indicatorController->setActiveCallData(); |
37 | 599 |
} |
600 |
||
601 |
void PhoneUIQtViewAdapter::updateCallHeaderState ( |
|
602 |
int callId, |
|
603 |
TPhoneCommandParam *commandParam) |
|
604 |
{ |
|
605 |
PHONE_DEBUG("PhoneUIQtViewAdapter::updateCallHeaderState"); |
|
606 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData); |
|
607 |
||
608 |
TPhoneCmdParamCallHeaderData &data = |
|
609 |
static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam); |
|
610 |
||
611 |
int bubble = m_bubbleWrapper->bubbleId (callId); |
|
612 |
if ( -1 != bubble ) { |
|
613 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
614 |
m_bubbleWrapper->setState (callId, bubble, data.CallState ()); |
|
615 |
m_bubbleWrapper->setLabel (bubble, data.LabelText ()); |
|
616 |
m_bubbleWrapper->setDivert (bubble, data.Diverted ()); |
|
617 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
618 |
} |
|
619 |
} |
|
620 |
||
621 |
void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo (int callId, TPhoneCommandParam *commandParam) |
|
622 |
{ |
|
623 |
PHONE_DEBUG("PhoneUIQtViewAdapter::updateCallHeaderRemoteInfo"); |
|
624 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData); |
|
625 |
||
626 |
TPhoneCmdParamCallHeaderData &data = |
|
627 |
static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam); |
|
628 |
||
629 |
||
630 |
int bubble = m_bubbleWrapper->bubbleId (callId); |
|
631 |
if ( -1 != bubble ) { |
|
632 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
633 |
m_bubbleWrapper->setCli (bubble, data.CLIText ()); |
|
634 |
m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ()); |
|
635 |
m_bubbleWrapper->setDivert (bubble, data.Diverted ()); |
|
636 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
637 |
} |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
638 |
m_indicatorController->setActiveCallData(); |
37 | 639 |
|
640 |
} |
|
641 |
||
642 |
void PhoneUIQtViewAdapter::updateCallHeaderRemoteInfoAndLabel (int callId, TPhoneCommandParam *commandParam) |
|
643 |
{ |
|
644 |
PHONE_DEBUG("PhoneUIQtViewAdapter::updateCallHeaderRemoteInfoAndLabel"); |
|
645 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData); |
|
646 |
||
647 |
TPhoneCmdParamCallHeaderData &data = |
|
648 |
static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam); |
|
649 |
||
650 |
int bubble = m_bubbleWrapper->bubbleId (callId); |
|
651 |
if ( -1 != bubble ) { |
|
652 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
653 |
m_bubbleWrapper->setCli (bubble, data.CLIText ()); |
|
654 |
m_bubbleWrapper->setSecondaryCli (bubble, data.CNAPText ()); |
|
655 |
m_bubbleWrapper->setLabel (bubble, data.LabelText ()); |
|
656 |
m_bubbleWrapper->setDivert (bubble, data.Diverted ()); |
|
657 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
658 |
} |
|
659 |
} |
|
660 |
||
661 |
void PhoneUIQtViewAdapter::handleCipheringInfoChange(int callId, TPhoneCommandParam *commandParam) |
|
662 |
{ |
|
663 |
TPhoneCmdParamCallHeaderData *param = |
|
664 |
static_cast<TPhoneCmdParamCallHeaderData*>(commandParam); |
|
665 |
||
666 |
int bubble = m_bubbleWrapper->bubbleId(callId); |
|
667 |
if ( -1 != bubble ) { |
|
668 |
m_bubbleWrapper->bubbleManager().startChanges(); |
|
669 |
m_bubbleWrapper->setCiphering(m_bubbleWrapper->bubbleId(callId), |
|
670 |
param->CipheringIndicatorAllowed(), |
|
671 |
param->Ciphering()); |
|
672 |
m_bubbleWrapper->bubbleManager().endChanges(); |
|
673 |
} |
|
674 |
} |
|
675 |
||
676 |
TPhoneViewResponseId PhoneUIQtViewAdapter::callIdByState (TPhoneCommandParam *commandParam) |
|
677 |
{ |
|
678 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallStateData); |
|
679 |
||
680 |
TPhoneCmdParamCallStateData &stateParam = |
|
681 |
static_cast<TPhoneCmdParamCallStateData &>(*commandParam); |
|
682 |
||
683 |
stateParam.SetCallId (m_bubbleWrapper->callId (stateParam.CallState ())); |
|
684 |
return EPhoneViewResponseSuccess; |
|
685 |
} |
|
686 |
||
687 |
void PhoneUIQtViewAdapter::setTouchButtons (TPhoneCommandParam *commandParam) |
|
688 |
{ |
|
689 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
|
690 |
||
691 |
TPhoneCmdParamBoolean ¶m = |
|
692 |
static_cast<TPhoneCmdParamBoolean &>(*commandParam); |
|
693 |
bool emergencyCall = param.Boolean(); |
|
694 |
||
695 |
m_bubbleWrapper->bubbleManager ().startChanges (); |
|
696 |
m_view.clearParticipantListActions(); |
|
697 |
||
698 |
QList<int> bubbles = m_bubbleWrapper->bubbles().keys(); |
|
699 |
||
700 |
m_resourceAdapter->buttonsController()->setButtonFlags( |
|
701 |
PhoneUIQtButtonsController::DisableJoin, |
|
702 |
(5 <= m_bubbleWrapper->conferenceCallList().count())); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
703 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
704 |
m_resourceAdapter->buttonsController()->setButtonFlags( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
705 |
PhoneUIQtButtonsController::FullConference, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
706 |
(5 <= m_bubbleWrapper->conferenceCallList().count())); |
37 | 707 |
|
708 |
for (int j = 0; j < bubbles.size(); ++j){ |
|
709 |
int callId = bubbles.at(j); |
|
710 |
// Clear bubble |
|
711 |
m_view.clearBubbleCommands(m_bubbleWrapper->bubbles().value(callId)); |
|
712 |
||
713 |
// Get bubble actions by call type |
|
714 |
QMap<PhoneAction::ActionType, PhoneAction *> actions = |
|
715 |
m_uiCommandController->pushButtonActionsForCall( |
|
716 |
m_bubbleWrapper->callStates().value(callId), |
|
717 |
emergencyCall, |
|
718 |
m_bubbleWrapper->callStates(), |
|
719 |
m_bubbleWrapper->serviceIds(), |
|
720 |
m_bubbleWrapper->serviceIdByCallId(callId), |
|
721 |
callId); |
|
722 |
||
723 |
QList<PhoneAction *> values = actions.values(); |
|
724 |
for (int i = 0; i < values.size (); ++i) { |
|
725 |
PhoneAction *action = values.at (i); |
|
726 |
m_view.addBubbleCommand(m_bubbleWrapper->bubbles().value(callId), |
|
727 |
*action); |
|
728 |
delete action; |
|
729 |
} |
|
730 |
} |
|
731 |
||
732 |
setParticipantListActions(); |
|
733 |
setExpandedConferenceCallHeader(); |
|
734 |
setBubbleSelectionFlag(); |
|
735 |
setMenu(); |
|
736 |
||
737 |
m_bubbleWrapper->bubbleManager ().endChanges (); |
|
738 |
} |
|
739 |
||
740 |
void PhoneUIQtViewAdapter::setToolbarButtons (TPhoneCommandParam *commandParam) |
|
741 |
{ |
|
742 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger); |
|
743 |
||
744 |
TPhoneCmdParamInteger &intParam = |
|
745 |
static_cast<TPhoneCmdParamInteger &>(*commandParam); |
|
746 |
||
747 |
m_resourceAdapter->buttonsController()->setButtonFlags( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
748 |
PhoneUIQtButtonsController::FullConference, |
37 | 749 |
(5 <= m_bubbleWrapper->conferenceCallList().count())); |
750 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
751 |
int callId(-1); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
752 |
int serviceId(-1); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
753 |
if ( 0<m_bubbleWrapper->callStates().keys().size() ) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
754 |
int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
755 |
callId = m_bubbleWrapper->callIdByBubbleId(bubbleId); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
756 |
serviceId = m_bubbleWrapper->serviceIdByCallId(callId); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
757 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
758 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
759 |
QList<PhoneAction*> actions = m_uiCommandController->toolBarActions( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
760 |
intParam.Integer(), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
761 |
m_bubbleWrapper->callStates(), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
762 |
m_bubbleWrapper->serviceIds(), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
763 |
serviceId, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
764 |
callId ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
765 |
|
37 | 766 |
if (actions.count()) { |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
767 |
m_view.setToolbarActions(actions); |
37 | 768 |
} |
769 |
||
770 |
qDeleteAll(actions); |
|
771 |
} |
|
772 |
||
773 |
void PhoneUIQtViewAdapter::setCallHoldFlag (TPhoneCommandParam *commandParam) |
|
774 |
{ |
|
775 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
|
776 |
||
777 |
TPhoneCmdParamBoolean &boolParam = |
|
778 |
static_cast<TPhoneCmdParamBoolean &>(*commandParam); |
|
779 |
||
780 |
m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Hold, |
|
781 |
boolParam.Boolean ()); |
|
782 |
} |
|
783 |
||
784 |
void PhoneUIQtViewAdapter::callHoldFlag (TPhoneCommandParam *commandParam) |
|
785 |
{ |
|
786 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
|
787 |
||
788 |
TPhoneCmdParamBoolean &boolParam = |
|
789 |
static_cast<TPhoneCmdParamBoolean &>(*commandParam); |
|
790 |
boolParam.SetBoolean (m_resourceAdapter->buttonsController()->getButtonFlags(PhoneUIQtButtonsController::Hold)); |
|
791 |
} |
|
792 |
||
793 |
void PhoneUIQtViewAdapter::writeAudioVolumeLevel (TPhoneCommandParam *commandParam) |
|
794 |
{ |
|
795 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger); |
|
796 |
||
797 |
TPhoneCmdParamInteger &intParam = |
|
798 |
static_cast<TPhoneCmdParamInteger &>(*commandParam); |
|
799 |
intParam.SetInteger (m_view.volumeSliderValue ()); |
|
800 |
} |
|
801 |
||
802 |
void PhoneUIQtViewAdapter::setAudioVolumeSliderValue (TPhoneCommandParam *commandParam) |
|
803 |
{ |
|
804 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger); |
|
805 |
||
806 |
TPhoneCmdParamInteger &intParam = |
|
807 |
static_cast<TPhoneCmdParamInteger &>(*commandParam); |
|
808 |
||
809 |
m_view.setVolumeSliderValue(intParam.Integer(), |
|
810 |
EPhoneInCallCmdSetVolumeLevel, |
|
811 |
KPhoneVolumeMaxValue, |
|
812 |
KPhoneVolumeMinValue ); |
|
813 |
} |
|
814 |
||
815 |
void PhoneUIQtViewAdapter::setMuteIndication (TPhoneCommandParam *commandParam) |
|
816 |
{ |
|
817 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
|
818 |
TPhoneCmdParamBoolean &boolParam = |
|
819 |
static_cast<TPhoneCmdParamBoolean &>(*commandParam); |
|
820 |
m_bubbleWrapper->bubbleManager().setPhoneMuted(boolParam.Boolean()); |
|
821 |
} |
|
822 |
||
823 |
void PhoneUIQtViewAdapter::activeCallCount (TPhoneCommandParam *commandParam) |
|
824 |
{ |
|
825 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger); |
|
826 |
||
827 |
TPhoneCmdParamInteger &integerParam = |
|
828 |
static_cast<TPhoneCmdParamInteger&>(*commandParam); |
|
829 |
integerParam.SetInteger (m_bubbleWrapper->activeCallCount()); |
|
830 |
} |
|
831 |
||
832 |
void PhoneUIQtViewAdapter::setAudioPath (TPhoneCommandParam *commandParam) |
|
833 |
{ |
|
834 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdAudioOutput); |
|
835 |
||
836 |
TPhoneCmdParamAudioOutput &outputParam = |
|
837 |
static_cast<TPhoneCmdParamAudioOutput &>(*commandParam); |
|
838 |
||
839 |
m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Ihf, |
|
840 |
outputParam.AudioOutput() == EPELoudspeaker); |
|
841 |
m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Wired, |
|
842 |
outputParam.AudioOutput() == EPEWiredAudioAccessory); |
|
843 |
m_resourceAdapter->buttonsController()->setButtonFlags(PhoneUIQtButtonsController::Btaa, |
|
844 |
outputParam.AudioOutput() == EPEBTAudioAccessory); |
|
845 |
} |
|
846 |
||
847 |
void PhoneUIQtViewAdapter::expandedBubbleCallId(TPhoneCommandParam *commandParam) |
|
848 |
{ |
|
849 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger); |
|
850 |
||
851 |
TPhoneCmdParamInteger &outputParam = |
|
852 |
static_cast<TPhoneCmdParamInteger &>(*commandParam); |
|
853 |
int callId = PHONE_CALL_NOT_FOUND; |
|
854 |
||
855 |
if ( 0<m_bubbleWrapper->callStates().keys().size() ) { |
|
856 |
int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble(); |
|
857 |
callId = m_bubbleWrapper->callIdByBubbleId(bubbleId); |
|
858 |
} |
|
859 |
||
860 |
outputParam.SetInteger( callId ); |
|
861 |
} |
|
862 |
||
863 |
void PhoneUIQtViewAdapter::openDialpad() |
|
864 |
{ |
|
865 |
m_dialpadAboutToClose = false; |
|
866 |
m_view.showDialpad(); |
|
867 |
setDialpadMenu(); |
|
868 |
} |
|
869 |
||
870 |
void PhoneUIQtViewAdapter::createConferenceBubble(int callId, TPhoneCommandParam *commandParam) |
|
871 |
{ |
|
872 |
PHONE_DEBUG("PhoneUIQtViewAdapter::createConferenceBubble"); |
|
873 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdCallHeaderData); |
|
874 |
||
875 |
TPhoneCmdParamCallHeaderData &data = |
|
876 |
static_cast<TPhoneCmdParamCallHeaderData &> (*commandParam); |
|
877 |
||
878 |
int bubble = m_bubbleWrapper->createConferenceBubble( |
|
879 |
callId, data.CallState(), data.LabelText(), data.CLIText()); |
|
880 |
||
881 |
m_bubbleWrapper->setServiceId(callId,data.ServiceId()); |
|
882 |
m_bubbleWrapper->setCiphering(bubble, data.CipheringIndicatorAllowed(), data.Ciphering()); |
|
883 |
} |
|
884 |
||
885 |
void PhoneUIQtViewAdapter::conferenceCallId(int callId, TPhoneCommandParam *commandParam) |
|
886 |
{ |
|
887 |
PHONE_DEBUG("PhoneUIQtViewAdapter::conferenceCallId"); |
|
888 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
|
889 |
||
890 |
TPhoneCmdParamBoolean* conferenceDataValue = |
|
891 |
static_cast<TPhoneCmdParamBoolean*>( |
|
892 |
commandParam ); |
|
893 |
||
894 |
conferenceDataValue->SetBoolean(m_bubbleWrapper->conferenceCallId(callId)); |
|
895 |
} |
|
896 |
||
897 |
void PhoneUIQtViewAdapter::removeConferenceBubble() |
|
898 |
{ |
|
899 |
m_bubbleWrapper->bubbleManager().startChanges(); |
|
900 |
m_view.removeExpandAction(m_bubbleWrapper->bubbleId(KConferenceCallId)); |
|
901 |
m_bubbleWrapper->removeConferenceBubble(); |
|
902 |
m_bubbleWrapper->bubbleManager().endChanges(); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
903 |
m_indicatorController->clearActiveCallData(); |
37 | 904 |
} |
905 |
||
906 |
void PhoneUIQtViewAdapter::isConference(TPhoneCommandParam *commandParam) |
|
907 |
{ |
|
908 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
|
909 |
||
910 |
TPhoneCmdParamBoolean* conferenceDataValue = |
|
911 |
static_cast<TPhoneCmdParamBoolean*>( |
|
912 |
commandParam ); |
|
913 |
||
914 |
conferenceDataValue->SetBoolean(0<m_bubbleWrapper->conferenceCallList().size()); |
|
915 |
} |
|
916 |
||
917 |
void PhoneUIQtViewAdapter::removeCallFromConference(int callId) |
|
918 |
{ |
|
919 |
m_bubbleWrapper->bubbleManager().startChanges(); |
|
920 |
m_bubbleWrapper->removeCallFromConference(callId); |
|
921 |
int bubbleId = m_bubbleWrapper->bubbles().value(callId); |
|
922 |
m_view.clearBubbleCommands(bubbleId); |
|
923 |
m_view.removeExpandAction(bubbleId); |
|
924 |
m_bubbleWrapper->removeCallHeader(callId); |
|
925 |
m_bubbleWrapper->bubbleManager().endChanges(); |
|
926 |
} |
|
927 |
||
928 |
TPhoneViewResponseId PhoneUIQtViewAdapter::getSelectedConferenceMember( |
|
929 |
TPhoneCommandParam *commandParam) |
|
930 |
{ |
|
931 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdInteger); |
|
932 |
TPhoneViewResponseId ret = EPhoneViewResponseSuccess; |
|
933 |
TPhoneCmdParamInteger* integerValue = |
|
934 |
static_cast<TPhoneCmdParamInteger*>( |
|
935 |
commandParam ); |
|
936 |
||
937 |
int bubbleId = m_bubbleWrapper->bubbleManager().selectionIdInConference(); |
|
938 |
int callId = m_bubbleWrapper->callIdByBubbleId(bubbleId); |
|
939 |
||
940 |
if (callId == -1) { |
|
941 |
ret = EPhoneViewResponseFailed; |
|
942 |
} else { |
|
943 |
integerValue->SetInteger(callId); |
|
944 |
} |
|
945 |
||
946 |
return ret; |
|
947 |
} |
|
948 |
||
949 |
void PhoneUIQtViewAdapter::setPrivateFromConference(int callId) |
|
950 |
{ |
|
951 |
m_bubbleWrapper->bubbleManager().startChanges(); |
|
952 |
m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader(false); |
|
953 |
m_bubbleWrapper->removeCallFromConference(callId); |
|
954 |
m_view.clearBubbleCommands(m_bubbleWrapper->bubbles().value(callId)); |
|
955 |
m_bubbleWrapper->bubbleManager().endChanges(); |
|
956 |
} |
|
957 |
||
958 |
void PhoneUIQtViewAdapter::setExpandActions() |
|
959 |
{ |
|
960 |
/* If there is 2 or more calls ongoing then we should |
|
961 |
* enable expancion swap*/ |
|
962 |
int heldBubble = -1; |
|
963 |
||
964 |
if ( 2 <= m_bubbleWrapper->callStates().values().size() ) { |
|
965 |
if (callsExists(EPEStateConnected,EPEStateHeld)) { |
|
966 |
heldBubble = |
|
967 |
m_bubbleWrapper->bubbleId(m_bubbleWrapper->callId(EPEStateHeld)); |
|
968 |
m_view.setExpandAction(heldBubble, EPhoneInCallCmdSwap); |
|
969 |
} else if (callsExists(EPEStateConnected,EPEStateHeldConference)) { |
|
970 |
heldBubble = |
|
971 |
m_bubbleWrapper->bubbleId(m_bubbleWrapper->callId(EPEStateHeldConference)); |
|
972 |
m_view.setExpandAction(heldBubble, EPhoneInCallCmdSwap); |
|
973 |
} else if (callsExists(EPEStateRinging,EPEStateHeld)) { |
|
974 |
heldBubble = |
|
975 |
m_bubbleWrapper->bubbleId(m_bubbleWrapper->callId(EPEStateHeld)); |
|
976 |
m_view.setExpandAction(heldBubble, EPhoneInCallCmdUnhold); |
|
977 |
} |
|
978 |
||
979 |
QList<int> calls = m_bubbleWrapper->bubbles().keys(); |
|
980 |
foreach (int call, calls) { |
|
981 |
int bubbleId = m_bubbleWrapper->bubbleId(call); |
|
982 |
if ( bubbleId != heldBubble ) { |
|
983 |
m_view.setExpandAction(bubbleId, EPhoneCmdUpdateUiControls); |
|
984 |
} |
|
985 |
} |
|
986 |
} |
|
987 |
} |
|
988 |
||
989 |
bool PhoneUIQtViewAdapter::callsExists(int call1State, int call2State) |
|
990 |
{ |
|
991 |
bool callsExist(false); |
|
992 |
if ( m_bubbleWrapper->callStates().values().contains(call1State) && |
|
993 |
m_bubbleWrapper->callStates().values().contains(call2State) ) { |
|
994 |
callsExist = true; |
|
995 |
} |
|
996 |
return callsExist; |
|
997 |
} |
|
998 |
||
999 |
void PhoneUIQtViewAdapter::setParticipantListActions() |
|
1000 |
{ |
|
1001 |
if ( 0<m_bubbleWrapper->conferenceCallList().size() ) { |
|
1002 |
m_view.addParticipantListAction( |
|
1003 |
EPhoneInCallCmdPrivate, |
|
1004 |
hbTrId("txt_phone_button_private"), |
|
1005 |
HbIcon("qtg_mono_private_call")); |
|
1006 |
m_view.addParticipantListAction( |
|
1007 |
EPhoneInCallCmdDrop, |
|
1008 |
hbTrId("txt_phone_button_drop"), |
|
1009 |
HbIcon("qtg_mono_drop_call")); |
|
1010 |
} |
|
1011 |
} |
|
1012 |
||
1013 |
void PhoneUIQtViewAdapter::setExpandedConferenceCallHeader() |
|
1014 |
{ |
|
1015 |
int callId = PHONE_CALL_NOT_FOUND; |
|
1016 |
||
1017 |
if ( 1==m_bubbleWrapper->bubbles().keys().size() |
|
1018 |
|| (1<m_bubbleWrapper->bubbles().keys().size() |
|
1019 |
&& false == m_bubbleWrapper->callStates().values().contains(EPEStateRinging) |
|
1020 |
&& false == m_bubbleWrapper->callStates().values().contains(EPEStateDialing) |
|
1021 |
&& false == m_bubbleWrapper->callStates().values().contains(EPEStateConnecting) |
|
1022 |
&& false == m_bubbleWrapper->callStates().values().contains(EPEStateHeldConference))) { |
|
1023 |
||
1024 |
int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble(); |
|
1025 |
callId = m_bubbleWrapper->callIdByBubbleId(bubbleId); |
|
1026 |
} |
|
1027 |
||
1028 |
m_bubbleWrapper->bubbleManager().setExpandedConferenceCallHeader( |
|
1029 |
(KConferenceCallId == callId)); |
|
1030 |
} |
|
1031 |
||
1032 |
void PhoneUIQtViewAdapter::bringToForeground() |
|
1033 |
{ |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1034 |
m_visibilityHandler->bringToForeground(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1035 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1036 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1037 |
void PhoneUIQtViewAdapter::hideDeviceDialogs(TPhoneCommandParam *commandParam) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1038 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1039 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1040 |
TPhoneCmdParamBoolean* booleanParam = |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1041 |
static_cast<TPhoneCmdParamBoolean*>(commandParam); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1042 |
m_visibilityHandler->hideDeviceDialogs(booleanParam->Boolean()); |
37 | 1043 |
} |
1044 |
||
1045 |
void PhoneUIQtViewAdapter::showGlobalNote( |
|
1046 |
TPhoneCommandParam *commandParam) |
|
1047 |
{ |
|
1048 |
m_noteController->showGlobalNote(commandParam); |
|
1049 |
} |
|
1050 |
||
1051 |
void PhoneUIQtViewAdapter::setDialpadVisibility( |
|
1052 |
TPhoneCommandParam *commandParam) |
|
1053 |
{ |
|
1054 |
Q_ASSERT (commandParam->ParamId () == TPhoneCommandParam::EPhoneParamIdBoolean); |
|
1055 |
TPhoneCmdParamBoolean* booleanParam = |
|
1056 |
static_cast<TPhoneCmdParamBoolean*>(commandParam); |
|
1057 |
||
1058 |
if (booleanParam->Boolean()) { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1059 |
m_dialpadAboutToClose = true; |
37 | 1060 |
m_view.showDialpad(); |
1061 |
} else { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1062 |
m_clearDialpadOnClose = false; |
37 | 1063 |
m_view.hideDialpad(); |
1064 |
} |
|
1065 |
} |
|
1066 |
||
1067 |
void PhoneUIQtViewAdapter::removeAllCallHeaders() |
|
1068 |
{ |
|
1069 |
if (m_bubbleWrapper->conferenceCallList().size()) { |
|
1070 |
removeConferenceBubble(); |
|
1071 |
} |
|
1072 |
||
1073 |
QList<int> callIds = m_bubbleWrapper->bubbles().keys(); |
|
1074 |
||
1075 |
for (int i=0; i<callIds.size(); ++i) { |
|
1076 |
int callId = callIds.at(i); |
|
1077 |
if (KEmergencyCallId != callId) { |
|
1078 |
m_bubbleWrapper->bubbleManager().startChanges(); |
|
1079 |
int bubble = m_bubbleWrapper->bubbles().value(callId); |
|
1080 |
m_view.clearBubbleCommands(bubble); |
|
1081 |
m_view.removeExpandAction(bubble); |
|
1082 |
m_bubbleWrapper->removeCallHeader (callId); |
|
1083 |
m_bubbleWrapper->bubbleManager().endChanges(); |
|
1084 |
} |
|
1085 |
} |
|
1086 |
m_indicatorController->clearActiveCallData(); |
|
1087 |
} |
|
1088 |
||
1089 |
void PhoneUIQtViewAdapter::getNumberFromDialpad( |
|
1090 |
TPhoneCommandParam *commandParam) |
|
1091 |
{ |
|
1092 |
||
1093 |
TPhoneCmdParamString* entryContent = |
|
1094 |
static_cast<TPhoneCmdParamString*>(commandParam); |
|
1095 |
||
1096 |
QString westernNumber = |
|
1097 |
HbStringUtil::convertDigitsTo(m_view.dialpadText(), WesternDigit); |
|
1098 |
||
1099 |
(*entryContent->String()).Copy(westernNumber.utf16()); |
|
1100 |
} |
|
1101 |
||
1102 |
void PhoneUIQtViewAdapter::getDialpadStringLength( |
|
1103 |
TPhoneCommandParam *commandParam) |
|
1104 |
{ |
|
1105 |
||
1106 |
TPhoneCmdParamInteger* integerParam = |
|
1107 |
static_cast<TPhoneCmdParamInteger*>(commandParam); |
|
1108 |
||
1109 |
integerParam->SetInteger(m_view.dialpadText().length()); |
|
1110 |
} |
|
1111 |
||
1112 |
void PhoneUIQtViewAdapter::removeDialpad() |
|
1113 |
{ |
|
1114 |
m_view.clearAndHideDialpad(); |
|
1115 |
} |
|
1116 |
||
1117 |
void PhoneUIQtViewAdapter::addToConference() |
|
1118 |
{ |
|
1119 |
m_bubbleWrapper->addToConferenceBubble(); |
|
1120 |
} |
|
1121 |
||
1122 |
void PhoneUIQtViewAdapter::setMenu() |
|
1123 |
{ |
|
1124 |
if (m_view.isDialpadVisible() && false == m_dialpadAboutToClose) { |
|
1125 |
setDialpadMenu(); |
|
1126 |
} else { |
|
1127 |
setCallMenu(); |
|
1128 |
} |
|
1129 |
} |
|
1130 |
||
1131 |
void PhoneUIQtViewAdapter::setCallMenu() |
|
1132 |
{ |
|
1133 |
if ( 0<m_bubbleWrapper->callStates().keys().size() ) { |
|
1134 |
int bubbleId = m_bubbleWrapper->bubbleManager().expandedBubble(); |
|
1135 |
int callId = m_bubbleWrapper->callIdByBubbleId(bubbleId); |
|
1136 |
m_uiCommandController->setCallMenuActions( |
|
1137 |
m_bubbleWrapper->callStates(), |
|
1138 |
m_bubbleWrapper->serviceIds(), |
|
1139 |
m_bubbleWrapper->serviceIdByCallId(callId), |
|
1140 |
callId ); |
|
1141 |
} |
|
1142 |
||
1143 |
} |
|
1144 |
||
1145 |
void PhoneUIQtViewAdapter::setDialpadMenu() |
|
1146 |
{ |
|
1147 |
m_uiCommandController->setDialpadMenuActions(); |
|
1148 |
} |
|
1149 |
||
1150 |
void PhoneUIQtViewAdapter::showNote(TPhoneCommandParam *commandParam) |
|
1151 |
{ |
|
1152 |
m_noteController->showNote(commandParam); |
|
1153 |
} |
|
1154 |
||
1155 |
QString PhoneUIQtViewAdapter::convertDuration(TInt secs) |
|
1156 |
{ |
|
1157 |
QTime init(0,0,0); |
|
1158 |
QTime duration = init.addSecs(secs); |
|
1159 |
HbExtendedLocale locale = HbExtendedLocale::system(); |
|
1160 |
QString durationString = locale.format(duration, QString(r_qtn_time_durat_long)); |
|
1161 |
return HbStringUtil::convertDigits(durationString); |
|
1162 |
} |
|
1163 |
||
1164 |
void PhoneUIQtViewAdapter::setBubbleSelectionFlag() |
|
1165 |
{ |
|
1166 |
bool selectionFlag = ((m_bubbleWrapper->callStates(). |
|
1167 |
values().contains(EPEStateRinging) && |
|
1168 |
m_bubbleWrapper->conferenceCallList().count())|| |
|
1169 |
m_bubbleWrapper->callStates(). |
|
1170 |
values().contains(EPEStateDialing) || |
|
1171 |
m_bubbleWrapper->callStates(). |
|
1172 |
values().contains(EPEStateConnecting)); |
|
1173 |
||
1174 |
m_bubbleWrapper->bubbleManager().setBubbleSelectionDisabled(selectionFlag); |
|
1175 |
} |
|
1176 |
||
1177 |
void PhoneUIQtViewAdapter::setHidden(bool hidden) |
|
1178 |
{ |
|
1179 |
TRAP_IGNORE(SetHiddenL(hidden)); |
|
1180 |
} |
|
1181 |
||
1182 |
void PhoneUIQtViewAdapter::SetHiddenL(bool hidden) |
|
1183 |
{ |
|
1184 |
CEikonEnv* env = CEikonEnv::Static(); |
|
1185 |
||
1186 |
if (env) { |
|
1187 |
CApaWindowGroupName* windowGroupName = |
|
1188 |
CApaWindowGroupName::NewLC( |
|
1189 |
env->WsSession(), |
|
1190 |
env->RootWin().Identifier() ); |
|
1191 |
||
1192 |
windowGroupName->SetHidden( hidden ); |
|
1193 |
User::LeaveIfError( |
|
1194 |
windowGroupName->SetWindowGroupName( |
|
1195 |
env->RootWin() ) ); |
|
1196 |
||
1197 |
CleanupStack::PopAndDestroy( windowGroupName ); |
|
1198 |
||
1199 |
CAknSgcClient::AknSrv()->UpdateTaskList(); |
|
1200 |
} |
|
1201 |
} |
|
1202 |
||
1203 |
void PhoneUIQtViewAdapter::openContacts() |
|
1204 |
{ |
|
1205 |
XQServiceRequest snd("com.nokia.services.phonebookappservices.Launch","launch()", false); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1206 |
XQRequestInfo info; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1207 |
info.setForeground(true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1208 |
snd.setInfo(info); |
37 | 1209 |
int retValue; |
1210 |
snd.send(retValue); |
|
1211 |
} |
|
1212 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1213 |
void PhoneUIQtViewAdapter::openLogs(TPhoneCommandParam *commandParam) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1214 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1215 |
TPhoneCmdParamString* entryContent = |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1216 |
static_cast<TPhoneCmdParamString*>(commandParam); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1217 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1218 |
int ordinalPosition = m_visibilityHandler->ordinalPosition(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1219 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1220 |
m_homeScreenToForeground = false; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1221 |
m_visibilityHandler->sendToBackground(m_homeScreenToForeground); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1222 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1223 |
if (0 == ordinalPosition) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1224 |
// Activate logs dialer only if telephone is on the top. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1225 |
XQServiceRequest snd("com.nokia.services.logsservices.starter", |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1226 |
"startWithNum(int,bool,QString)", false); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1227 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1228 |
snd << (int)LogsServices::ViewAll; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1229 |
snd << true; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1230 |
snd << QString::fromUtf16(entryContent->String()->Ptr(), |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1231 |
entryContent->String()->Length()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1232 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1233 |
XQRequestInfo info; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1234 |
info.setForeground(true); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1235 |
snd.setInfo(info); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1236 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1237 |
int retValue = -1; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1238 |
snd.send(retValue); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1239 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1240 |
} |
37 | 1241 |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1242 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
1243 |