42 #include "peninputfingerhwrarstoreconstants.h" |
42 #include "peninputfingerhwrarstoreconstants.h" |
43 #include "peninputfingerhwrarmultipagevkb.h" |
43 #include "peninputfingerhwrarmultipagevkb.h" |
44 #include "peninputfingerhwrarlayout.h" |
44 #include "peninputfingerhwrarlayout.h" |
45 #include "peninputfingerhwrardatastore.h" |
45 #include "peninputfingerhwrardatastore.h" |
46 #include "peninputfingerhwrarsymboltable.h" |
46 #include "peninputfingerhwrarsymboltable.h" |
|
47 #include "peninputfingerhwrarnumsymboltable.h" |
47 #include "peninputfingerhwrarindicator.h" |
48 #include "peninputfingerhwrarindicator.h" |
48 #include "peninputfingerhwrarwritingwnd.h" |
49 #include "peninputfingerhwrarwritingwnd.h" |
49 |
50 |
50 const TUint32 KDefaultTextColor = 0x000000; |
51 const TUint32 KDefaultTextColor = 0x000000; |
51 const TUint KDefaultFrameColor = 0x000000; |
52 const TUint KDefaultFrameColor = 0x000000; |
139 ReadWritingBoxInfoL( boxwndResId ); |
143 ReadWritingBoxInfoL( boxwndResId ); |
140 ReadBackgroundInfoL( bgImageResId ); |
144 ReadBackgroundInfoL( bgImageResId ); |
141 } |
145 } |
142 |
146 |
143 CleanupStack::PopAndDestroy(); // reader |
147 CleanupStack::PopAndDestroy(); // reader |
|
148 |
|
149 // read keypad image info |
|
150 if ( iNumSymbolTable ) |
|
151 { |
|
152 TSize keysize = iLafManager->VirtualSctpadCellSize().Size(); |
|
153 iNumSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_NUMPAD_IMAGE, keysize ); |
|
154 |
|
155 RArray<TRect> rects; |
|
156 CleanupClosePushL( rects ); |
|
157 iLafManager->GetVirtualKeyRects( rects ); |
|
158 LoadNumSymbolVirtualKeysL( R_FINGER_HWR_NUMPAD, rects ); |
|
159 CleanupStack::PopAndDestroy(); //rects |
|
160 } |
|
161 |
|
162 if ( iSymbolTable ) |
|
163 { |
|
164 TSize keysize = iLafManager->VirtualSctpadCellSize().Size(); |
|
165 iSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_SCTPAD_IMAGE, keysize ); |
|
166 |
|
167 RArray<TRect> rects; |
|
168 CleanupClosePushL( rects ); |
|
169 iLafManager->GetVirtualKeyRects( rects ); |
|
170 if(iLafManager->IsLandscape()) |
|
171 { |
|
172 LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_LANDSCAPE_SYMBOL_TABLE, rects); |
|
173 } |
|
174 else |
|
175 { |
|
176 LoadSymbolVirtualKeysL(R_ARABIC_FINGER_HWR_PORTRAIT_SYMBOL_TABLE, rects); |
|
177 } |
|
178 CleanupStack::PopAndDestroy(); //rects |
|
179 } |
144 |
180 |
145 if (!iFirstTimeConstruct) |
181 if (!iFirstTimeConstruct) |
146 { |
182 { |
147 Draw(); |
183 Draw(); |
148 } |
184 } |
189 iLafManager->CandidateUnitHeight(), |
225 iLafManager->CandidateUnitHeight(), |
190 iLafManager->CandidateUnitWidth(), |
226 iLafManager->CandidateUnitWidth(), |
191 iLafManager->CandidateLTPos(), |
227 iLafManager->CandidateLTPos(), |
192 3/*KCandidateCountPerRow*/, |
228 3/*KCandidateCountPerRow*/, |
193 2 ); |
229 2 ); |
194 iNumCandidateList->SizeChanged( iLafManager->CandidateUnitWidth(), |
|
195 iLafManager->CandidateUnitHeight(), |
|
196 iLafManager->CandidateUnitWidth(), |
|
197 iLafManager->CandidateLTPos(), |
|
198 3/*KCandidateCountPerRow*/, |
|
199 1 ); |
|
200 iContextField->SetTextMargin ( iLafManager->IcfLeftMargin(), |
230 iContextField->SetTextMargin ( iLafManager->IcfLeftMargin(), |
201 iLafManager->IcfRightMargin(), |
231 iLafManager->IcfRightMargin(), |
202 iLafManager->IcfTopMargin(), |
232 iLafManager->IcfTopMargin(), |
203 iLafManager->IcfBottomMargin() ); |
233 iLafManager->IcfBottomMargin() ); |
204 |
234 |
432 // |
462 // |
433 CFepCtrlDropdownList* CPeninputFingerHwrArWnd::CandidateList() |
463 CFepCtrlDropdownList* CPeninputFingerHwrArWnd::CandidateList() |
434 { |
464 { |
435 return iCandidateList; |
465 return iCandidateList; |
436 } |
466 } |
437 // --------------------------------------------------------------------------- |
|
438 // retrieve the number candicate list control. |
|
439 // --------------------------------------------------------------------------- |
|
440 // |
|
441 CFepCtrlDropdownList* CPeninputFingerHwrArWnd::NumCandidateList() |
|
442 { |
|
443 return iNumCandidateList; |
|
444 } |
|
445 |
467 |
446 // --------------------------------------------------------------------------- |
468 // --------------------------------------------------------------------------- |
447 // Open the candidate list |
469 // Open the candidate list |
448 // --------------------------------------------------------------------------- |
470 // --------------------------------------------------------------------------- |
449 // |
471 // |
450 void CPeninputFingerHwrArWnd::OpenCandidateList() |
472 void CPeninputFingerHwrArWnd::OpenCandidateList() |
451 { |
473 { |
452 CPeninputFingerHwrArLayout* hwrLayout = NULL; |
474 CPeninputFingerHwrArLayout* hwrLayout = NULL; |
453 hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() ); |
475 hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() ); |
454 CPeninputFingerHwrArDataStore& datastore = hwrLayout->DataStore(); |
476 CPeninputFingerHwrArDataStore& datastore = hwrLayout->DataStore(); |
455 |
477 |
456 const RPointerArray<HBufC>& candidates = datastore.Candidate(); |
478 const RPointerArray<HBufC>& candidates = datastore.Candidate(); |
457 |
479 |
458 if(candidates.Count() > 0) |
480 if(candidates.Count() > 0) |
459 { |
481 { |
460 CFepCtrlDropdownList::TListType unexpandable = CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble; |
482 CFepCtrlDropdownList::TListType unexpandable = CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble; |
461 |
483 |
462 if ( datastore.PrimaryRange() == ERangeNative ) |
484 iCandidateList->Hide( EFalse ); |
463 { |
485 TRAP_IGNORE(iCandidateList->SetCandidatesL( candidates, unexpandable )); |
464 iCandidateList->Hide( EFalse ); |
486 iCandidateList->SetHighlightCell( 0, datastore.Highlight() ); |
465 TRAP_IGNORE(iCandidateList->SetCandidatesL( candidates, unexpandable )); |
487 iArrowLeftBtn->Hide(ETrue); |
466 iCandidateList->SetHighlightCell( 0, datastore.Highlight() ); |
488 iArrowRightBtn->Hide(ETrue); |
467 } |
489 iSpaceBtn->Hide(ETrue); |
468 else |
490 iEnterBtn->Hide(ETrue); |
469 { |
491 } |
470 iNumCandidateList->Hide( EFalse ); |
|
471 TRAP_IGNORE(iNumCandidateList->SetCandidatesL( candidates, unexpandable )); |
|
472 iNumCandidateList->SetHighlightCell( 0, datastore.Highlight() ); |
|
473 } |
|
474 |
|
475 iArrowLeftBtn->Hide(ETrue); |
|
476 iArrowRightBtn->Hide(ETrue); |
|
477 iArrowUpBtn->Hide(ETrue); |
|
478 iArrowDownBtn->Hide(ETrue); |
|
479 } |
|
480 } |
492 } |
481 |
493 |
482 // --------------------------------------------------------------------------- |
494 // --------------------------------------------------------------------------- |
483 // Close the candidate list |
495 // Close the candidate list |
484 // --------------------------------------------------------------------------- |
496 // --------------------------------------------------------------------------- |
485 // |
497 // |
486 void CPeninputFingerHwrArWnd::CloseCandidateList() |
498 void CPeninputFingerHwrArWnd::CloseCandidateList() |
487 { |
499 { |
488 iCandidateList->ResetAndClear(CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble); |
500 iCandidateList->ResetAndClear(CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble); |
489 iNumCandidateList->ResetAndClear(CFepCtrlDropdownList::EListExpandableMultiRowWithoutIconWithBubble); |
|
490 // hide all the dropdown list in standby state |
501 // hide all the dropdown list in standby state |
491 iCandidateList->Hide( ETrue ); |
502 iCandidateList->Hide( ETrue ); |
492 iNumCandidateList->Hide( ETrue ); |
|
493 |
|
494 iArrowLeftBtn->Hide(EFalse); |
503 iArrowLeftBtn->Hide(EFalse); |
495 iArrowRightBtn->Hide(EFalse); |
504 iArrowRightBtn->Hide(EFalse); |
496 iArrowUpBtn->Hide(EFalse); |
505 iSpaceBtn->Hide(EFalse); |
497 iArrowDownBtn->Hide(EFalse); |
506 iEnterBtn->Hide(EFalse); |
498 } |
507 } |
499 |
508 |
500 // --------------------------------------------------------------------------- |
509 // --------------------------------------------------------------------------- |
501 // dim arrow buttons. |
510 // dim arrow buttons. |
502 // --------------------------------------------------------------------------- |
511 // --------------------------------------------------------------------------- |
503 // |
512 // |
504 void CPeninputFingerHwrArWnd::DimArrowKeys( TBool aDimArrow ) |
513 void CPeninputFingerHwrArWnd::DimArrowKeys( TBool aDimArrow ) |
505 { |
514 { |
506 iArrowLeftBtn->SetDimmed( aDimArrow ); |
515 iArrowLeftBtn->SetDimmed( aDimArrow ); |
507 iArrowRightBtn->SetDimmed( aDimArrow ); |
516 iArrowRightBtn->SetDimmed( aDimArrow ); |
508 iArrowUpBtn->SetDimmed( aDimArrow ); |
517 iSpaceBtn->SetDimmed( aDimArrow ); |
509 iArrowDownBtn->SetDimmed( aDimArrow ); |
518 iEnterBtn->SetDimmed( aDimArrow ); |
510 } |
519 } |
511 |
520 |
512 // --------------------------------------------------------------------------- |
521 // --------------------------------------------------------------------------- |
513 // c++ constructor |
522 // c++ constructor |
514 // --------------------------------------------------------------------------- |
523 // --------------------------------------------------------------------------- |
673 iCandidateList->Hide( ETrue ); |
682 iCandidateList->Hide( ETrue ); |
674 iCandidateList->SetDropdownListImgID( candiDrawInfo ); |
683 iCandidateList->SetDropdownListImgID( candiDrawInfo ); |
675 } |
684 } |
676 |
685 |
677 // --------------------------------------------------------------------------- |
686 // --------------------------------------------------------------------------- |
678 // create candidate lists. |
|
679 // --------------------------------------------------------------------------- |
|
680 // |
|
681 void CPeninputFingerHwrArWnd::CreateNumCandidateListL() |
|
682 { |
|
683 TDropdownListDrawInfo candiDrawInfo( |
|
684 KAknsIIDQsnFrFunctionButtonInactive, |
|
685 KAknsIIDQsnFrFunctionButtonNormal, |
|
686 KAknsIIDQsnFrFunctionButtonPressed, |
|
687 KAknsIIDQsnFrItutButtonCandiSideL, |
|
688 KAknsIIDQsnFrItutButtonCandiMiddle, |
|
689 KAknsIIDQsnFrItutButtonCandiSideR, |
|
690 KAknsIIDQsnFrItutButtonCandiPressedSideL, |
|
691 KAknsIIDQsnFrItutButtonCandiPressedMiddle, |
|
692 KAknsIIDQsnFrItutButtonCandiPressedSideR, |
|
693 TRgb( 194, 221, 242 ), |
|
694 ETrue ); |
|
695 |
|
696 TInt unitWidth = iLafManager->CandidateUnitWidth(); |
|
697 TInt unitHeight = iLafManager->CandidateUnitHeight(); |
|
698 TPoint ltPosition = iLafManager->CandidateLTPos(); |
|
699 const CFont *font = iLafManager->CandidateFont(); |
|
700 TInt horizontalMargin = iLafManager->CandidateHorizontalMargin(); |
|
701 TInt verticalMargin = iLafManager->CandidateVerticalMargin(); |
|
702 |
|
703 iNumCandidateList = CFepCtrlDropdownList::NewL(UiLayout(), |
|
704 EHwrCtrlIdNumCandidateList, |
|
705 R_FSHWR_CANDIDATE_DROP_DOWN_LIST, |
|
706 ltPosition, |
|
707 font , |
|
708 TSize(unitWidth,unitHeight), |
|
709 unitWidth, |
|
710 3,1, |
|
711 unitHeight, |
|
712 0, |
|
713 0, |
|
714 CFepCtrlDropdownList::ECandFromRToL, |
|
715 EFalse); |
|
716 AddControlL( iNumCandidateList ); |
|
717 iNumCandidateList->SetCellMargin( horizontalMargin, verticalMargin ); |
|
718 iNumCandidateList->SetFont( font ); |
|
719 |
|
720 // set the needed events |
|
721 iNumCandidateList->SetEventIdForCandidateSelected( EHwrEventCandidateSelected ); |
|
722 iNumCandidateList->AddEventObserver( UiLayout() ); |
|
723 |
|
724 // hide the candidate list |
|
725 iNumCandidateList->Hide( ETrue ); |
|
726 iNumCandidateList->SetDropdownListImgID( candiDrawInfo ); |
|
727 |
|
728 } |
|
729 // --------------------------------------------------------------------------- |
|
730 // create writing box. |
687 // create writing box. |
731 // --------------------------------------------------------------------------- |
688 // --------------------------------------------------------------------------- |
732 // |
689 // |
733 void CPeninputFingerHwrArWnd::CreateWritingBoxL() |
690 void CPeninputFingerHwrArWnd::CreateWritingBoxL() |
734 { |
691 { |
760 |
717 |
761 iArrowLeftBtn = CreateRepBtnL( EHwrCtrlIdArrowLeft, R_AKN_FEP_HWR_ARROWLEFT, |
718 iArrowLeftBtn = CreateRepBtnL( EHwrCtrlIdArrowLeft, R_AKN_FEP_HWR_ARROWLEFT, |
762 EHwrEventNavKeyClicked, EKeyLeftArrow ); |
719 EHwrEventNavKeyClicked, EKeyLeftArrow ); |
763 iArrowRightBtn = CreateRepBtnL( EHwrCtrlIdArrowRight, R_AKN_FEP_HWR_ARROWRIGHT, |
720 iArrowRightBtn = CreateRepBtnL( EHwrCtrlIdArrowRight, R_AKN_FEP_HWR_ARROWRIGHT, |
764 EHwrEventNavKeyClicked, EKeyRightArrow ); |
721 EHwrEventNavKeyClicked, EKeyRightArrow ); |
765 iArrowUpBtn = CreateRepBtnL( EHwrCtrlIdArrowUp, R_AKN_FEP_HWR_ARROWUP, |
722 iEnterBtn = CreateEventBtnL(EHwrCtrlIdBtnEnter,R_AKN_FEP_HWR_ENTER); |
766 EHwrEventNavKeyClicked, EKeyUpArrow ); |
723 iSpaceBtn = CreateEventBtnL(EHwrCtrlIdBtnSpace,R_AKN_FEP_HWR_SPACE); |
767 iArrowDownBtn = CreateRepBtnL( EHwrCtrlIdArrowDown, R_AKN_FEP_HWR_ARROWDOWN, |
724 // Create 3-pieces color icon for space button |
768 EHwrEventNavKeyClicked, EKeyDownArrow ); |
725 CPenInput3PiecesColorIcons* colorIcons = |
|
726 CPenInput3PiecesColorIcons::NewL( R_AKN_FEP_VKB_SPACE_ICON1, |
|
727 R_AKN_FEP_VKB_SPACE_ICON2, |
|
728 R_AKN_FEP_VKB_SPACE_ICON3 ); |
|
729 iSpaceBtn->Set3PiecesColorIcons( colorIcons ); |
769 iSymbolTableBtn = CreateEventBtnL( EHwrCtrlIdSymbolButton, R_AKN_FEP_HWR_SYMBOL_TABLE_BUTTON ); |
730 iSymbolTableBtn = CreateEventBtnL( EHwrCtrlIdSymbolButton, R_AKN_FEP_HWR_SYMBOL_TABLE_BUTTON ); |
770 } |
731 } |
771 |
732 |
772 // --------------------------------------------------------------------------- |
733 // --------------------------------------------------------------------------- |
773 // create virtual sct pad. |
734 // create virtual sct pad. |
782 AddControlL( iSymbolTable ); |
743 AddControlL( iSymbolTable ); |
783 iSymbolTable->AddEventObserver( UiLayout() ); |
744 iSymbolTable->AddEventObserver( UiLayout() ); |
784 } |
745 } |
785 |
746 |
786 // --------------------------------------------------------------------------- |
747 // --------------------------------------------------------------------------- |
|
748 // create virtual number mode sct pad. |
|
749 // --------------------------------------------------------------------------- |
|
750 // |
|
751 void CPeninputFingerHwrArWnd::CreateNumSymbolTableL() |
|
752 { |
|
753 iNumSymbolTable = CPeninputArabicFingerHwrNumSymbolTable::NewL(UiLayout(),EHwrCtrlIdNumSymbolTableVkbGroup); |
|
754 iNumSymbolTable->Hide(ETrue); |
|
755 iNumSymbolTable->SetResourceId(R_FINGERHWR_ARABIC_SYMBOLTABLE); |
|
756 iNumSymbolTable->ConstructFromResourceL(); |
|
757 AddControlL( iNumSymbolTable ); |
|
758 iNumSymbolTable->AddEventObserver( UiLayout() ); |
|
759 } |
|
760 |
|
761 // --------------------------------------------------------------------------- |
787 // EventButton creation helper. |
762 // EventButton creation helper. |
788 // --------------------------------------------------------------------------- |
763 // --------------------------------------------------------------------------- |
789 // |
764 // |
790 CAknFepCtrlEventButton* CPeninputFingerHwrArWnd::CreateEventBtnL( TInt aCtrlId, |
765 CAknFepCtrlEventButton* CPeninputFingerHwrArWnd::CreateEventBtnL( TInt aCtrlId, |
791 TInt32 aResId, TInt aEvent/*= 0xFFFF*/,TInt aUnicode/*=0*/ ) |
766 TInt32 aResId, TInt aEvent/*= 0xFFFF*/,TInt aUnicode/*=0*/ ) |
837 TInt fontid = txtlayout.FontId(); |
812 TInt fontid = txtlayout.FontId(); |
838 const CFont* font = AknLayoutUtils::FontFromId( fontid ); |
813 const CFont* font = AknLayoutUtils::FontFromId( fontid ); |
839 iSymbolTable->KeyPad()->SetFont( font ); |
814 iSymbolTable->KeyPad()->SetFont( font ); |
840 |
815 |
841 iSymbolTable->LoadVirtualKeypadKeyL(aResId,aCellRects); |
816 iSymbolTable->LoadVirtualKeypadKeyL(aResId,aCellRects); |
|
817 } |
|
818 |
|
819 // --------------------------------------------------------------------------- |
|
820 // load virtual number mode sct keys. |
|
821 // --------------------------------------------------------------------------- |
|
822 // |
|
823 void CPeninputFingerHwrArWnd::LoadNumSymbolVirtualKeysL( const TInt aResId, |
|
824 const RArray<TRect>& aCellRects ) |
|
825 { |
|
826 TAknTextLineLayout txtlayout = iLafManager->NumpadKeyTxtLayout(); |
|
827 iNumSymbolTable->KeyPad()->SetTextLineLayout( txtlayout ); |
|
828 |
|
829 TInt fontid = txtlayout.FontId(); |
|
830 const CFont* font = AknLayoutUtils::FontFromId( fontid ); |
|
831 iNumSymbolTable->KeyPad()->SetFont( font ); |
|
832 |
|
833 iNumSymbolTable->LoadVirtualKeypadKeyL(aResId,aCellRects); |
842 } |
834 } |
843 |
835 |
844 // --------------------------------------------------------------------------- |
836 // --------------------------------------------------------------------------- |
845 // relayout full ui, reset all controls position. |
837 // relayout full ui, reset all controls position. |
846 // --------------------------------------------------------------------------- |
838 // --------------------------------------------------------------------------- |
882 MoveIconButton( iOptionBtn, rect, pdx, pdy, ETrue ); |
874 MoveIconButton( iOptionBtn, rect, pdx, pdy, ETrue ); |
883 |
875 |
884 pdx = iLafManager->GetArrowPaddingSize().iWidth; |
876 pdx = iLafManager->GetArrowPaddingSize().iWidth; |
885 pdy = iLafManager->GetArrowPaddingSize().iHeight; |
877 pdy = iLafManager->GetArrowPaddingSize().iHeight; |
886 |
878 |
887 rect = iLafManager->CtrlRect( iArrowUpBtn->ControlId() ); |
|
888 MoveIconButton( iArrowUpBtn, rect, pdx, pdy, ETrue ); |
|
889 |
|
890 rect = iLafManager->CtrlRect( iArrowLeftBtn->ControlId() ); |
879 rect = iLafManager->CtrlRect( iArrowLeftBtn->ControlId() ); |
891 MoveIconButton( iArrowLeftBtn, rect, pdx, pdy, ETrue ); |
880 MoveIconButton( iArrowLeftBtn, rect, pdx, pdy, ETrue ); |
892 |
881 |
893 rect = iLafManager->CtrlRect( iArrowRightBtn->ControlId() ); |
882 rect = iLafManager->CtrlRect( iArrowRightBtn->ControlId() ); |
894 MoveIconButton( iArrowRightBtn, rect, pdx, pdy, ETrue ); |
883 MoveIconButton( iArrowRightBtn, rect, pdx, pdy, ETrue ); |
895 |
884 |
896 rect = iLafManager->CtrlRect( iArrowDownBtn->ControlId() ); |
885 rect = iLafManager->CtrlRect( iSpaceBtn->ControlId() ); |
897 MoveIconButton( iArrowDownBtn, rect, pdx, pdy, ETrue ); |
886 MoveIconButton( iSpaceBtn, rect, pdx, pdy, ETrue ); |
898 |
887 |
|
888 TRect pieceInnerRect = rect; |
|
889 pieceInnerRect.Shrink(pdx*2,pdy); |
|
890 |
|
891 // that's a not good algrithm in funciton AknPenInputDrawUtils::Draw3PiecesColorIcon for drawing 3Pieces icons |
|
892 // as when the outter rect's height was not equal to the inter rect's height, the target rects the left icons and right icons |
|
893 // would be bitblited onto are set to be Rect(0.0.0.0.0) [[which should not be that behavior]]. |
|
894 // Please theck the codes: AknPenInputDrawUtils::Draw3PiecesColorIcon: this function should be Updated. |
|
895 iSpaceBtn->SetDraw3PieceFrameInfo( |
|
896 TDraw3PiecesFrame(KAknsIIDQgnIndiInputSpaceL, |
|
897 KAknsIIDQgnIndiInputSpaceMiddle, |
|
898 KAknsIIDQgnIndiInputSpaceR, |
|
899 pieceInnerRect)); |
|
900 |
|
901 rect = iLafManager->CtrlRect( iEnterBtn->ControlId() ); |
|
902 MoveIconButton( iEnterBtn, rect, pdx, pdy, ETrue ); |
|
903 |
899 // load vkb key image |
904 // load vkb key image |
900 TSize keysize = iLafManager->VirtualSctpadCellSize().Size(); |
905 TSize keysize = iLafManager->VirtualSctpadCellSize().Size(); |
901 iSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_SCTPAD_IMAGE, keysize ); |
906 iSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_SCTPAD_IMAGE, keysize ); |
902 |
907 |
903 // get the key rect |
908 // get the key rect |
925 iSymbolTable->SetRect(rect); |
930 iSymbolTable->SetRect(rect); |
926 |
931 |
927 iSymbolTable->SizeChanged(iLafManager->GetVirtualKeyRect(), |
932 iSymbolTable->SizeChanged(iLafManager->GetVirtualKeyRect(), |
928 iLafManager->GetSymBtnArray(), rows, cols, |
933 iLafManager->GetSymBtnArray(), rows, cols, |
929 iLafManager->IsLandscape()); |
934 iLafManager->IsLandscape()); |
|
935 //number mode symbol table |
|
936 // load number mode vkb key image |
|
937 TSize numkeysize = iLafManager->VirtualSctpadCellSize().Size(); |
|
938 iNumSymbolTable->LoadVkbKeyImageL(R_FINGER_HWR_NUMPAD_IMAGE, numkeysize ); |
|
939 |
|
940 // get the key rect |
|
941 RArray<TRect> numrects; |
|
942 CleanupClosePushL( numrects ); |
|
943 iLafManager->GetNumVirtualKeyRects( numrects ); |
|
944 |
|
945 // load keys |
|
946 LoadNumSymbolVirtualKeysL(R_FINGER_HWR_NUMPAD, numrects); |
|
947 |
|
948 CleanupStack::PopAndDestroy();//rects |
|
949 |
|
950 //move virtual Sctpad |
|
951 TInt numpadrows = iLafManager->VirtualNumSctpadRowCount(); |
|
952 TInt numpadcols = iLafManager->VirtualNumSctpadColCount(); |
|
953 |
|
954 rect = iLafManager->CtrlRect(iNumSymbolTable->ControlId()); |
|
955 iNumSymbolTable->SetRect(rect); |
|
956 |
|
957 iNumSymbolTable->SizeChanged(iLafManager->GetVirtualNumKeyRect(), |
|
958 iLafManager->GetSymBtnArray(), numpadrows, numpadcols, |
|
959 iLafManager->IsLandscape()); |
930 } |
960 } |
931 |
961 |
932 |
962 |
933 // --------------------------------------------------------------------------- |
963 // --------------------------------------------------------------------------- |
934 // layout for chinese range standby. |
964 // layout for chinese range standby. |
936 // |
966 // |
937 void CPeninputFingerHwrArWnd::SwitchToStandbyView() |
967 void CPeninputFingerHwrArWnd::SwitchToStandbyView() |
938 { |
968 { |
939 // hide following controls |
969 // hide following controls |
940 iCandidateList->Hide( ETrue ); |
970 iCandidateList->Hide( ETrue ); |
941 iNumCandidateList->Hide( ETrue ); |
|
942 iSymbolTable->Hide( ETrue); |
971 iSymbolTable->Hide( ETrue); |
|
972 iNumSymbolTable->Hide(ETrue); |
943 |
973 |
944 // show following controls |
974 // show following controls |
945 iArrowLeftBtn->Hide( EFalse ); |
975 iArrowLeftBtn->Hide( EFalse ); |
946 iArrowRightBtn->Hide( EFalse ); |
976 iArrowRightBtn->Hide( EFalse ); |
947 iArrowUpBtn->Hide( EFalse ); |
977 iSpaceBtn->Hide( EFalse ); |
948 iArrowDownBtn->Hide( EFalse ); |
978 iEnterBtn->Hide( EFalse ); |
949 iOptionBtn->Hide( EFalse ); |
979 iOptionBtn->Hide( EFalse ); |
950 iSymbolTableBtn->SetHighlight( EFalse); |
980 iSymbolTableBtn->SetHighlight( EFalse); |
951 iContextField->SetReady(ETrue); |
981 iContextField->SetReady(ETrue); |
952 Draw(); |
982 Draw(); |
953 } |
983 } |
956 // layout for symbol range standby. |
986 // layout for symbol range standby. |
957 // --------------------------------------------------------------------------- |
987 // --------------------------------------------------------------------------- |
958 // |
988 // |
959 void CPeninputFingerHwrArWnd::SwitchToSymbolTableView() |
989 void CPeninputFingerHwrArWnd::SwitchToSymbolTableView() |
960 { |
990 { |
|
991 CPeninputFingerHwrArLayout* hwrLayout = NULL; |
|
992 hwrLayout = static_cast<CPeninputFingerHwrArLayout*>( UiLayout() ); |
|
993 CPeninputFingerHwrArDataStore& datastore = hwrLayout->DataStore(); |
|
994 TBool IsNumberOnly = datastore.IsNumberOnlyMode(); |
961 // show following controls |
995 // show following controls |
962 iWritingBox->Hide( EFalse ); |
996 iWritingBox->Hide( EFalse ); |
963 iSymbolTable->Hide( EFalse ); |
997 if(IsNumberOnly) |
|
998 { |
|
999 iSymbolTable->Hide( ETrue ); |
|
1000 iNumSymbolTable->Hide(EFalse); |
|
1001 } |
|
1002 else |
|
1003 { |
|
1004 iSymbolTable->Hide( EFalse ); |
|
1005 iNumSymbolTable->Hide(ETrue); |
|
1006 } |
964 iOptionBtn->Hide( EFalse ); |
1007 iOptionBtn->Hide( EFalse ); |
965 |
1008 |
966 // hide follwing controls |
1009 // hide follwing controls |
967 iCandidateList->Hide( ETrue ); |
1010 iCandidateList->Hide( ETrue ); |
968 iNumCandidateList->Hide( ETrue ); |
|
969 iArrowLeftBtn->Hide( ETrue ); |
1011 iArrowLeftBtn->Hide( ETrue ); |
970 iArrowRightBtn->Hide( ETrue ); |
1012 iArrowRightBtn->Hide( ETrue ); |
971 iArrowUpBtn->Hide( ETrue ); |
1013 iSpaceBtn->Hide( ETrue ); |
972 iArrowDownBtn->Hide( ETrue ); |
1014 iEnterBtn->Hide( ETrue ); |
973 |
1015 |
974 // set the symboltable button highlighted |
1016 // set the symboltable button highlighted |
975 iSymbolTableBtn->SetHighlight( ETrue ); |
1017 iSymbolTableBtn->SetHighlight( ETrue ); |
976 |
1018 |
977 // avoid overlap refresh problem after opening symbil table |
1019 // avoid overlap refresh problem after opening symbil table |
978 // so set this control to be not ready |
1020 // so set this control to be not ready |
979 iContextField->SetReady(EFalse); |
1021 iContextField->SetReady(EFalse); |
980 |
1022 |
981 iSymbolTable->OpenSymbolTable(); |
1023 if(IsNumberOnly) |
982 iSymbolTable->BringToTop(); |
1024 { |
|
1025 iNumSymbolTable->OpenSymbolTable(); |
|
1026 iNumSymbolTable->BringToTop(); |
|
1027 } |
|
1028 else |
|
1029 { |
|
1030 iSymbolTable->OpenSymbolTable(); |
|
1031 iSymbolTable->BringToTop(); |
|
1032 } |
983 } |
1033 } |
984 |
1034 |
985 |
1035 |
986 // --------------------------------------------------------------------------- |
1036 // --------------------------------------------------------------------------- |
987 // EventButton layout helper. Move button to specified rect. |
1037 // EventButton layout helper. Move button to specified rect. |
1254 // |
1304 // |
1255 void CPeninputFingerHwrArWnd::ShowBubble(TInt aShow) |
1305 void CPeninputFingerHwrArWnd::ShowBubble(TInt aShow) |
1256 { |
1306 { |
1257 if (aShow > 0) |
1307 if (aShow > 0) |
1258 { |
1308 { |
1259 TRect outrect,innerrect; |
1309 TRect outrect,innerrect; |
1260 iCandidateList->ShowBubble(ETrue); |
1310 iCandidateList->ShowBubble(ETrue); |
1261 |
1311 |
1262 // Set priview popup size |
1312 // Set priview popup size |
1263 iCandidateList->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); |
1313 iCandidateList->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); |
1264 |
1314 |
1265 outrect = iLafManager->PreviewBubbleRect(); |
1315 outrect = iLafManager->PreviewBubbleRect(); |
1266 innerrect = iLafManager->PreviewBubbleInnerRect(); |
1316 innerrect = iLafManager->PreviewBubbleInnerRect(); |
1267 iCandidateList->SetTextFormat(iLafManager->PreviewBubbleTextLayout()); |
1317 iCandidateList->SetTextFormat(iLafManager->PreviewBubbleTextLayout()); |
1268 iCandidateList->SetBubbleTextFont(iLafManager->PreviewBubbleFont()); |
1318 iCandidateList->SetBubbleTextFont(iLafManager->PreviewBubbleFont()); |
1269 iCandidateList->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf |
1319 iCandidateList->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf |
1270 iCandidateList->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX, |
1320 iCandidateList->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX, |
1271 innerrect.iTl.iY - outrect.iTl.iY, |
|
1272 outrect.iBr.iX - innerrect.iBr.iX, |
|
1273 outrect.iBr.iY - innerrect.iBr.iY); |
|
1274 |
|
1275 iNumCandidateList->ShowBubble(ETrue); |
|
1276 |
|
1277 // Set priview popup size |
|
1278 iNumCandidateList->SetBubbleBitmapParam(NULL,NULL,KAknsIIDQsnFrInputCharPreview); |
|
1279 iNumCandidateList->SetTextFormat(iLafManager->PreviewBubbleTextLayout()); |
|
1280 iNumCandidateList->SetBubbleTextFont(iLafManager->PreviewBubbleFont()); |
|
1281 iNumCandidateList->SetBubbleSize(TSize(outrect.Width(),outrect.Height())); // Read laf |
|
1282 iNumCandidateList->SetFrameDiff(innerrect.iTl.iX - outrect.iTl.iX, |
|
1283 innerrect.iTl.iY - outrect.iTl.iY, |
1321 innerrect.iTl.iY - outrect.iTl.iY, |
1284 outrect.iBr.iX - innerrect.iBr.iX, |
1322 outrect.iBr.iX - innerrect.iBr.iX, |
1285 outrect.iBr.iY - innerrect.iBr.iY); |
1323 outrect.iBr.iY - innerrect.iBr.iY); |
1286 |
1324 |
1287 } |
1325 } |
1288 else |
1326 else |
1289 { |
1327 { |
1290 iCandidateList->ShowBubble(EFalse); |
1328 iCandidateList->ShowBubble(EFalse); |
1291 iNumCandidateList->ShowBubble(EFalse); |
|
1292 } |
1329 } |
1293 } |
1330 } |
1294 |
1331 |
1295 // -------------------------------------------------------------------------- |
1332 // -------------------------------------------------------------------------- |
1296 // CPeninputHwrBxAbWnd::CalculateGuideLinePos |
1333 // CPeninputHwrBxAbWnd::CalculateGuideLinePos |
1365 if(iSymbolTable->IsPopup()) |
1402 if(iSymbolTable->IsPopup()) |
1366 { |
1403 { |
1367 iSymbolTable->CloseSymbolTable(); |
1404 iSymbolTable->CloseSymbolTable(); |
1368 iSymbolTable->BringToBack(); |
1405 iSymbolTable->BringToBack(); |
1369 SwitchToStandbyView(); |
1406 SwitchToStandbyView(); |
1370 } |
1407 } |
|
1408 else if(iNumSymbolTable->IsPopup()) |
|
1409 { |
|
1410 iNumSymbolTable->CloseSymbolTable(); |
|
1411 iNumSymbolTable->BringToBack(); |
|
1412 SwitchToStandbyView(); |
|
1413 } |
1371 } |
1414 } |
1372 |
1415 |
1373 // -------------------------------------------------------------------------- |
1416 // -------------------------------------------------------------------------- |
1374 // CPeninputFingerHwrArWnd::IsSymbolTableShowingUp |
1417 // CPeninputFingerHwrArWnd::IsSymbolTableShowingUp |
1375 // Check if the symbol table has been shown up |
1418 // Check if the symbol table has been shown up |
1376 // -------------------------------------------------------------------------- |
1419 // -------------------------------------------------------------------------- |
1377 // |
1420 // |
1378 TBool CPeninputFingerHwrArWnd::IsSymbolTableShowingUp() |
1421 TBool CPeninputFingerHwrArWnd::IsSymbolTableShowingUp() |
1379 { |
1422 { |
1380 return iSymbolTable->IsPopup(); |
1423 TBool ret = iSymbolTable->IsPopup() | iNumSymbolTable->IsPopup(); |
|
1424 return ret; |
1381 } |
1425 } |
1382 |
1426 |
1383 // -------------------------------------------------------------------------- |
1427 // -------------------------------------------------------------------------- |
1384 // CPeninputFingerHwrArWnd::IsCandidateShowup |
1428 // CPeninputFingerHwrArWnd::IsCandidateShowup |
1385 // Check if the candadiate list has been shown up |
1429 // Check if the candadiate list has been shown up |
1386 // -------------------------------------------------------------------------- |
1430 // -------------------------------------------------------------------------- |
1387 // |
1431 // |
1388 TBool CPeninputFingerHwrArWnd::IsCandidateShowup() |
1432 TBool CPeninputFingerHwrArWnd::IsCandidateShowup() |
1389 { |
1433 { |
1390 if(!iCandidateList->Hiden() || !iNumCandidateList->Hiden()) |
1434 if(!iCandidateList->Hiden()) |
1391 { |
1435 { |
1392 return ETrue; |
1436 return ETrue; |
1393 } |
1437 } |
1394 return EFalse; |
1438 return EFalse; |
1395 } |
1439 } |