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) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Handles phone ui commands. |
|
15 |
*/ |
|
16 |
||
17 |
#include "phoneuicommandcontroller.h" |
|
18 |
#include "phoneresourceadapter.h" |
|
19 |
#include "phoneuiqtbuttonscontroller.h" |
|
20 |
#include "qtphonelog.h" |
|
21 |
#include <hbaction.h> |
|
22 |
#include <spsettings.h> |
|
23 |
#include <spentry.h> |
|
24 |
#include <spproperty.h> |
|
25 |
#include <xqphoneappcommands.h> |
|
26 |
#include <phoneappcommands.hrh> |
|
27 |
#include <phoneappvoipcommands.hrh> |
|
28 |
#include <pevirtualengine.h> |
|
29 |
#include <xqteluicommandextension.h> |
|
30 |
||
31 |
||
32 |
PhoneUiCommandController::PhoneUiCommandController( |
|
33 |
PhoneUIQtViewIF &view, QObject *parent) |
|
34 |
: QObject (parent), m_view(view), m_lastCommandExtension(0) |
|
35 |
{ |
|
36 |
PHONE_DEBUG("PhoneMenuController::PhoneMenuController"); |
|
37 |
} |
|
38 |
||
39 |
PhoneUiCommandController::~PhoneUiCommandController() |
|
40 |
{ |
|
41 |
PHONE_DEBUG("PhoneMenuController::~PhoneMenuController"); |
|
42 |
for (int i=0;i<m_commandExtensions.count();++i) { |
|
43 |
m_commandExtensions.at(i)->release(); |
|
44 |
} |
|
45 |
} |
|
46 |
||
47 |
void PhoneUiCommandController::setCallMenuActions( |
|
48 |
QMap<int,int> callStates, QMap<int,int> serviceIds, |
|
49 |
int serviceId, int expandedCallId ) |
|
50 |
{ |
|
51 |
PHONE_DEBUG("PhoneMenuController::setCallMenuActions"); |
|
52 |
releaseMenu(); |
|
53 |
||
54 |
PhoneCommandExtensionWrapper *extension = commandExtension(serviceId); |
|
55 |
QList<int> menuCmdList = menuCommands(callStates, serviceIds); |
|
56 |
||
57 |
if (extension) { |
|
58 |
QList<XQTelUiCommandExtension::CallInfo> callInfo; |
|
59 |
extension->getCallInfoList( |
|
60 |
callInfo,callStates,serviceIds,expandedCallId); |
|
61 |
||
62 |
//Modify command list by extension |
|
63 |
extension->modifyMenuCommandList(callInfo,menuCmdList); |
|
64 |
addMenuItems(menuCmdList); |
|
65 |
||
66 |
extension->addMenuActions(callInfo,m_customMenuActions); |
|
67 |
for (int i=0;i<m_customMenuActions.count();++i) { |
|
68 |
m_view.menuReference().addAction(m_customMenuActions.at(i)); |
|
69 |
} |
|
70 |
} else { |
|
71 |
addMenuItems(menuCmdList); |
|
72 |
} |
|
73 |
||
74 |
||
75 |
} |
|
76 |
||
77 |
void PhoneUiCommandController::setDialpadMenuActions() |
|
78 |
{ |
|
79 |
PHONE_DEBUG("PhoneMenuController::setDialpadMenuActions"); |
|
80 |
releaseMenu(); |
|
81 |
QList<PhoneAction*> values; |
|
82 |
m_view.setMenuActions(values); |
|
83 |
qDeleteAll(values); |
|
84 |
} |
|
85 |
||
86 |
QMap<PhoneAction::ActionType, PhoneAction *> |
|
87 |
PhoneUiCommandController::pushButtonActionsForCall( |
|
88 |
int callState, |
|
89 |
bool emergencyCall, |
|
90 |
QMap<int,int> callStates, |
|
91 |
QMap<int,int> serviceIds, |
|
92 |
int serviceId, |
|
93 |
int callId) |
|
94 |
{ |
|
95 |
QMap<PhoneAction::ActionType, PhoneAction *> translatedActions; |
|
96 |
QList<int> commands = buttonCommandList( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
97 |
callState, emergencyCall, callStates.values()); |
37 | 98 |
|
99 |
PhoneCommandExtensionWrapper *extension = commandExtension(serviceId); |
|
100 |
||
101 |
if (extension) { |
|
102 |
QList<XQTelUiCommandExtension::CallInfo> callInfo; |
|
103 |
extension->getCallInfoList( |
|
104 |
callInfo,callStates,serviceIds,callId); |
|
105 |
||
106 |
//Modify command list by extension |
|
107 |
extension->modifyPushButtonCommandList(callInfo,commands); |
|
108 |
} |
|
109 |
||
110 |
if (1 == commands.count()) { |
|
111 |
PhoneAction *action = mapCommandToAction(commands.at(0)); |
|
112 |
if (action) { |
|
113 |
translatedActions[PhoneAction::LeftButton] = action; |
|
114 |
} |
|
115 |
} else if (1 < commands.count()){ |
|
116 |
PhoneAction *action = mapCommandToAction(commands.at(0)); |
|
117 |
PhoneAction *action2 = mapCommandToAction(commands.at(1)); |
|
118 |
if (action) { |
|
119 |
translatedActions[PhoneAction::LeftButton] = action; |
|
120 |
} |
|
121 |
if (action2) { |
|
122 |
translatedActions[PhoneAction::RightButton] = action2; |
|
123 |
} |
|
124 |
} |
|
125 |
||
126 |
return translatedActions; |
|
127 |
} |
|
128 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
129 |
QList<PhoneAction *> PhoneUiCommandController::toolBarActions( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
130 |
int resourceId, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
131 |
QMap<int,int> callStates, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
132 |
QMap<int,int> serviceIds, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
133 |
int serviceId, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
134 |
int callId) |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
135 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
136 |
QList<PhoneAction *> actions; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
137 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
138 |
//Set tool bar button flags |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
139 |
setJoinFlag(callStates, serviceIds); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
140 |
setConferenceFlag(callStates.values()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
141 |
setHoldFlag(callStates.value(callId)); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
142 |
setMultiCallFlag(callStates.values()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
143 |
setOutgoingFlag(callStates.values()); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
144 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
145 |
//Get tool bar item list by resource id. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
146 |
QList<PhoneAction::ToolBarItem> commands = PhoneResourceAdapter::Instance()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
147 |
convertToToolBarCommandList(resourceId); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
148 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
149 |
if (serviceId != -1) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
150 |
PhoneCommandExtensionWrapper *extension = commandExtension(serviceId); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
151 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
152 |
if (extension) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
153 |
QList<XQTelUiCommandExtension::CallInfo> callInfo; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
154 |
extension->getCallInfoList( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
155 |
callInfo,callStates,serviceIds,callId); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
156 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
157 |
QList<XQTelUiCommandExtension::ToolBarCommand> toolBarCmdList; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
158 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
159 |
mapToExtensionToolBarItems(commands,toolBarCmdList); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
160 |
//Modify tool bar command list by extension |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
161 |
extension->modifyToolBarCommandList(callInfo,toolBarCmdList); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
162 |
// Map tool bar item list back to the phone action tool bar item list. |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
163 |
mapToPhoneActionToolBarItems(toolBarCmdList,commands); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
164 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
165 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
166 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
167 |
for ( int i=0; i < commands.count(); ++i) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
168 |
PhoneAction *action = mapCommandToAction( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
169 |
commands.at(i).mCommandId, !commands.at(i).mEnabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
170 |
if (action) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
171 |
actions.append(action); |
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 |
} |
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 |
return actions; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
176 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
177 |
|
37 | 178 |
QList<int> PhoneUiCommandController::menuCommands( |
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
179 |
QMap<int,int> callStates, QMap<int,int> serviceIds ) const |
37 | 180 |
{ |
181 |
PHONE_DEBUG("PhoneMenuController::menuCommands"); |
|
182 |
QList<int> commands; |
|
183 |
bool sameServices = areServicesSame(callStates,serviceIds); |
|
184 |
||
185 |
switch(callStates.values().count()) { |
|
186 |
case 1: { |
|
187 |
// No logical string for switch to video option |
|
188 |
/*if (callStates.values().contains(EPEStateConnected)) { |
|
189 |
commands.append(PhoneInCallCmdSwitchToVideo); |
|
190 |
}*/ |
|
191 |
} |
|
192 |
break; |
|
193 |
case 2: { |
|
194 |
if (!callStates.values().contains(EPEStateRinging) && |
|
195 |
!callStates.values().contains(EPEStateDisconnecting) && |
|
196 |
!callStates.values().contains(EPEStateDialing)) { |
|
197 |
commands.append(PhoneInCallCmdEndAllCalls); |
|
198 |
} |
|
199 |
if (callStates.values().contains(EPEStateConnected) && |
|
200 |
callStates.values().contains(EPEStateHeld)) { |
|
201 |
if (sameServices) { |
|
202 |
commands.append(PhoneInCallCmdTransfer); |
|
203 |
} |
|
204 |
} |
|
205 |
} |
|
206 |
break; |
|
207 |
case 3: { |
|
208 |
commands.append(PhoneInCallCmdEndAllCalls); |
|
209 |
} |
|
210 |
break; |
|
211 |
default: |
|
212 |
break; |
|
213 |
} |
|
214 |
||
215 |
return commands; |
|
216 |
} |
|
217 |
||
218 |
void PhoneUiCommandController::addMenuItems(QList<int> menuCmdList) |
|
219 |
{ |
|
220 |
QList<PhoneAction*> values; |
|
221 |
||
222 |
for (int i=0;i<menuCmdList.count();++i) { |
|
223 |
int command = mapCommand(menuCmdList.at(i)); |
|
224 |
if (-1 != command) { |
|
225 |
PhoneAction* phoneAction = new PhoneAction(); |
|
226 |
phoneAction->setCommand(command); |
|
227 |
phoneAction->setText( |
|
228 |
PhoneResourceAdapter::Instance()-> |
|
229 |
convertCommandToString(command)); |
|
230 |
||
231 |
values.append(phoneAction); |
|
232 |
} |
|
233 |
} |
|
234 |
||
235 |
m_view.setMenuActions(values); |
|
236 |
qDeleteAll(values); |
|
237 |
} |
|
238 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
239 |
int PhoneUiCommandController::mapCommand(int command) const |
37 | 240 |
{ |
241 |
int ret(-1); |
|
242 |
||
243 |
switch(command) { |
|
244 |
case PhoneInCallCmdEndAllCalls: |
|
245 |
ret = EPhoneInCallCmdEndAllCalls; |
|
246 |
break; |
|
247 |
case PhoneInCallCmdTransfer: |
|
248 |
ret = EPhoneInCallCmdTransfer; |
|
249 |
break; |
|
250 |
case PhoneInCallCmdSwitchToVideo: |
|
251 |
ret = EPhoneInCallCmdSwitchToVideo; |
|
252 |
break; |
|
253 |
case PhoneInCallCmdHandoverToWlan: |
|
254 |
ret = EPhoneCmdHandoverToWlan; |
|
255 |
break; |
|
256 |
case PhoneInCallCmdHandoverToGsm: |
|
257 |
ret = EPhoneCmdHandoverToGsm; |
|
258 |
break; |
|
259 |
default: |
|
260 |
break; |
|
261 |
} |
|
262 |
||
263 |
return ret; |
|
264 |
} |
|
265 |
||
266 |
PhoneCommandExtensionWrapper *PhoneUiCommandController::commandExtension( |
|
267 |
int serviceId) |
|
268 |
{ |
|
269 |
PhoneCommandExtensionWrapper *extension = 0; |
|
270 |
TRAP_IGNORE( extension = CommandExtensionL(serviceId) ); |
|
271 |
return extension; |
|
272 |
} |
|
273 |
||
274 |
TUid PhoneUiCommandController::ResolveImplementationUidL( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
275 |
TUint32 aServiceId, TServicePropertyName aPropertyName ) const |
37 | 276 |
{ |
277 |
TUid implUid = { 0 }; |
|
278 |
CSPEntry* entry = CSPEntry::NewLC(); |
|
279 |
||
280 |
CSPSettings* spSettings = CSPSettings::NewLC(); |
|
281 |
||
282 |
User::LeaveIfError( |
|
283 |
spSettings->FindEntryL( aServiceId, *entry ) ); |
|
284 |
||
285 |
CleanupStack::PopAndDestroy( spSettings ); |
|
286 |
||
287 |
const CSPProperty* property = NULL; |
|
288 |
User::LeaveIfError( entry->GetProperty( property, aPropertyName ) ); |
|
289 |
||
290 |
if ( property ) |
|
291 |
{ |
|
292 |
TInt temp(0); |
|
293 |
User::LeaveIfError( property->GetValue( temp ) ); |
|
294 |
implUid.iUid = temp; |
|
295 |
} |
|
296 |
||
297 |
CleanupStack::PopAndDestroy( entry ); |
|
298 |
return implUid; |
|
299 |
} |
|
300 |
||
301 |
PhoneCommandExtensionWrapper |
|
302 |
*PhoneUiCommandController::CommandExtensionL( TUint aServiceId ) |
|
303 |
{ |
|
304 |
TUid pluginUid = ResolveImplementationUidL( aServiceId, |
|
305 |
EPropertyCallMenuHandlerPluginId ); |
|
306 |
||
307 |
int pluginInd(-1); |
|
308 |
PhoneCommandExtensionWrapper* wrapper = NULL; |
|
309 |
||
310 |
for (int i=0; i<m_commandExtensions.count();++i) { |
|
311 |
if (pluginUid.iUid==m_commandExtensions.at(i)->pluginUid()) { |
|
312 |
pluginInd = i; |
|
313 |
break; |
|
314 |
} |
|
315 |
} |
|
316 |
||
317 |
if ( -1 == pluginInd ) |
|
318 |
{ |
|
319 |
wrapper = new PhoneCommandExtensionWrapper( pluginUid.iUid ); |
|
320 |
if (wrapper) |
|
321 |
m_commandExtensions.append( wrapper ); |
|
322 |
} |
|
323 |
else |
|
324 |
{ |
|
325 |
wrapper = m_commandExtensions[pluginInd]; |
|
326 |
} |
|
327 |
||
328 |
m_lastCommandExtension = wrapper; |
|
329 |
return wrapper; |
|
330 |
} |
|
331 |
||
332 |
void PhoneUiCommandController::releaseMenu() |
|
333 |
{ |
|
334 |
PHONE_DEBUG("PhoneMenuController::setDialpadMenuActions"); |
|
335 |
for (int i=0;i<m_customMenuActions.count();i++) { |
|
336 |
m_view.menuReference().removeAction(m_customMenuActions.at(i)); |
|
337 |
} |
|
338 |
m_customMenuActions.clear(); |
|
339 |
||
340 |
if (m_lastCommandExtension) { |
|
341 |
m_lastCommandExtension->releaseMenu(); |
|
342 |
m_lastCommandExtension = 0; |
|
343 |
} |
|
344 |
} |
|
345 |
||
346 |
bool PhoneUiCommandController::areServicesSame( |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
347 |
QMap<int,int> callStates, QMap<int,int> serviceIds) const |
37 | 348 |
{ |
349 |
bool ret(true); |
|
350 |
int serviceId(-1); |
|
351 |
for(int i=0;i<callStates.count()&&ret;++i) { |
|
352 |
if (-1==serviceId) { |
|
353 |
serviceId = serviceIds.value(callStates.keys().at(i)); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
354 |
} else if (serviceId != serviceIds.value(callStates.keys().at(i))) { |
37 | 355 |
ret = false; |
356 |
} |
|
357 |
} |
|
358 |
||
359 |
return ret; |
|
360 |
} |
|
361 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
362 |
void PhoneUiCommandController::setJoinFlag( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
363 |
QMap<int,int> callStates, QMap<int,int> serviceIds) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
364 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
365 |
bool disable(PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
366 |
getButtonFlags(PhoneUIQtButtonsController::FullConference)); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
367 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
368 |
if (!disable) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
369 |
disable = !areServicesSame(callStates, serviceIds); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
370 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
371 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
372 |
PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
373 |
setButtonFlags(PhoneUIQtButtonsController::DisableJoin, disable); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
374 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
375 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
376 |
void PhoneUiCommandController::setHoldFlag(int callState) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
377 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
378 |
bool hold = (callState == EPEStateHeldConference || |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
379 |
callState == EPEStateHeld ); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
380 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
381 |
PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
382 |
setButtonFlags(PhoneUIQtButtonsController::Hold,hold); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
383 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
384 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
385 |
void PhoneUiCommandController::setOutgoingFlag( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
386 |
QList<int> callStates) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
387 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
388 |
bool outgoing(callStates.contains(EPEStateDialing) || |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
389 |
callStates.contains(EPEStateConnecting)); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
390 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
391 |
PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
392 |
setButtonFlags(PhoneUIQtButtonsController::Outgoing, outgoing); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
393 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
394 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
395 |
void PhoneUiCommandController::setConferenceFlag( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
396 |
QList<int> callStates) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
397 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
398 |
bool conference(callStates.contains(EPEStateConnectedConference) || |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
399 |
callStates.contains(EPEStateHeldConference)); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
400 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
401 |
PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
402 |
setButtonFlags(PhoneUIQtButtonsController::Conference, conference); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
403 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
404 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
405 |
void PhoneUiCommandController::setMultiCallFlag( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
406 |
QList<int> callStates) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
407 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
408 |
bool multicall(false); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
409 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
410 |
if (1<callStates.count()) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
411 |
if (callStates.count() == 2 && callStates.contains(EPEStateRinging)) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
412 |
multicall = false; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
413 |
} else { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
414 |
multicall = true; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
415 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
416 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
417 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
418 |
PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
419 |
setButtonFlags(PhoneUIQtButtonsController::MultiCall, multicall); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
420 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
421 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
422 |
void PhoneUiCommandController::mapToExtensionToolBarItems( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
423 |
const QList<PhoneAction::ToolBarItem> &sourceList, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
424 |
QList<XQTelUiCommandExtension::ToolBarCommand> &toolBarCmdList) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
425 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
426 |
toolBarCmdList.clear(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
427 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
428 |
for (int i=0;i<sourceList.count();++i) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
429 |
XQTelUiCommandExtension::ToolBarCommand command; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
430 |
command.mCommandId = sourceList.at(i).mCommandId; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
431 |
command.mIsEnabled = sourceList.at(i).mEnabled; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
432 |
toolBarCmdList.append(command); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
433 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
434 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
435 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
436 |
void PhoneUiCommandController::mapToPhoneActionToolBarItems( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
437 |
const QList<XQTelUiCommandExtension::ToolBarCommand> &sourceList, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
438 |
QList<PhoneAction::ToolBarItem> &commandList) const |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
439 |
{ |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
440 |
commandList.clear(); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
441 |
|
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
442 |
for (int i=0;i<sourceList.count();++i) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
443 |
PhoneAction::ToolBarItem command( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
444 |
sourceList.at(i).mCommandId, |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
445 |
sourceList.at(i).mIsEnabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
446 |
commandList.append(command); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
447 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
448 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
449 |
|
37 | 450 |
QList<int> PhoneUiCommandController::buttonCommandList( |
451 |
int callState, |
|
452 |
bool emergencyCall, |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
453 |
QList<int> callStates) const |
37 | 454 |
{ |
455 |
QList<int> ret; |
|
456 |
||
457 |
switch( callState ) { |
|
458 |
case EPEStateIdle: |
|
459 |
case EPEStateDisconnecting: |
|
460 |
case EPEStateConferenceIdle: |
|
461 |
break; |
|
462 |
||
463 |
case EPEStateDialing: |
|
464 |
case EPEStateConnecting: { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
465 |
if (!emergencyCall) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
466 |
if (PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
467 |
getButtonFlags(PhoneUIQtButtonsController::Mute)) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
468 |
ret.append(PhoneInCallCmdUnmute); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
469 |
} else { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
470 |
ret.append(PhoneInCallCmdMute); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
471 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
472 |
} |
37 | 473 |
ret.append(PhoneInCallCmdEndOutgoingCall); |
474 |
} |
|
475 |
break; |
|
476 |
case EPEStateRinging: { |
|
477 |
if (callStates.size()<3){ |
|
478 |
ret.append(PhoneInCallCmdAnswer); |
|
479 |
ret.append(PhoneInCallCmdReject); |
|
480 |
} else { |
|
481 |
ret.append(PhoneInCallCmdReplace); |
|
482 |
} |
|
483 |
} |
|
484 |
break; |
|
485 |
||
486 |
case EPEStateConnected: |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
487 |
case EPEStateConnectedConference: |
37 | 488 |
case EPEStateHeld: |
489 |
case EPEStateHeldConference: { |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
490 |
if (!emergencyCall) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
491 |
if (PhoneResourceAdapter::Instance()->buttonsController()-> |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
492 |
getButtonFlags(PhoneUIQtButtonsController::Mute)) { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
493 |
ret.append(PhoneInCallCmdUnmute); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
494 |
} else { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
495 |
ret.append(PhoneInCallCmdMute); |
37 | 496 |
} |
497 |
} |
|
498 |
||
499 |
ret.append(PhoneInCallCmdEndActive); |
|
500 |
} |
|
501 |
break; |
|
502 |
||
503 |
case EPEStateUnknown: |
|
504 |
break; |
|
505 |
||
506 |
default: |
|
507 |
break; |
|
508 |
} |
|
509 |
||
510 |
return ret; |
|
511 |
} |
|
512 |
||
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
513 |
PhoneAction *PhoneUiCommandController::mapCommandToAction( |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
514 |
int command, bool disabled) const |
37 | 515 |
{ |
516 |
PhoneAction *action=0; |
|
517 |
||
518 |
switch( command ) { |
|
519 |
case PhoneInCallCmdJoinToConference: { |
|
520 |
action = new PhoneAction; |
|
521 |
action->setIcon(HbIcon("qtg_mono_join_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
522 |
action->setDisabled(disabled); |
37 | 523 |
action->setCommand(EPhoneInCallCmdJoin); |
524 |
} |
|
525 |
break; |
|
526 |
||
527 |
case PhoneInCallCmdCreateConference: { |
|
528 |
action = new PhoneAction; |
|
529 |
action->setIcon(HbIcon("qtg_mono_join_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
530 |
action->setDisabled(disabled); |
37 | 531 |
action->setCommand(EPhoneInCallCmdCreateConference); |
532 |
} |
|
533 |
break; |
|
534 |
||
535 |
case PhoneInCallCmdAnswer: { |
|
536 |
action = new PhoneAction; |
|
537 |
action->setIcon(HbIcon("qtg_mono_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
538 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
539 |
action->setCommand (EPhoneCallComingCmdAnswer); |
37 | 540 |
action->setActionRole(PhoneAction::Accept); |
541 |
} |
|
542 |
break; |
|
543 |
||
544 |
case PhoneInCallCmdReject: { |
|
545 |
action = new PhoneAction; |
|
546 |
action->setIcon(HbIcon("qtg_mono_reject_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
547 |
action->setDisabled(disabled); |
37 | 548 |
action->setCommand (EPhoneCallComingCmdReject); |
549 |
action->setActionRole(PhoneAction::Decline); |
|
550 |
} |
|
551 |
break; |
|
552 |
||
553 |
case PhoneInCallCmdHold: { |
|
554 |
action = new PhoneAction; |
|
555 |
action->setIcon(HbIcon("qtg_mono_hold_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
556 |
action->setDisabled(disabled); |
37 | 557 |
action->setCommand(EPhoneInCallCmdHold); |
558 |
} |
|
559 |
break; |
|
560 |
||
561 |
case PhoneInCallCmdUnhold: { |
|
562 |
action = new PhoneAction; |
|
563 |
action->setIcon(HbIcon("qtg_mono_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
564 |
action->setDisabled(disabled); |
37 | 565 |
action->setCommand(EPhoneInCallCmdUnhold); |
566 |
} |
|
567 |
break; |
|
568 |
||
569 |
case PhoneInCallCmdEndActive: { |
|
570 |
action = new PhoneAction; |
|
571 |
action->setIcon(HbIcon("qtg_mono_end_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
572 |
action->setDisabled(disabled); |
37 | 573 |
action->setCommand(EPhoneInCallCmdEndThisActiveCall); |
574 |
action->setActionRole(PhoneAction::Decline); |
|
575 |
} |
|
576 |
break; |
|
577 |
||
578 |
case PhoneInCallCmdEndOutgoingCall: { |
|
579 |
action = new PhoneAction; |
|
580 |
action->setIcon(HbIcon("qtg_mono_end_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
581 |
action->setDisabled(disabled); |
37 | 582 |
action->setCommand(EPhoneInCallCmdEndThisOutgoingCall); |
583 |
action->setActionRole(PhoneAction::Decline); |
|
584 |
} |
|
585 |
break; |
|
586 |
||
587 |
case PhoneInCallCmdReplace: { |
|
588 |
action = new PhoneAction; |
|
589 |
action->setIcon(HbIcon("qtg_mono_replace_call")); |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
590 |
action->setDisabled(disabled); |
37 | 591 |
action->setCommand(EPhoneInCallCmdReplace); |
592 |
action->setActionRole(PhoneAction::Accept); |
|
593 |
} |
|
594 |
break; |
|
595 |
||
596 |
case PhoneInCallCmdSwap: { |
|
597 |
action = new PhoneAction; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
598 |
action->setIcon(HbIcon("qtg_mono_replace_call")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
599 |
action->setDisabled(disabled); |
37 | 600 |
action->setCommand(EPhoneInCallCmdSwap); |
601 |
} |
|
602 |
break; |
|
45
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
603 |
case PhoneCallComingCmdSoftReject: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
604 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
605 |
action->setIcon(HbIcon("qtg_mono_send")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
606 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
607 |
action->setCommand(EPhoneCallComingCmdSoftReject); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
608 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
609 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
610 |
case PhoneCallComingCmdSilent: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
611 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
612 |
action->setIcon(HbIcon("qtg_mono_speaker_off")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
613 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
614 |
action->setCommand(EPhoneCallComingCmdSilent); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
615 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
616 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
617 |
case PhoneInCallCmdOpenDialer: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
618 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
619 |
action->setIcon(HbIcon("qtg_mono_dialer")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
620 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
621 |
action->setCommand(EPhoneInCallCmdDialer); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
622 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
623 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
624 |
case PhoneInCallCmdMute: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
625 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
626 |
action->setIcon(HbIcon("qtg_mono_mic_mute")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
627 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
628 |
action->setCommand(EPhoneInCallCmdMute); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
629 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
630 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
631 |
case PhoneInCallCmdUnmute: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
632 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
633 |
action->setIcon(HbIcon("qtg_mono_mic_unmute")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
634 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
635 |
action->setCommand(EPhoneInCallCmdUnmute); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
636 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
637 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
638 |
case PhoneInCallCmdActivateIhf: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
639 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
640 |
action->setIcon(HbIcon("qtg_mono_speaker")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
641 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
642 |
action->setCommand(EPhoneInCallCmdActivateIhf); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
643 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
644 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
645 |
case PhoneInCallCmdDeactivateIhf: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
646 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
647 |
action->setIcon(HbIcon("qtg_mono_mobile")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
648 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
649 |
action->setCommand(EPhoneInCallCmdDeactivateIhf); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
650 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
651 |
break; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
652 |
case PhoneInCallCmdOpenContacts: { |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
653 |
action = new PhoneAction; |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
654 |
action->setIcon(HbIcon("qtg_mono_contacts")); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
655 |
action->setDisabled(disabled); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
656 |
action->setCommand(EPhoneInCallCmdContacts); |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
657 |
} |
6b911d05207e
Revision: 201023
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
37
diff
changeset
|
658 |
break; |
37 | 659 |
default: |
660 |
break; |
|
661 |
} |
|
662 |
||
663 |
return action; |
|
664 |
} |