|
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: Handles phone ui commands. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef PHONEUICOMMANDCONTROLLER_H |
|
19 #define PHONEUICOMMANDCONTROLLER_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QString> |
|
23 #include <hbmenu.h> |
|
24 #include <spdefinitions.h> |
|
25 #include "phonecommandextensionwrapper.h" |
|
26 #include "phoneuiqtviewif.h" |
|
27 #include "phoneaction.h" |
|
28 |
|
29 // FORWARD DECLARATION |
|
30 class HbAction; |
|
31 |
|
32 class PhoneUiCommandController : public QObject |
|
33 { |
|
34 Q_OBJECT |
|
35 |
|
36 public: |
|
37 |
|
38 /*! |
|
39 \fn PhoneUiCommandController( |
|
40 PhoneUIQtViewIF &m_view, QObject *parent) |
|
41 */ |
|
42 PhoneUiCommandController(PhoneUIQtViewIF &view, QObject *parent = 0); |
|
43 |
|
44 /*! |
|
45 Destructor |
|
46 */ |
|
47 virtual ~PhoneUiCommandController(); |
|
48 |
|
49 /*! |
|
50 \fn void showGlobalNote() |
|
51 |
|
52 Sets call menu actions. |
|
53 |
|
54 */ |
|
55 void setCallMenuActions(QMap<int,int> callStates, |
|
56 QMap<int,int> serviceIds, |
|
57 int serviceId, |
|
58 int expandedCallId); |
|
59 |
|
60 /*! |
|
61 \fn void setDialpadMenuActions () |
|
62 |
|
63 Sets dialpad menu actions. |
|
64 |
|
65 */ |
|
66 void setDialpadMenuActions(); |
|
67 |
|
68 /*! |
|
69 \fn void pushButtonActionsForCall () |
|
70 |
|
71 Returns push button actions for call. |
|
72 |
|
73 */ |
|
74 QMap<PhoneAction::ActionType, PhoneAction *> pushButtonActionsForCall( |
|
75 int callState, |
|
76 bool emergencyCall, |
|
77 QMap<int,int> callStates, |
|
78 QMap<int,int> serviceIds, |
|
79 int serviceId, |
|
80 int callId); |
|
81 |
|
82 /*! |
|
83 \fn void toolBarActions () |
|
84 |
|
85 Returns tool bar actions for call. |
|
86 |
|
87 */ |
|
88 QList<PhoneAction *> toolBarActions( |
|
89 int resourceId, |
|
90 QMap<int,int> callStates, |
|
91 QMap<int,int> serviceIds, |
|
92 int serviceId, |
|
93 int callId); |
|
94 |
|
95 private: |
|
96 |
|
97 /*! |
|
98 \fn QList<int> menuCommands() |
|
99 |
|
100 Returns list of current menu commands. |
|
101 |
|
102 */ |
|
103 QList<int> menuCommands( |
|
104 QMap<int,int> callStates, QMap<int,int> serviceIds) const; |
|
105 |
|
106 /*! |
|
107 \fn void addMenuItems() |
|
108 |
|
109 Adds menu commands to menu. |
|
110 */ |
|
111 void addMenuItems(QList<int> menuCmdList); |
|
112 |
|
113 /*! |
|
114 \fn int mapCommand() |
|
115 |
|
116 Maps ui command extension commands to |
|
117 phone app commands. |
|
118 */ |
|
119 int mapCommand(int command) const; |
|
120 |
|
121 /*! |
|
122 \fn void commandExtension() |
|
123 |
|
124 Returns command extension by service id (null if |
|
125 extension not available). |
|
126 */ |
|
127 PhoneCommandExtensionWrapper *commandExtension(int serviceId); |
|
128 |
|
129 /*! |
|
130 \fn void ResolveImplementationUidL() |
|
131 |
|
132 Returns service's plugin uid by service id. |
|
133 */ |
|
134 TUid ResolveImplementationUidL( |
|
135 TUint32 aServiceId, TServicePropertyName aPropertyName ) const; |
|
136 |
|
137 /*! |
|
138 \fn void MenuExtensionL() |
|
139 |
|
140 Returns command extension by service id (null if |
|
141 extension not available). |
|
142 */ |
|
143 PhoneCommandExtensionWrapper *CommandExtensionL( TUint aServiceId ); |
|
144 |
|
145 /*! |
|
146 \fn void releaseMenu() |
|
147 |
|
148 Releases extensions menu. |
|
149 */ |
|
150 void releaseMenu(); |
|
151 |
|
152 /*! |
|
153 \fn void areServicesSame() |
|
154 |
|
155 Checks are all calls made by same service (id). |
|
156 Returns true when same service used. |
|
157 */ |
|
158 bool areServicesSame(QMap<int,int> callStates, QMap<int,int> serviceIds) const; |
|
159 |
|
160 /*! |
|
161 \fn void setJoinFlag() |
|
162 |
|
163 Sets conference join button flag. |
|
164 */ |
|
165 void setJoinFlag(QMap<int,int> callStates, QMap<int,int> serviceIds) const; |
|
166 |
|
167 /*! |
|
168 \fn void setHoldFlag() |
|
169 |
|
170 Sets hold button flag. |
|
171 */ |
|
172 void setHoldFlag(int callState) const; |
|
173 |
|
174 /*! |
|
175 \fn void setOutgoingFlag() |
|
176 |
|
177 Sets outgoing call button flag. |
|
178 */ |
|
179 void setOutgoingFlag(QList<int> callStates) const; |
|
180 |
|
181 /*! |
|
182 \fn void setConferenceFlag() |
|
183 |
|
184 Sets conference call button flag. (Flag will be true when call |
|
185 state list contains held/active conference). |
|
186 */ |
|
187 void setConferenceFlag(QList<int> callStates) const; |
|
188 |
|
189 /*! |
|
190 \fn void setMulticallFlag() |
|
191 |
|
192 Sets multi call button flag. (Flag will be set as true when active |
|
193 and held calls exists). |
|
194 */ |
|
195 void setMultiCallFlag(QList<int> callStates) const; |
|
196 |
|
197 /*! |
|
198 \fn void mapToExtensionToolBarItems() |
|
199 |
|
200 Maps phone action tool bar item list to ui command extension |
|
201 tool bar item list. |
|
202 */ |
|
203 void mapToExtensionToolBarItems( |
|
204 const QList<PhoneAction::ToolBarItem> &sourceList, |
|
205 QList<XQTelUiCommandExtension::ToolBarCommand> &toolBarCmdList) const; |
|
206 |
|
207 /*! |
|
208 \fn void mapToPhoneActionToolBarItems() |
|
209 |
|
210 Maps ui command extension tool bar item list to phone action |
|
211 tool bar item list. |
|
212 */ |
|
213 void mapToPhoneActionToolBarItems( |
|
214 const QList<XQTelUiCommandExtension::ToolBarCommand> &sourceList, |
|
215 QList<PhoneAction::ToolBarItem> &commandList) const; |
|
216 |
|
217 /*! |
|
218 \fn void buttonCommandList() |
|
219 |
|
220 Returns push button command list. |
|
221 */ |
|
222 QList<int> buttonCommandList(int callState, |
|
223 bool emergencyCall, |
|
224 QList<int> callStates) const; |
|
225 |
|
226 /*! |
|
227 \fn void buttonCommandList() |
|
228 |
|
229 Maps push button command to phone action. |
|
230 */ |
|
231 PhoneAction *mapCommandToAction(int command, |
|
232 bool disabled=false) const; |
|
233 |
|
234 |
|
235 |
|
236 private: |
|
237 |
|
238 PhoneUIQtViewIF &m_view; |
|
239 QList<HbAction *> m_customMenuActions; |
|
240 QList<PhoneCommandExtensionWrapper *> m_commandExtensions; |
|
241 PhoneCommandExtensionWrapper *m_lastCommandExtension; |
|
242 |
|
243 }; |
|
244 |
|
245 #endif // PHONEUICOMMANDCONTROLLER_H |