103 PhoneUIQtButtonsController* buttonsController = |
103 PhoneUIQtButtonsController* buttonsController = |
104 m_resourceAdapter->buttonsController (); |
104 m_resourceAdapter->buttonsController (); |
105 |
105 |
106 |
106 |
107 QMap<PhoneAction::ActionType, PhoneAction *> map; |
107 QMap<PhoneAction::ActionType, PhoneAction *> map; |
108 map = m_resourceAdapter->convert (R_PHONEUI_INCOMING_CALL_BUTTONS); |
|
109 QCOMPARE (map.size (), 2); |
|
110 PhoneAction *action = map [PhoneAction::LeftButton]; |
108 PhoneAction *action = map [PhoneAction::LeftButton]; |
111 QCOMPARE (action->text (), QString ("Answer")); |
109 |
112 QCOMPARE (action->icon (), HbIcon(":/pri_large_button_answer.svg")); |
|
113 QCOMPARE (action->command (), (int)EPhoneCallComingCmdAnswer); |
|
114 action = map [PhoneAction::RightButton]; |
|
115 QCOMPARE (action->text (), QString ("Reject")); |
|
116 QCOMPARE (action->icon (), HbIcon(":/qtg_large_button_reject.svg")); |
|
117 QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); |
|
118 |
|
119 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_BUTTONS); |
|
120 QCOMPARE (map.size (), 2); |
|
121 action = map [PhoneAction::LeftButton]; |
|
122 QCOMPARE (action->text (), QString ("Hold")); |
|
123 QCOMPARE (action->icon (), HbIcon(":/qtg_large_button_hold.svg")); |
|
124 QCOMPARE (action->command (), (int)EPhoneInCallCmdHold); |
|
125 action = map [PhoneAction::RightButton]; |
|
126 QCOMPARE (action->text (), QString ("End call")); |
|
127 QCOMPARE (action->icon (), HbIcon(":/pri_large_button_endcall.svg")); |
|
128 QCOMPARE (action->command (), (int)EPhoneInCallCmdEndThisActiveCall); |
|
129 |
|
130 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_HELD_BUTTONS); |
|
131 QCOMPARE (map.size (), 2); |
|
132 action = map [PhoneAction::LeftButton]; |
|
133 QCOMPARE (action->text (), QString ("Unhold")); |
|
134 QCOMPARE (action->icon (), HbIcon(":/qtg_large_button_onhold.svg")); |
|
135 QCOMPARE (action->command (), (int)EPhoneInCallCmdUnhold); |
|
136 action = map [PhoneAction::RightButton]; |
|
137 QCOMPARE (action->text (), QString ("End call")); |
|
138 QCOMPARE (action->icon (), HbIcon(":/pri_large_button_endcall.svg")); |
|
139 QCOMPARE (action->command (), (int)EPhoneInCallCmdEndThisActiveCall); |
|
140 |
|
141 map = m_resourceAdapter->convert (R_PHONEUI_WAITING_CALL_BUTTONS); |
|
142 QCOMPARE (map.size (), 2); |
|
143 action = map [PhoneAction::LeftButton]; |
|
144 QCOMPARE (action->text (), QString ("Answer")); |
|
145 QCOMPARE (action->icon (), HbIcon(":/pri_large_button_answer.svg")); |
|
146 QCOMPARE (action->command (), (int)EPhoneCallComingCmdAnswer); |
|
147 action = map [PhoneAction::RightButton]; |
|
148 QCOMPARE (action->text (), QString ("Reject")); |
|
149 QCOMPARE (action->icon (), HbIcon(":/qtg_large_button_reject.svg")); |
|
150 QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); |
|
151 |
|
152 map = m_resourceAdapter->convert (R_PHONEUI_TWO_SINGLES_BUTTONS); |
|
153 QCOMPARE (map.size (), 2); |
|
154 action = map [PhoneAction::LeftButton]; |
|
155 QCOMPARE (action->text (), QString ("Swap")); |
|
156 QCOMPARE (action->icon (), HbIcon(":/qgn_indi_button_swap.svg")); |
|
157 QCOMPARE (action->command (), (int)EPhoneInCallCmdSwap); |
|
158 action = map [PhoneAction::RightButton]; |
|
159 QCOMPARE (action->text (), QString ("End call")); |
|
160 QCOMPARE (action->icon (), HbIcon(":/pri_large_button_endcall.svg")); |
|
161 QCOMPARE (action->command (), (int)EPhoneInCallCmdEndThisActiveCall); |
|
162 |
|
163 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA); |
110 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_CBA); |
164 QCOMPARE (map.size (), 2); |
111 QCOMPARE (map.size (), 2); |
165 action = map [PhoneAction::ToolbarButton1]; |
112 action = map [PhoneAction::ToolbarButton1]; |
166 QCOMPARE (action->icon (), HbIcon(":/qtg_large_comp_message.svg")); |
113 QCOMPARE (action->icon (), HbIcon("qtg_mono_send")); |
167 action = map [PhoneAction::ToolbarButton2]; |
114 action = map [PhoneAction::ToolbarButton2]; |
168 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_silence.svg")); |
115 QCOMPARE (action->icon (), HbIcon("qtg_mono_mute")); |
169 QCOMPARE (action->command (), (int)EPhoneCallComingCmdSilent); |
116 QCOMPARE (action->command (), (int)EPhoneCallComingCmdSilent); |
170 |
117 |
171 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA); |
118 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_REJECT_CBA); |
172 QCOMPARE (map.size (), 2); |
119 QCOMPARE (map.size (), 2); |
173 action = map [PhoneAction::ToolbarButton1]; |
120 action = map [PhoneAction::ToolbarButton1]; |
174 QCOMPARE (action->icon (), HbIcon(":/qtg_large_comp_message.svg")); |
121 QCOMPARE (action->icon (), HbIcon("qtg_mono_send")); |
175 action = map [PhoneAction::ToolbarButton2]; |
122 action = map [PhoneAction::ToolbarButton2]; |
176 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_silence.svg")); |
123 QCOMPARE (action->icon (), HbIcon("qtg_mono_reject_call")); |
177 //Command is disabled |
124 //Command is disabled |
178 //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); |
125 //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); |
179 |
126 |
180 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA); |
127 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCOMINGCALL_SOFT_REJECT_CBA); |
181 QCOMPARE (map.size (), 2); |
128 QCOMPARE (map.size (), 2); |
182 action = map [PhoneAction::ToolbarButton1]; |
129 action = map [PhoneAction::ToolbarButton1]; |
183 QCOMPARE (action->icon (), HbIcon(":/qtg_large_comp_message.svg")); |
130 QCOMPARE (action->icon (), HbIcon("qtg_mono_send")); |
184 action = map [PhoneAction::ToolbarButton2]; |
131 action = map [PhoneAction::ToolbarButton2]; |
185 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_silence.svg")); |
132 QCOMPARE (action->icon (), HbIcon("qtg_mono_mute")); |
186 //Command is disabled |
133 //Command is disabled |
187 //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); |
134 //QCOMPARE (action->command (), (int)EPhoneCallComingCmdReject); |
188 |
135 |
189 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_CALLWAITING_CBA); |
136 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_CALLWAITING_CBA); |
190 QCOMPARE (map.size (), 2); |
137 QCOMPARE (map.size (), 2); |
191 action = map [PhoneAction::ToolbarButton1]; |
138 action = map [PhoneAction::ToolbarButton1]; |
192 QCOMPARE (action->icon (), HbIcon(":/qtg_large_comp_message.svg")); |
139 QCOMPARE (action->icon (), HbIcon("qtg_mono_send")); |
193 action = map [PhoneAction::ToolbarButton2]; |
140 action = map [PhoneAction::ToolbarButton2]; |
194 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_join.svg")); |
141 QCOMPARE (action->icon (), HbIcon("qtg_mono_join_call")); |
195 QCOMPARE (action->command (), (int)EPhoneInCallCmdJoin); |
142 QCOMPARE (action->command (), (int)EPhoneInCallCmdJoin); |
196 |
143 |
197 testIncallToolbar( R_PHONEUI_DIALER_CBA ); |
144 testIncallToolbar( R_PHONEUI_DIALER_CBA ); |
198 testIncallToolbar( R_PHONEUI_INCALL_DIALER_CBA ); |
145 testIncallToolbar( R_PHONEUI_INCALL_DIALER_CBA ); |
199 testIncallToolbar( R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA ); |
146 testIncallToolbar( R_PHONEUI_CALLHANDLING_CALLSETUP_EMPTY_DTMFDIALER_CBA ); |
201 testIncallToolbar( R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA ); |
148 testIncallToolbar( R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA ); |
202 |
149 |
203 map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_INCOMING_CALL); |
150 map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_INCOMING_CALL); |
204 QCOMPARE (map.size (), 1); |
151 QCOMPARE (map.size (), 1); |
205 action = map [PhoneAction::Text]; |
152 action = map [PhoneAction::Text]; |
206 QCOMPARE (action->text (), QString ("calling")); |
153 QVERIFY( false == action->text().isEmpty() ); |
207 |
154 |
208 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_DISCONNECTED); |
155 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_DISCONNECTED); |
209 QCOMPARE (map.size (), 1); |
156 QCOMPARE (map.size (), 1); |
210 action = map [PhoneAction::Text]; |
157 action = map [PhoneAction::Text]; |
211 QCOMPARE (action->text (), QString ("disconnected")); |
158 QVERIFY( false == action->text().isEmpty() ); |
212 |
159 |
213 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_HELD); |
160 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_HELD); |
214 QCOMPARE (map.size (), 1); |
161 QCOMPARE (map.size (), 1); |
215 action = map [PhoneAction::Text]; |
162 action = map [PhoneAction::Text]; |
216 QCOMPARE (action->text (), QString ("on hold")); |
163 QVERIFY( false == action->text().isEmpty() ); |
217 |
164 |
218 map = m_resourceAdapter->convert (R_PHONEUI_MULTC_WAITING); |
165 map = m_resourceAdapter->convert (R_PHONEUI_MULTC_WAITING); |
219 QCOMPARE (map.size (), 1); |
166 QCOMPARE (map.size (), 1); |
220 action = map [PhoneAction::Text]; |
167 action = map [PhoneAction::Text]; |
221 QCOMPARE (action->text (), QString ("waiting")); |
168 QVERIFY( false == action->text().isEmpty() ); |
222 |
169 |
223 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_NUMBER, 3); |
170 map = m_resourceAdapter->convert (R_PHONEUI_INCALL_CALL_NUMBER, 3); |
224 QCOMPARE (map.size (), 1); |
171 QCOMPARE (map.size (), 1); |
225 action = map [PhoneAction::Text]; |
172 action = map [PhoneAction::Text]; |
226 QCOMPARE (action->text (), QString ("Call 3")); |
173 QVERIFY( false == action->text().isEmpty() ); |
227 |
174 |
228 map = m_resourceAdapter->convert (R_PHONEUI_CALL_SETUP_BUTTONS); |
175 map = m_resourceAdapter->convert (R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO); |
|
176 QCOMPARE (map.size (), 1); |
|
177 action = map [PhoneAction::Text]; |
|
178 QVERIFY( false == action->text().isEmpty() ); |
|
179 |
|
180 map = m_resourceAdapter->convert (R_PHONEUI_OUT_GOING_CALL); |
|
181 QCOMPARE (map.size (), 1); |
|
182 action = map [PhoneAction::Text]; |
|
183 QVERIFY( false == action->text().isEmpty() ); |
|
184 |
|
185 map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_CLI_WITHHELD); |
|
186 QCOMPARE (map.size (), 1); |
|
187 action = map [PhoneAction::Text]; |
|
188 QVERIFY( false == action->text().isEmpty() ); |
|
189 |
|
190 map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_CALL); |
|
191 QCOMPARE (map.size (), 1); |
|
192 action = map [PhoneAction::Text]; |
|
193 QVERIFY( false == action->text().isEmpty() ); |
|
194 |
|
195 map = m_resourceAdapter->convert (R_PHONEUI_EMERGENCY_CALL_HEADER); |
|
196 QCOMPARE (map.size (), 1); |
|
197 action = map [PhoneAction::Text]; |
|
198 QVERIFY( false == action->text().isEmpty() ); |
|
199 |
|
200 map = m_resourceAdapter->convert (R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT); |
|
201 QCOMPARE (map.size (), 1); |
|
202 action = map [PhoneAction::Text]; |
|
203 QVERIFY( false == action->text().isEmpty() ); |
|
204 |
|
205 map = m_resourceAdapter->convert (R_PHONEUI_EMERGENCY_CALL_BUTTONS); |
229 QCOMPARE (map.size (), 1); |
206 QCOMPARE (map.size (), 1); |
230 action = map [PhoneAction::LeftButton]; |
207 action = map [PhoneAction::LeftButton]; |
231 QCOMPARE (action->text (), QString ("End call")); |
208 QVERIFY( false == action->text().isEmpty() ); |
232 QCOMPARE (action->icon (), HbIcon(":/pri_large_button_endcall.svg")); |
209 QCOMPARE (action->icon (), HbIcon("qtg_mono_end_call")); |
233 QCOMPARE (action->command (), (int)EPhoneInCallCmdEndThisOutgoingCall); |
|
234 |
|
235 map = m_resourceAdapter->convert (R_PHONEUI_TIME_DURAT_LONG_WITH_ZERO); |
|
236 QCOMPARE (map.size (), 1); |
|
237 action = map [PhoneAction::Text]; |
|
238 QCOMPARE (action->text (), QString ("%:0%H%:1%T%:2%S%:3")); |
|
239 |
|
240 map = m_resourceAdapter->convert (R_PHONEUI_OUT_GOING_CALL); |
|
241 QCOMPARE (map.size (), 1); |
|
242 action = map [PhoneAction::Text]; |
|
243 QCOMPARE (action->text (), QString ("Calling")); |
|
244 |
|
245 map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_CLI_WITHHELD); |
|
246 QCOMPARE (map.size (), 1); |
|
247 action = map [PhoneAction::Text]; |
|
248 QCOMPARE (action->text (), QString ("Private number")); |
|
249 |
|
250 map = m_resourceAdapter->convert (R_PHONEUI_MTCAL_CALL); |
|
251 QCOMPARE (map.size (), 1); |
|
252 action = map [PhoneAction::Text]; |
|
253 QCOMPARE (action->text (), QString ("Call")); |
|
254 |
|
255 map = m_resourceAdapter->convert (R_PHONEUI_EMERGENCY_CALL_HEADER); |
|
256 QCOMPARE (map.size (), 1); |
|
257 action = map [PhoneAction::Text]; |
|
258 QCOMPARE (action->text (), QString ("Emergency call")); |
|
259 |
|
260 map = m_resourceAdapter->convert (R_PHONEUI_ATTEMPTING_EMERGENCY_CALL_TEXT); |
|
261 QCOMPARE (map.size (), 1); |
|
262 action = map [PhoneAction::Text]; |
|
263 QCOMPARE (action->text (), QString ("Attempting")); |
|
264 |
|
265 map = m_resourceAdapter->convert (R_PHONEUI_EMERGENCY_CALL_BUTTONS); |
|
266 QCOMPARE (map.size (), 1); |
|
267 action = map [PhoneAction::LeftButton]; |
|
268 QCOMPARE (action->text (), QString ("End call")); |
|
269 QCOMPARE (action->icon (), HbIcon(":/pri_large_button_endcall.svg")); |
|
270 QCOMPARE (action->command (), (int)EPhoneCmdEnd); |
210 QCOMPARE (action->command (), (int)EPhoneCmdEnd); |
271 |
211 |
272 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_EMERGENCY_CBA); |
212 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_EMERGENCY_CBA); |
273 QCOMPARE (map.size (), 2); |
213 QCOMPARE (map.size (), 2); |
274 action = map [PhoneAction::ToolbarButton1]; |
214 action = map [PhoneAction::ToolbarButton1]; |
275 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_dialler.svg")); |
215 QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer")); |
276 action = map [PhoneAction::ToolbarButton2]; |
216 action = map [PhoneAction::ToolbarButton2]; |
277 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_loudsp_unmute.svg")); |
217 QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker")); |
278 QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); |
218 QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); |
279 |
219 |
280 map = m_resourceAdapter->convert (R_PHONEUI_CONFERENCE_CALL); |
220 map = m_resourceAdapter->convert (R_PHONEUI_CONFERENCE_CALL); |
281 QCOMPARE (map.size (), 1); |
221 QCOMPARE (map.size (), 1); |
282 action = map [PhoneAction::Text]; |
222 action = map [PhoneAction::Text]; |
283 QCOMPARE (action->text (), QString ("Conference")); |
223 QVERIFY( false == action->text().isEmpty() ); |
284 |
224 |
285 TBuf<10> buffer(_L("123")); |
225 TBuf<10> buffer(_L("123")); |
286 map = m_resourceAdapter->convert (R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT, &buffer); |
226 map = m_resourceAdapter->convert (R_PHONEUI_SENDING_DTMF_WAIT_NOTE_TEXT, &buffer); |
287 QCOMPARE (map.size(), 1); |
227 QCOMPARE (map.size(), 1); |
288 action = map[PhoneAction::Text]; |
228 action = map[PhoneAction::Text]; |
289 QCOMPARE (action->text(), QString("Sending:\n123")); |
229 QVERIFY( false == action->text().isEmpty() ); |
290 |
230 |
291 map = m_resourceAdapter->convert(R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT, &buffer); |
231 map = m_resourceAdapter->convert(R_PHONEUI_DTMF_WAIT_CHARACTER_CONFIRMATION_QUERY_TEXT, &buffer); |
292 QCOMPARE(map.size(), 1); |
232 QCOMPARE(map.size(), 1); |
293 action = map[PhoneAction::Text]; |
233 action = map[PhoneAction::Text]; |
294 QCOMPARE(action->text(), QString("Send string:\n123")); |
234 QVERIFY( false == action->text().isEmpty() ); |
295 |
235 |
296 // TODO |
236 // TODO |
297 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA); |
237 map = m_resourceAdapter->convert (R_PHONEUI_CALLHANDLING_INCALL_HANDSET_CBA); |
298 |
238 |
299 map = m_resourceAdapter->convert (0); |
239 map = m_resourceAdapter->convert (0); |
303 void TestPhoneResourceAdapter::testConvertToString () |
243 void TestPhoneResourceAdapter::testConvertToString () |
304 { |
244 { |
305 m_resourceAdapter = PhoneResourceAdapter::Instance (this); |
245 m_resourceAdapter = PhoneResourceAdapter::Instance (this); |
306 |
246 |
307 QString testString = m_resourceAdapter->convertToString(R_PHONE_ERROR_CALL_NOT_ALLOWED); |
247 QString testString = m_resourceAdapter->convertToString(R_PHONE_ERROR_CALL_NOT_ALLOWED); |
308 QCOMPARE( testString, QString ("Call not allowed") ); |
248 QVERIFY( false == testString.isEmpty() ); |
309 |
249 |
310 QString testString2 = m_resourceAdapter->convertToString(R_ERROR_NOTE_NOT_ALLOWED); |
250 QString testString2 = m_resourceAdapter->convertToString(R_ERROR_NOTE_NOT_ALLOWED); |
311 QCOMPARE( testString2, QString ("Not allowed") ); |
251 QVERIFY( false == testString2.isEmpty() ); |
312 |
252 |
313 QString testString3 = m_resourceAdapter->convertToString(R_NOTETEXT_INVALID_PHONENUMBER); |
253 QString testString3 = m_resourceAdapter->convertToString(R_NOTETEXT_INVALID_PHONENUMBER); |
314 QCOMPARE( testString3, QString ("Invalid phone number") ); |
254 QVERIFY( false == testString3.isEmpty() ); |
315 |
255 |
316 QString testString4 = m_resourceAdapter->convertToString(R_NOTETEXT_NO_ANSWER); |
256 QString testString4 = m_resourceAdapter->convertToString(R_NOTETEXT_NO_ANSWER); |
317 QCOMPARE( testString4, QString ("No answer") ); |
257 QVERIFY( false == testString4.isEmpty() ); |
318 |
258 |
319 QString testString5 = m_resourceAdapter->convertToString(R_PHONE_ERROR_NUMBER_BUSY); |
259 QString testString5 = m_resourceAdapter->convertToString(R_PHONE_ERROR_NUMBER_BUSY); |
320 QCOMPARE( testString5, QString ("Number busy") ); |
260 QVERIFY( false == testString5.isEmpty() ); |
321 |
261 |
322 QString testString6 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_MOCAL_WAITING_TEXT); |
262 QString testString6 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_MOCAL_WAITING_TEXT); |
323 QCOMPARE( testString6, QString ("Waiting") ); |
263 QVERIFY( false == testString6.isEmpty() ); |
324 |
264 |
325 QString testString7 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT); |
265 QString testString7 = m_resourceAdapter->convertToString(R_PHONE_SS_NOTIFICATION_INCAL_INFO_HOLD_TEXT); |
326 QCOMPARE( testString7, QString ("On hold") ); |
266 QVERIFY( false == testString7.isEmpty() ); |
327 |
267 |
328 QString testString8 = m_resourceAdapter->convertToString(R_INCAL_INFO_HOLD_TEXT); |
268 QString testString8 = m_resourceAdapter->convertToString(R_INCAL_INFO_HOLD_TEXT); |
329 QCOMPARE( testString8, QString ("On hold") ); |
269 QVERIFY( false == testString8.isEmpty() ); |
330 |
270 |
331 QString testString9 = m_resourceAdapter->convertToString(R_INCAL_REMOTE_ACTIVE_TEXT); |
271 QString testString9 = m_resourceAdapter->convertToString(R_INCAL_REMOTE_ACTIVE_TEXT); |
332 QCOMPARE( testString9, QString ("Connected") ); |
272 QVERIFY( false == testString9.isEmpty() ); |
333 |
273 |
334 QString testString10 = m_resourceAdapter->convertToString(R_INCAL_INFO_CONF_HOLD_TEXT); |
274 QString testString10 = m_resourceAdapter->convertToString(R_INCAL_INFO_CONF_HOLD_TEXT); |
335 QCOMPARE( testString10, QString ("Conference on hold") ); |
275 QVERIFY( false == testString10.isEmpty() ); |
336 |
276 |
337 QString testString11 = m_resourceAdapter->convertToString(R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT); |
277 QString testString11 = m_resourceAdapter->convertToString(R_PHONE_INCALL_INFO_NO_NETWORK_SUPPORT); |
338 QCOMPARE( testString11, QString ("No network support for video call") ); |
278 QVERIFY( false == testString11.isEmpty() ); |
339 |
279 |
340 QString testString12 = m_resourceAdapter->convertToString(0); |
280 QString testString12 = m_resourceAdapter->convertToString(0); |
341 QCOMPARE( testString12, QString ("") ); |
281 QCOMPARE( testString12, QString ("") ); |
342 } |
282 } |
343 |
283 |
362 QCOMPARE (map.size (), 4); |
302 QCOMPARE (map.size (), 4); |
363 |
303 |
364 switch(id) { |
304 switch(id) { |
365 case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA: |
305 case R_PHONEUI_CALLHANDLING_INCALL_UNMUTE_CBA: |
366 action = map [PhoneAction::ToolbarButton1]; |
306 action = map [PhoneAction::ToolbarButton1]; |
367 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_dialler.svg")); |
307 QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer")); |
368 action = map [PhoneAction::ToolbarButton2]; |
308 action = map [PhoneAction::ToolbarButton2]; |
369 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_unmute.svg")); |
309 QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_unmute")); |
370 QCOMPARE (action->command (), (int)EPhoneInCallCmdUnmute); |
310 QCOMPARE (action->command (), (int)EPhoneInCallCmdUnmute); |
371 action = map [PhoneAction::ToolbarButton3]; |
311 action = map [PhoneAction::ToolbarButton3]; |
372 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_loudsp_unmute.svg")); |
312 QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker")); |
373 QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); |
313 QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); |
374 break; |
314 break; |
375 default: |
315 default: |
376 action = map [PhoneAction::ToolbarButton1]; |
316 action = map [PhoneAction::ToolbarButton1]; |
377 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_dialler.svg")); |
317 QCOMPARE (action->icon (), HbIcon("qtg_mono_dialer")); |
378 action = map [PhoneAction::ToolbarButton2]; |
318 action = map [PhoneAction::ToolbarButton2]; |
379 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_mute.svg")); |
319 QCOMPARE (action->icon (), HbIcon("qtg_mono_mic_mute")); |
380 QCOMPARE (action->command (), (int)EPhoneInCallCmdMute); |
320 QCOMPARE (action->command (), (int)EPhoneInCallCmdMute); |
381 action = map [PhoneAction::ToolbarButton3]; |
321 action = map [PhoneAction::ToolbarButton3]; |
382 QCOMPARE (action->icon (), HbIcon(":/qtg_large_tb_loudsp_unmute.svg")); |
322 QCOMPARE (action->icon (), HbIcon("qtg_mono_loudspeaker")); |
383 QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); |
323 QCOMPARE (action->command (), (int)EPhoneInCallCmdActivateIhf); |
384 break; |
324 break; |
385 } |
325 } |
386 } |
326 } |
387 |
327 |
395 { |
335 { |
396 m_resourceAdapter = PhoneResourceAdapter::Instance (this); |
336 m_resourceAdapter = PhoneResourceAdapter::Instance (this); |
397 |
337 |
398 QString testString = m_resourceAdapter->convertCommandToString( |
338 QString testString = m_resourceAdapter->convertCommandToString( |
399 EPhoneInCallCmdEndAllCalls); |
339 EPhoneInCallCmdEndAllCalls); |
400 QCOMPARE( testString, QString ("End all calls") ); |
340 QVERIFY( false == testString.isEmpty() ); |
401 |
341 |
402 testString = m_resourceAdapter->convertCommandToString( |
342 testString = m_resourceAdapter->convertCommandToString( |
403 EPhoneInCallCmdTransfer); |
343 EPhoneInCallCmdTransfer); |
404 QCOMPARE( testString, QString ("Transfer") ); |
344 QVERIFY( false == testString.isEmpty() ); |
405 |
345 |
406 testString = m_resourceAdapter->convertCommandToString( |
346 testString = m_resourceAdapter->convertCommandToString( |
407 EPhoneInCallCmdSwitchToVideo); |
347 EPhoneInCallCmdSwitchToVideo); |
408 QCOMPARE( testString, QString ("Call back with video call") ); |
348 QVERIFY( false == testString.isEmpty() ); |
409 |
349 |
410 testString = m_resourceAdapter->convertCommandToString( |
350 testString = m_resourceAdapter->convertCommandToString( |
411 EPhoneCmdHandoverToWlan); |
351 EPhoneCmdHandoverToWlan); |
412 QCOMPARE( testString, QString ("Handover to WLAN") ); |
352 QVERIFY( false == testString.isEmpty() ); |
413 |
353 |
414 testString = m_resourceAdapter->convertCommandToString( |
354 testString = m_resourceAdapter->convertCommandToString( |
415 EPhoneCmdHandoverToGsm); |
355 EPhoneCmdHandoverToGsm); |
416 QCOMPARE( testString, QString ("Handover to GSM") ); |
356 QVERIFY( false == testString.isEmpty() ); |
417 |
357 |
418 testString = m_resourceAdapter->convertCommandToString(0); |
358 testString = m_resourceAdapter->convertCommandToString(0); |
419 QCOMPARE( testString, QString ("") ); |
359 QCOMPARE( testString, QString ("") ); |
420 } |
360 } |
421 |
361 |