|
1 /* |
|
2 * Copyright (c) 2002-2005 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: drop-down list control |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <aknlayoutscalable_apps.cdl.h> |
|
20 #include <peninputgeneralitutnew.rsg> |
|
21 #include <peninputitutconfig_chinese.rsg> |
|
22 #include <skinlayout.cdl.h> |
|
23 #include <AknsDrawUtils.h> |
|
24 #include <AknsUtils.h> |
|
25 #include <AknUtils.h> |
|
26 #include <peninputrawkeybutton.h> |
|
27 #include <peninputrepeatbutton.h> |
|
28 #include <peninputcommonbutton.h> |
|
29 #include "peninputrepeatbuttonex.h" |
|
30 #include <AknFepGlobalEnums.h> |
|
31 #include <aknfeppeninputenums.h> |
|
32 #include <peninputdropdownlist.h> |
|
33 #include <peninputlayoutchoicelist.h> |
|
34 #include <peninputscrollablelist.h> |
|
35 #include <s32mem.h> |
|
36 #include <peninputlabel.h> |
|
37 #include <peninputlayoutinputmodechoice.h> |
|
38 #include <peninputlayoutbubblectrl.h> |
|
39 #include <peninputlayoutchoicelist.h> |
|
40 |
|
41 #include "peninputgenericitutwindowmanager.h" |
|
42 #include "peninputgenericitutwindow.h" |
|
43 #include "peninputgenericitutdatamgr.h" |
|
44 #include "peninputgenericitutuimgrbase.h" |
|
45 #include "peninputgenericitutuistatebase.h" |
|
46 #include "peninputgenericitutconverter.h" |
|
47 |
|
48 const TInt KPeriodicTimerIntervalSec(2500000); |
|
49 /* Teleca change end, 18.05.2009 ssal */ |
|
50 CGenericItutWindowManager* CGenericItutWindowManager::NewL(CGenericItutUiLayout* aLayoutOwner, |
|
51 CGenericItutDataMgr* aDataMgr) |
|
52 { |
|
53 CGenericItutWindowManager* layout = new (ELeave) |
|
54 CGenericItutWindowManager(aLayoutOwner,aDataMgr); |
|
55 CleanupStack::PushL(layout); |
|
56 layout->ConstructL(); |
|
57 CleanupStack::Pop(layout); |
|
58 return layout; |
|
59 } |
|
60 |
|
61 CGenericItutWindowManager::CGenericItutWindowManager(CGenericItutUiLayout* aLayoutOwner, |
|
62 CGenericItutDataMgr* aDataMgr) |
|
63 :iLayoutOwner(aLayoutOwner), |
|
64 iDataMgr(aDataMgr), |
|
65 iLastRawKeyDown(EStdKeyNull) |
|
66 |
|
67 { |
|
68 iInEditWordQueryDlg = EFalse; |
|
69 } |
|
70 |
|
71 CGenericItutWindowManager::~CGenericItutWindowManager() |
|
72 { |
|
73 delete iWindow; |
|
74 /* Teleca change begin, 18.05.2009 ssal */ |
|
75 if (iInfoTimer) |
|
76 { |
|
77 iInfoTimer->Cancel(); |
|
78 } |
|
79 delete iInfoTimer; |
|
80 /* Teleca change end, 18.05.2009 ssal */ |
|
81 } |
|
82 |
|
83 void CGenericItutWindowManager::SetPropertyL(MItutPropertySubscriber::TItutProperty aPropertyName, |
|
84 const TDesC& aPropertyValue) |
|
85 { |
|
86 iWindow->SetPropertyL(aPropertyName, aPropertyValue); |
|
87 |
|
88 } |
|
89 |
|
90 void CGenericItutWindowManager::ConstructL() |
|
91 { |
|
92 iWindow = CGenericItutWindow::NewL(this, iLayoutOwner,iDataMgr); |
|
93 /* Teleca change begin, 18.05.2009 ssal */ |
|
94 iInfoTimer = CPeriodic::NewL(CActive::EPriorityStandard); |
|
95 /* Teleca change end, 18.05.2009 ssal */ |
|
96 } |
|
97 |
|
98 void CGenericItutWindowManager::SimulateRawEvent(TInt aScanCode, TRawEvent::TType aType) |
|
99 { |
|
100 iLayoutOwner->SimulateRawEvent(aScanCode, aType); |
|
101 } |
|
102 |
|
103 // --------------------------------------------------------------------------- |
|
104 // Simulate raw event to window server immediately. |
|
105 // simulating raw event command won't be scheduled by AO |
|
106 // because it won't be added into CPeninputAnimObj::iAnimCmd. |
|
107 // --------------------------------------------------------------------------- |
|
108 // |
|
109 void CGenericItutWindowManager::SimulateImmeRawEvent( TInt aScanCode, TRawEvent::TType aType ) |
|
110 { |
|
111 iLayoutOwner->SimulateImmeRawEvent(aScanCode, aType ); |
|
112 } |
|
113 |
|
114 void CGenericItutWindowManager::ShowInputModeSwitchL() |
|
115 { |
|
116 iWindow->DisplayInputmodeSwitchL(); |
|
117 } |
|
118 |
|
119 void CGenericItutWindowManager::HandleCtrlEventL(TInt aEventType, |
|
120 CFepUiBaseCtrl* aCtrl, |
|
121 const TDesC& aEventData) |
|
122 { |
|
123 switch(aEventType) |
|
124 { |
|
125 case EEventRawKeyDownEvent: |
|
126 { |
|
127 const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr()); |
|
128 SimulateRawEvent(key->iScanCode,TRawEvent::EKeyDown); |
|
129 SetLastRawKeyDown(key->iScanCode, ETrue, aCtrl); |
|
130 } |
|
131 break; |
|
132 case EEventRawKeyUpEvent: |
|
133 { |
|
134 const TKeyEvent *key = reinterpret_cast<const TKeyEvent*>(aEventData.Ptr()); |
|
135 SimulateRawEvent(key->iScanCode,TRawEvent::EKeyUp); |
|
136 SetLastRawKeyDown(key->iScanCode, EFalse, aCtrl); |
|
137 } |
|
138 break; |
|
139 case EItutCmdEnterSpellMode: |
|
140 { |
|
141 iLayoutOwner->SignalOwner(ESignalEnterSpellMode); |
|
142 } |
|
143 break; |
|
144 case EEventButtonUp: |
|
145 { |
|
146 //from pen input switch button |
|
147 if (aCtrl->ControlId() == ECtrlIdSwitch) |
|
148 { |
|
149 TRAP_IGNORE( iWindow->Icf()->UpdateSecretTextL() ); |
|
150 ShowInputModeSwitchL(); |
|
151 } |
|
152 else if (aCtrl->ControlId() == ECtrlIdArrowUp) |
|
153 { |
|
154 TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL( |
|
155 CFepLayoutMultiLineIcf::EArrowUp)); |
|
156 } |
|
157 else if (aCtrl->ControlId() == ECtrlIdArrowDown) |
|
158 { |
|
159 TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL( |
|
160 CFepLayoutMultiLineIcf::EArrowDown)); |
|
161 } |
|
162 else if (aCtrl->ControlId() == ECtrlIdClose) |
|
163 { |
|
164 iLayoutOwner->SignalOwner(ESignalLayoutClosed); |
|
165 } |
|
166 else if (aCtrl->ControlId() == ECtrlIdOptions) |
|
167 { |
|
168 iLayoutOwner->SignalOwner(ESignalLaunchOptionsMenu); |
|
169 // static_cast<CAknFepCtrlCommonButton*>(aCtrl)->SetDimmed(ETrue); |
|
170 } |
|
171 else if (aCtrl->ControlId() == ECtrlIdIndicator) |
|
172 { |
|
173 iLayoutOwner->SignalOwner(ESignalGetEditMenuData); |
|
174 } |
|
175 } |
|
176 break; |
|
177 case EItutCmdArrowUp: |
|
178 { |
|
179 if (aCtrl->ControlId() == ECtrlIdArrowUp) |
|
180 { |
|
181 TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL( |
|
182 CFepLayoutMultiLineIcf::EArrowUp)); |
|
183 } |
|
184 } |
|
185 break; |
|
186 case EItutCmdArrowDown: |
|
187 { |
|
188 if (aCtrl->ControlId() == ECtrlIdArrowDown) |
|
189 { |
|
190 TRAP_IGNORE(iWindow->Icf()->HandleArrowBtnEventL( |
|
191 CFepLayoutMultiLineIcf::EArrowDown)); |
|
192 } |
|
193 } |
|
194 break; |
|
195 case EEventChoiceSelected: |
|
196 { |
|
197 CFepLayoutChoiceList::SEvent* event = |
|
198 (CFepLayoutChoiceList::SEvent*)aEventData.Ptr(); |
|
199 |
|
200 if (aCtrl->ControlId() == ECtrlIdInputSwitch) |
|
201 { |
|
202 if (event->iIndex == -1) |
|
203 { |
|
204 iWindow->InputModeSwitch()->CloseWindow(); |
|
205 break; |
|
206 } |
|
207 |
|
208 if (EPluginInputModeItut != event->iCommand) |
|
209 { |
|
210 TBool switchByMode = ETrue; |
|
211 TInt mode = event->iCommand; |
|
212 |
|
213 TBuf<8> buf; |
|
214 buf.Append(reinterpret_cast<TText*>(&switchByMode), |
|
215 sizeof(TBool)/sizeof(TText)); |
|
216 buf.Append(reinterpret_cast<TText*>(&mode), |
|
217 sizeof(TInt)/sizeof(TText)); |
|
218 iLayoutOwner->SignalOwner(ESignalLayoutUIChanged,buf); |
|
219 } |
|
220 } |
|
221 else if (aCtrl->ControlId() == ECtrlIdMatchSelection) |
|
222 { |
|
223 if (event->iCommand == EItutCmdPredictItemSelected) |
|
224 ReportItemSelected(ESignalSelectMatchSelectionText, event->iIndex, ETrue); |
|
225 else if (event->iCommand == EItutCmdEnterSpellMode) |
|
226 iLayoutOwner->SignalOwner(ESignalEnterSpellMode); |
|
227 } |
|
228 else if (aCtrl->ControlId() == ECtrlIdEditorMenu) |
|
229 { |
|
230 if (event->iIndex == -1) |
|
231 { |
|
232 iWindow->EditorMenu()->CloseWindow(); |
|
233 break; |
|
234 } |
|
235 else |
|
236 { |
|
237 TInt command = event->iCommand; |
|
238 TBuf<8> buf; |
|
239 buf.Append(reinterpret_cast<TText*>(&command), sizeof(TInt)/sizeof(TText)); |
|
240 iLayoutOwner->SignalOwner(ESignalEditorMenuCommand,buf); |
|
241 } |
|
242 } |
|
243 } |
|
244 break; |
|
245 case EEventCapturePointer: |
|
246 { |
|
247 if (iRawKeyDown) |
|
248 { |
|
249 SimulateRawEvent(iLastRawKeyDown, TRawEvent::EKeyUp); |
|
250 iRawKeyCtrl->CancelPointerDownL(); |
|
251 SetLastRawKeyDown(iLastRawKeyDown, EFalse, NULL); |
|
252 } |
|
253 } |
|
254 break; |
|
255 default: |
|
256 break; |
|
257 }; |
|
258 } |
|
259 |
|
260 TInt CGenericItutWindowManager::OnAppEditorTextComing(const TFepInputContextFieldData& aData) |
|
261 { |
|
262 TRAPD(err, iWindow->Icf()->SetTextL(aData)); |
|
263 |
|
264 if (!iWindow->MatchSelection()->Hiden()) |
|
265 { |
|
266 iWindow->MatchSelection()->Draw(); |
|
267 } |
|
268 |
|
269 return err; |
|
270 } |
|
271 |
|
272 void CGenericItutWindowManager::SetPromptTextL(TUint8* aData) |
|
273 { |
|
274 iWindow->SetPromptTextL(aData); |
|
275 } |
|
276 |
|
277 TBool CGenericItutWindowManager::HandleCommandL(TInt aCmd, TUint8* aData) |
|
278 { |
|
279 TBool handle = EFalse; |
|
280 TInt* data = (TInt*) aData; |
|
281 switch (aCmd) |
|
282 { |
|
283 case ECmdPenInputIsSecretText: |
|
284 { |
|
285 iWindow->Icf()->SetTextIsSecret(*aData); |
|
286 iWindow->InputModeSwitch()->SetSecretEditor(*aData); |
|
287 } |
|
288 break; |
|
289 case ECmdPenInputIsNumberGrouping: |
|
290 { |
|
291 iWindow->Icf()->SetNumberGrouping(*aData); |
|
292 } |
|
293 break; |
|
294 case ECmdPenInputDimArrowKeys: |
|
295 { |
|
296 TBool IsDimArrowKeys = *aData; |
|
297 DimArrowKeys( IsDimArrowKeys ); |
|
298 } |
|
299 break; |
|
300 case ECmdPenInputFingerMatchIndicator: |
|
301 { |
|
302 UpdateIndicatorL(aData); |
|
303 handle = ETrue; |
|
304 } |
|
305 break; |
|
306 case ECmdPenInputSetPromptText: |
|
307 { |
|
308 SetPromptTextL(aData); |
|
309 handle = ETrue; |
|
310 } |
|
311 break; |
|
312 case ECmdPenInputSendEditMenuData: |
|
313 { |
|
314 // Show menu command list |
|
315 iWindow->ShowEditorMenuL(data); |
|
316 } |
|
317 break; |
|
318 case ECmdPenInputEnableSettingBtn: |
|
319 { |
|
320 CAknFepCtrlCommonButton * optionsbtn; |
|
321 TBool enable = *data; |
|
322 optionsbtn = static_cast<CAknFepCtrlCommonButton *>(iWindow->Control(ECtrlIdOptions)); |
|
323 if(optionsbtn && !enable) |
|
324 { |
|
325 optionsbtn->SetDimmed(ETrue); |
|
326 handle = ETrue; |
|
327 iDimOperationBtn = ETrue; |
|
328 } |
|
329 else if(optionsbtn && enable) |
|
330 { |
|
331 optionsbtn->SetDimmed(EFalse); |
|
332 handle = ETrue; |
|
333 iDimOperationBtn = EFalse; |
|
334 } |
|
335 break; |
|
336 } |
|
337 |
|
338 case ECmdPenInputEnableIndicatorButton: |
|
339 { |
|
340 if (*data) |
|
341 { |
|
342 static_cast<CAknFepCtrlCommonButton*>( |
|
343 Control(ECtrlIdIndicator))->SetDimmed(EFalse); |
|
344 } |
|
345 else |
|
346 { |
|
347 static_cast<CAknFepCtrlCommonButton*>( |
|
348 Control(ECtrlIdIndicator))->SetDimmed(ETrue); |
|
349 } |
|
350 } |
|
351 break; |
|
352 case ECmdPenInputSymbolOfHardKeyOne: |
|
353 { |
|
354 iWindow->SetHardKeyOneSymbol(aData); |
|
355 handle = ETrue; |
|
356 } |
|
357 break; |
|
358 case ECmdPenInputRotation: |
|
359 { |
|
360 if (iWindow->InputModeSwitch()) |
|
361 { |
|
362 iWindow->InputModeSwitch()->CloseWindow(); |
|
363 } |
|
364 |
|
365 if (iWindow->EditorMenu()) |
|
366 { |
|
367 iWindow->EditorMenu()->CloseWindow(); |
|
368 } |
|
369 } |
|
370 break; |
|
371 |
|
372 case ECmdPenInputInEditWordQueryDlg: |
|
373 { |
|
374 iInEditWordQueryDlg = *data; |
|
375 } |
|
376 break; |
|
377 default: |
|
378 break; |
|
379 |
|
380 }; |
|
381 return handle; |
|
382 } |
|
383 |
|
384 |
|
385 TInt CGenericItutWindowManager::SizeChanged(TBool aIcfOverlap) |
|
386 { |
|
387 return iWindow->SizeChanged(aIcfOverlap); |
|
388 } |
|
389 |
|
390 void CGenericItutWindowManager::SubmitText(const TDesC& aEventData) |
|
391 { |
|
392 iLayoutOwner->SignalOwner(ESignalKeyEvent, aEventData); |
|
393 } |
|
394 |
|
395 TInt CGenericItutWindowManager::OnSkinChange() |
|
396 { |
|
397 TRAPD(err, |
|
398 iWindow->ConstructSpellCtrlFromResourceL(); |
|
399 iWindow->ConstructItutKeypadFromResourceL(iWindow->ItutKeypad()->ResourceId()); |
|
400 iWindow->ConstructIcfFromResourceL()); |
|
401 |
|
402 iWindow->OnSkinChange(); |
|
403 return err; |
|
404 } |
|
405 |
|
406 void CGenericItutWindowManager::ShowArrowBtn(TInt aShowFlag) |
|
407 { |
|
408 iWindow->Control(ECtrlIdArrowLeft)->Hide(!(EBtnArrowLeft & aShowFlag)); |
|
409 iWindow->Control(ECtrlIdArrowRight)->Hide(!(EBtnArrowRight & aShowFlag)); |
|
410 iWindow->Control(ECtrlIdArrowUp)->Hide(!(EBtnArrowUp & aShowFlag)); |
|
411 iWindow->Control(ECtrlIdArrowDown)->Hide(!(EBtnArrowDown & aShowFlag)); |
|
412 } |
|
413 |
|
414 CFepUiLayout* CGenericItutWindowManager::UiLayout() |
|
415 { |
|
416 return iLayoutOwner; |
|
417 } |
|
418 |
|
419 void CGenericItutWindowManager::HandleAppInfoChangeL(const TDesC& aInfo) |
|
420 { |
|
421 CGenericItutUiLayout * itutLayoutOwner; |
|
422 itutLayoutOwner = static_cast<CGenericItutUiLayout *>(UiLayout()); |
|
423 if ( aInfo.Length() > 0 && |
|
424 itutLayoutOwner->UiMgr()->CurrentState() && |
|
425 itutLayoutOwner->UiMgr()->CurrentState()->StateType() != |
|
426 CGenericItutUiMgrBase::EStateSpelling && |
|
427 !iInEditWordQueryDlg) |
|
428 { |
|
429 iWindow->Icf()->ShowBubble(aInfo,iWindow->Icf()->MsgBubbleCtrl()->Rect()); |
|
430 } |
|
431 else |
|
432 { |
|
433 iWindow->Icf()->HideBubble(); |
|
434 } |
|
435 } |
|
436 |
|
437 /* Teleca change begin, 19.05.2009 ssal */ |
|
438 void CGenericItutWindowManager::DisplayWarningNote(const TDesC& aInfo) |
|
439 { |
|
440 if (!iInfoTimer->IsActive()) |
|
441 { |
|
442 iInfoTimer->Start(KPeriodicTimerIntervalSec, |
|
443 KPeriodicTimerIntervalSec, |
|
444 TCallBack(CGenericItutWindowManager::HideByteWarningBubble, this)); |
|
445 } |
|
446 iWindow->Icf()->ShowByteWarningBubble(aInfo); |
|
447 } |
|
448 /* Teleca change end, 19.05.2009 ssal */ |
|
449 void CGenericItutWindowManager::ApplyVariantLafDataL(TBool aResolutionChange) |
|
450 { |
|
451 iWindow->ApplyVariantLafDataL(aResolutionChange); |
|
452 } |
|
453 |
|
454 void CGenericItutWindowManager::CreateChineseSpecificCtrlsIfNeededL() |
|
455 { |
|
456 iWindow->CreateChineseSpecificCtrlsIfNeededL(); |
|
457 } |
|
458 |
|
459 void CGenericItutWindowManager::SetLanguageL(TInt aLanguage) |
|
460 { |
|
461 iWindow->Icf()->SetLanguageId(aLanguage); |
|
462 } |
|
463 |
|
464 void CGenericItutWindowManager::SetLastRawKeyDown(TInt aScanCode, TBool aKeyDown, |
|
465 CFepUiBaseCtrl* aCtrl) |
|
466 { |
|
467 !aKeyDown ? iLastRawKeyDown = EStdKeyNull : iLastRawKeyDown = aScanCode; |
|
468 iRawKeyDown = aKeyDown; |
|
469 iRawKeyCtrl = aCtrl; |
|
470 } |
|
471 |
|
472 void CGenericItutWindowManager::ResetIndicatorL(CFepUiBaseCtrl* aIndicator) |
|
473 { |
|
474 iWindow->SetIndicatorImageL(aIndicator, |
|
475 iDataMgr->IndicatorData().iIndicatorImgID, |
|
476 iDataMgr->IndicatorData().iIndicatorMaskID, |
|
477 iDataMgr->IndicatorData().iIndicatorTextImgID, |
|
478 iDataMgr->IndicatorData().iIndicatorTextMaskID); |
|
479 } |
|
480 |
|
481 void CGenericItutWindowManager::UpdateIndicatorL(TUint8* aData) |
|
482 { |
|
483 iWindow->UpdateIndicatorL(aData); |
|
484 } |
|
485 |
|
486 void CGenericItutWindowManager::ReportItemSelected(TInt aCmdId, TInt aIdx, TBool aCommit) |
|
487 { |
|
488 TBuf<8> buf; |
|
489 buf.Append(reinterpret_cast<TText*>(&aIdx), sizeof(TInt)/sizeof(TText)); |
|
490 buf.Append(reinterpret_cast<TText*>(&aCommit), sizeof(TBool)/sizeof(TText)); |
|
491 |
|
492 iLayoutOwner->SignalOwner(aCmdId, buf); |
|
493 } |
|
494 |
|
495 CFepUiBaseCtrl* CGenericItutWindowManager::Control(TInt aCtrlId) |
|
496 { |
|
497 return iWindow->Control(aCtrlId); |
|
498 } |
|
499 |
|
500 void CGenericItutWindowManager::OnActivate() |
|
501 { |
|
502 //static_cast<CAknFepCtrlCommonButton*>(Control(ECtrlIdOptions))->SetDimmed(EFalse); |
|
503 if (iDimOperationBtn) |
|
504 { |
|
505 static_cast<CAknFepCtrlCommonButton*>(Control(ECtrlIdOptions))->SetDimmed(ETrue); |
|
506 } |
|
507 else |
|
508 { |
|
509 static_cast<CAknFepCtrlCommonButton*>(Control(ECtrlIdOptions))->SetDimmed(EFalse); |
|
510 } |
|
511 } |
|
512 void CGenericItutWindowManager::DimArrowKeys( TBool aDimArrow ) |
|
513 { |
|
514 if (iDataMgr->IsChinese()) |
|
515 { |
|
516 CAknFepCtrlRawKeyButton * leftbtn; |
|
517 CAknFepCtrlRawKeyButton * rightbtn; |
|
518 CAknFepCtrlRawKeyButton * upbtn; |
|
519 CAknFepCtrlRawKeyButton * downbtn; |
|
520 leftbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowLeft)); |
|
521 rightbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowRight)); |
|
522 upbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowUp)); |
|
523 downbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowDown)); |
|
524 |
|
525 leftbtn->SetDimmed(aDimArrow); |
|
526 rightbtn->SetDimmed(aDimArrow); |
|
527 upbtn->SetDimmed(aDimArrow); |
|
528 downbtn->SetDimmed(aDimArrow); |
|
529 |
|
530 } |
|
531 else |
|
532 { |
|
533 CAknFepCtrlRawKeyButton * leftbtn; |
|
534 CAknFepCtrlRawKeyButton * rightbtn; |
|
535 leftbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowLeft)); |
|
536 rightbtn = static_cast<CAknFepCtrlRawKeyButton *>(iWindow->Control(ECtrlIdArrowRight)); |
|
537 |
|
538 leftbtn->SetDimmed(aDimArrow); |
|
539 rightbtn->SetDimmed(aDimArrow); |
|
540 } |
|
541 } |
|
542 |
|
543 void CGenericItutWindowManager::ShowBubble(TInt aShow) |
|
544 { |
|
545 CFepCtrlDropdownList* spell = |
|
546 static_cast<CFepCtrlDropdownList*>(iWindow->Control(ECtrlIdSpellCandsList)); |
|
547 CFepCtrlDropdownList* standard = |
|
548 static_cast<CFepCtrlDropdownList*>(iWindow->Control(ECtrlIdStdCandsList)); |
|
549 CFepCtrlDropdownList* punctuation = |
|
550 static_cast<CFepCtrlDropdownList*>(iWindow->Control(ECtrlIdPuncCandsList)); |
|
551 |
|
552 if (aShow > 0) |
|
553 { |
|
554 TRect outrect,innerrect; |
|
555 outrect = TItutDataConverter::AnyToRect(iDataMgr->RequestData(EPreviewBubbleRect)); |
|
556 innerrect = TItutDataConverter::AnyToRect(iDataMgr->RequestData(EPreviewBubbleInnerRect)); |
|
557 TAknTextLineLayout bubbleTextLayout = |
|
558 TItutDataConverter::AnyToTextLine(iDataMgr->RequestData(EPreviewBubbleTextlayout)); |
|
559 CFont* bubbleFont = TItutDataConverter::AnyToFont(iDataMgr->RequestData(EPreviewBubbleFont)); |
|
560 |
|
561 if( spell ) |
|
562 { |
|
563 spell->ShowBubble(ETrue); |
|
564 spell->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); |
|
565 |
|
566 spell->SetTextFormat(bubbleTextLayout); |
|
567 spell->SetBubbleTextFont(bubbleFont); |
|
568 spell->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf |
|
569 spell->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX, |
|
570 innerrect.iTl.iY - outrect.iTl.iY, |
|
571 outrect.iBr.iX - innerrect.iBr.iX, |
|
572 outrect.iBr.iY - innerrect.iBr.iY); |
|
573 } |
|
574 |
|
575 if( standard ) |
|
576 { |
|
577 standard->ShowBubble(ETrue); |
|
578 standard->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); |
|
579 |
|
580 standard->SetTextFormat(bubbleTextLayout); |
|
581 standard->SetBubbleTextFont(bubbleFont); |
|
582 standard->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf |
|
583 standard->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX, |
|
584 innerrect.iTl.iY - outrect.iTl.iY, |
|
585 outrect.iBr.iX - innerrect.iBr.iX, |
|
586 outrect.iBr.iY - innerrect.iBr.iY); |
|
587 } |
|
588 |
|
589 if ( punctuation ) |
|
590 { |
|
591 punctuation->ShowBubble(ETrue); |
|
592 punctuation->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); |
|
593 |
|
594 punctuation->SetTextFormat(bubbleTextLayout); |
|
595 punctuation->SetBubbleTextFont(bubbleFont); |
|
596 punctuation->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf |
|
597 punctuation->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX, |
|
598 innerrect.iTl.iY - outrect.iTl.iY, |
|
599 outrect.iBr.iX - innerrect.iBr.iX, |
|
600 outrect.iBr.iY - innerrect.iBr.iY); |
|
601 } |
|
602 } |
|
603 else |
|
604 { |
|
605 if( spell ) |
|
606 { |
|
607 spell->ShowBubble(EFalse); |
|
608 } |
|
609 if( standard ) |
|
610 { |
|
611 standard->ShowBubble(EFalse); |
|
612 } |
|
613 if ( punctuation ) |
|
614 { |
|
615 punctuation->ShowBubble(EFalse); |
|
616 } |
|
617 } |
|
618 } |
|
619 /* Teleca change begin, 18.05.2009 ssal */ |
|
620 TInt CGenericItutWindowManager::HideByteWarningBubble(TAny* aPointer) |
|
621 { |
|
622 CGenericItutWindowManager* manager = static_cast<CGenericItutWindowManager*>(aPointer); |
|
623 manager->HideByteWarningBubble(); |
|
624 return KErrNone; |
|
625 } |
|
626 |
|
627 void CGenericItutWindowManager::HideByteWarningBubble() |
|
628 { |
|
629 if (!iInfoTimer) |
|
630 { |
|
631 return; |
|
632 } |
|
633 |
|
634 if (iInfoTimer->IsActive()) |
|
635 { |
|
636 iInfoTimer->Cancel(); |
|
637 iWindow->Icf()->HideInfoBubble(); |
|
638 } |
|
639 } |
|
640 // End Of File |