diff -r 5a1685599b76 -r 8152b1f1763a fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepUiAvkonCtrlPinyinPopup.cpp --- a/fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepUiAvkonCtrlPinyinPopup.cpp Wed Sep 15 12:34:44 2010 +0300 +++ b/fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepUiAvkonCtrlPinyinPopup.cpp Wed Oct 13 14:55:58 2010 +0300 @@ -45,6 +45,8 @@ #include "data_caging_path_literals.hrh" +_LIT(KFepUiControlsBitmapFile, "aknfepuictrls.mbm"); + CAknFepUICtrlPinyinPopup* CAknFepUICtrlPinyinPopup::NewL(RWindow& aParent, CAknFepUiLayoutDataMgr* aLafDataMgr ) { CAknFepUICtrlPinyinPopup* self = new(ELeave) CAknFepUICtrlPinyinPopup( aLafDataMgr ); @@ -60,6 +62,10 @@ iPages.Reset(); delete iSpellingArray; delete iSpellingIndexArray; + delete iNaviArrowBitmapLeft; + delete iNaviArrowBitmapLeftMask; + delete iNaviArrowBitmapRight; + delete iNaviArrowBitmapRightMask; delete iBgContext; delete iKeystrokeArray; delete iInEffectKeystrokeArray; @@ -207,7 +213,7 @@ TAknWindowLineLayout layoutEntryItem = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData(ELayoutEntryItem)); TAknTextLineLayout entryTextLine = - CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EEEPTextLine)); + CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EEntryTextLayout)); TInt layoutLinePrevLeft = 0; TInt layoutLinePrevWidth = 0; @@ -219,7 +225,7 @@ layoutText.LayoutText(rectEntryItem,entryTextLine); TRect rectText = layoutText.TextRect(); - TInt rightLimit = rectText.iBr.iX; + TInt rightLimit = iIndiFepArrowRight.Rect().iTl.iX; // value is 3 for 176*208 resolution TInt distance = rectText.iTl.iX - rectEntryItem.iTl.iX + rectEntryItem.iBr.iX - rectText.iBr.iX; @@ -285,9 +291,9 @@ TInt spellingLeftNum = aCount - index > EMaxCandidates? EMaxCandidates:aCount - index; TAknWindowLineLayout layoutEntryItem = - CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EInputLayout )); + CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData(ELayoutEntryItem)); TAknTextLineLayout entryTextLine = - CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EInputTextLayout )); + CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EEntryTextLayout)); TInt layoutLinePrevLeft = 0; TInt layoutLinePrevWidth = 0; @@ -697,6 +703,19 @@ iRectOutlineFrameInput.DrawRect(gc); iRectInsideAreaInput.DrawRect(gc); } + + if((iVisibleCount >= 1) && (iPages.Count() > 1)) + { + if(iCurDisplayPage != 0) + { + iIndiFepArrowLeft.DrawImage(gc, iNaviArrowBitmapLeft, iNaviArrowBitmapLeftMask); + } + + if (iPages.Count() > iCurDisplayPage + 1) + { + iIndiFepArrowRight.DrawImage(gc, iNaviArrowBitmapRight, iNaviArrowBitmapRightMask); + } + } } TTypeUid::Ptr CAknFepUICtrlPinyinPopup::MopSupplyObject(TTypeUid aId) @@ -706,14 +725,16 @@ return CCoeControl::MopSupplyObject(aId); } -void CAknFepUICtrlPinyinPopup::ConstructL( RWindow& aParent ) +void CAknFepUICtrlPinyinPopup::ConstructL(RWindow& /*aParent*/) { - CreateWindowL( aParent ); + CreateWindowL(); + ConstructBitmapsL(); + RWindow& window = Window(); for(TInt i = 0; i < EMaxPhraseCandidate; i++) { CAknFepUICtrlInputPane* inputPane = - CAknFepUICtrlInputPane::NewL(aParent, CAknFepUICtrlInputPane::ELayoutPhrasePinyinPopupPane, iLafDataMgr); + CAknFepUICtrlInputPane::NewL(window, CAknFepUICtrlInputPane::ELayoutPhrasePinyinPopupPane, iLafDataMgr); inputPane->SetMopParent(this); CleanupStack::PushL(inputPane); // ownership is passed, unless allocation is unsuccessful, in which case we still have it on the stack @@ -745,6 +766,8 @@ iZhuyinSymbolsForChineseCharsDisped = new(ELeave)CDesCArrayFlat(1); SetNonFocusing(); + window.SetOrdinalPosition(0, ECoeWinPriorityFep); // right at the front + window.SetNonFading(ETrue); TRect outerRect = TRect(); TRect innerRect = TRect(); @@ -755,6 +778,40 @@ MakeVisible(EFalse); } +void CAknFepUICtrlPinyinPopup::ConstructBitmapsL() + { + MAknsSkinInstance* skin = AknsUtils::SkinInstance(); + + TFileName bmpFile; + bmpFile.Copy(_L("z:")); + bmpFile.Append(KDC_BITMAP_DIR); + bmpFile.Append(KFepUiControlsBitmapFile); + + AknsUtils::CreateColorIconL( skin, + KAknsIIDQgnIndiFepArrowLeft, + KAknsIIDQsnIconColors, + EAknsCIQsnIconColorsCG20, + iNaviArrowBitmapLeft, + iNaviArrowBitmapLeftMask, + bmpFile, + EMbmAknfepuictrlsQgn_indi_fep_arrow_left, + EMbmAknfepuictrlsQgn_indi_fep_arrow_left_mask, + AKN_LAF_COLOR( 0 ) + ); + + AknsUtils::CreateColorIconL( skin, + KAknsIIDQgnIndiFepArrowRight, + KAknsIIDQsnIconColors, + EAknsCIQsnIconColorsCG20, + iNaviArrowBitmapRight, + iNaviArrowBitmapRightMask, + bmpFile, + EMbmAknfepuictrlsQgn_indi_fep_arrow_right, + EMbmAknfepuictrlsQgn_indi_fep_arrow_right_mask, + AKN_LAF_COLOR( 0 ) + ); + } + CAknFepUICtrlPinyinPopup::CAknFepUICtrlPinyinPopup( CAknFepUiLayoutDataMgr* aLafDataMgr ) : iSelected(0), @@ -778,6 +835,16 @@ void CAknFepUICtrlPinyinPopup::LayoutRects() { + // left arrow + iIndiFepArrowLeft = + CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( EIndiFepArrowLeft )); + AknIconUtils::SetSize( iNaviArrowBitmapLeft, iIndiFepArrowLeft.Rect().Size()); + + // right arrow + iIndiFepArrowRight = + CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( EIndiFepArrowRight )); + AknIconUtils::SetSize( iNaviArrowBitmapRight, iIndiFepArrowRight.Rect().Size()); + // cover main pane iRectCoverMainPaneInput = CAknFepChineseUIDataConv::AnyToLayoutRect( iLafDataMgr->RequestData( ERectCoverMainPaneInput )); @@ -811,41 +878,30 @@ CAknFepUICtrlInputPane* inputPane = iInputPaneArray[aIndex]; TAknWindowLineLayout layoutEntryItem = - CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EInputLayout )); + CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData(ELayoutEntryItem)); TAknTextLineLayout layoutLineText = - CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData( EInputTextLayout )); + CAknFepChineseUIDataConv::AnyToTextLine( iLafDataMgr->RequestData(EEntryTextLayout)); TAknLayoutRect layoutRectEntryItem; - layoutRectEntryItem.LayoutRect( rect, layoutEntryItem ); + layoutRectEntryItem.LayoutRect(rect,layoutEntryItem); TRect rectEntryItem = layoutRectEntryItem.Rect(); TAknLayoutText layoutText; - layoutText.LayoutText( rectEntryItem, layoutLineText ); - - // Get text rect + layoutText.LayoutText(rectEntryItem,layoutLineText); TRect rectText = layoutText.TextRect(); - TInt minWidth = rectText.Width(); // value is 3 for 176*208 resolution TInt distance = rectText.iTl.iX - rectEntryItem.iTl.iX + rectEntryItem.iBr.iX - rectText.iBr.iX; - if ( aIndex > 0 ) + if( aIndex > 0) { CAknFepUICtrlInputPane* inputPanePrev = iInputPaneArray[aIndex - 1]; rectText.iTl.iX = inputPanePrev->Rect().iBr.iX; } - - TInt width = inputPane->LabelTextWidthInPixels(); - // Only there has text that need the distance. - if ( width > 0 ) - { - width = width > minWidth ? width : minWidth; - width += distance; - } - rectText.SetWidth( width ); - rectText.SetHeight( rect.Height()); + rectText.SetWidth(inputPane->LabelTextWidthInPixels() + distance); + rectText.SetHeight(rect.Height()); - inputPane->SetRect( rectText ); - inputPane->SetHighlighted( aIndex == iSelected ); + inputPane->SetRect(rectText); + inputPane->SetHighlighted(aIndex == iSelected); } void CAknFepUICtrlPinyinPopup::SetInputPaneVisibility() @@ -889,7 +945,7 @@ void CAknFepUICtrlPinyinPopup::CalculateFrameRects(TRect& aOuterRect, TRect& aInnerRect) const { TRect windowRect = - CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectEEP )); + CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectEntry )); TInt rectHeight = windowRect.iBr.iY - windowRect.iTl.iY; TInt rectWidth = windowRect.Width(); windowRect.iTl.iX = 0;