33 #include <AknBidiTextUtils.h> |
33 #include <AknBidiTextUtils.h> |
34 #include <skinlayout.cdl.h> |
34 #include <skinlayout.cdl.h> |
35 #include <layoutmetadata.cdl.h> |
35 #include <layoutmetadata.cdl.h> |
36 #include <aknlayoutscalable_avkon.cdl.h> |
36 #include <aknlayoutscalable_avkon.cdl.h> |
37 #include <aknphysics.h> |
37 #include <aknphysics.h> |
|
38 #include <akniconarray.h> |
|
39 #include <avkon.mbg> |
38 |
40 |
39 |
41 |
40 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
42 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
41 #include <aknlistloadertfx.h> |
43 #include <aknlistloadertfx.h> |
42 #include <aknlistboxtfxinternal.h> |
44 #include <aknlistboxtfxinternal.h> |
95 { |
97 { |
96 return aFirst.index - aSecond.index; |
98 return aFirst.index - aSecond.index; |
97 } |
99 } |
98 //End of Code Added for PhoneBook2 |
100 //End of Code Added for PhoneBook2 |
99 |
101 |
|
102 |
|
103 //Note: |
|
104 //**** |
|
105 //PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
106 //Define this Flag once Pbk2 decides to implement the MarkingMode changes that has been implemented for Avkon Lists |
|
107 |
100 /** |
108 /** |
101 * About animation usage: |
109 * About animation usage: |
102 * All animation usage is implemented in this class. Animation is eye candy and |
110 * All animation usage is implemented in this class. Animation is eye candy and |
103 * low priority when it comes to resources -> on resource failures animation |
111 * low priority when it comes to resources -> on resource failures animation |
104 * fails fast to release resources for more critical functionality. Also, no |
112 * fails fast to release resources for more critical functionality. Also, no |
159 TBool SyncAndDrawAnim( CBitmapContext& aGc, const TRect& aRect ); |
167 TBool SyncAndDrawAnim( CBitmapContext& aGc, const TRect& aRect ); |
160 MAknsControlContext* SkinBackgroundContext() const; |
168 MAknsControlContext* SkinBackgroundContext() const; |
161 void DeleteAnim(); |
169 void DeleteAnim(); |
162 void FocusGained(); |
170 void FocusGained(); |
163 void FocusLost(); |
171 void FocusLost(); |
|
172 void SkinChangedL(); |
164 void SkinChanged(); |
173 void SkinChanged(); |
165 void SetControl( CCoeControl* aControl ); |
174 void SetControl( CCoeControl* aControl ); |
166 |
175 |
167 // Implementation of MCoeForegroundObserver |
176 // Implementation of MCoeForegroundObserver |
168 void HandleGainingForeground(); |
177 void HandleGainingForeground(); |
184 |
193 |
185 TBool DrawPressedDownEffect( MAknsSkinInstance* aInstance, |
194 TBool DrawPressedDownEffect( MAknsSkinInstance* aInstance, |
186 CWindowGc& aGc, |
195 CWindowGc& aGc, |
187 const TRect& aOutRect, |
196 const TRect& aOutRect, |
188 const TRect& aInnerRect ) const; |
197 const TRect& aInnerRect ) const; |
|
198 |
|
199 void LoadMarkingIconsL(); |
|
200 |
189 public: //for handling column alignment |
201 public: //for handling column alignment |
190 struct TColumnExt |
202 struct TColumnExt |
191 { |
203 { |
192 TInt iColumn; // Must be first entry |
204 TInt iColumn; // Must be first entry |
193 TBool iLayoutAlign;//is layout alignment or Set by client |
205 TBool iLayoutAlign;//is layout alignment or Set by client |
370 delete iRowAndSubCellArray; |
389 delete iRowAndSubCellArray; |
371 delete iSLSubCellArray; |
390 delete iSLSubCellArray; |
372 delete iColorBmp; |
391 delete iColorBmp; |
373 delete iHiliBmp; |
392 delete iHiliBmp; |
374 delete iColumnExtArray; |
393 delete iColumnExtArray; |
|
394 if ( iMarkingIconArray ) |
|
395 { |
|
396 iMarkingIconArray->ResetAndDestroy(); |
|
397 } |
|
398 |
|
399 delete iMarkingIconArray; |
375 } |
400 } |
376 |
401 |
377 MAknsControlContext* CPbk2ContactViewCustomListBoxDataExtension::SkinBackgroundContext() const |
402 MAknsControlContext* CPbk2ContactViewCustomListBoxDataExtension::SkinBackgroundContext() const |
378 { |
403 { |
379 if ( iSkinEnabled ) |
404 if ( iSkinEnabled ) |
559 NoAnimIfError( iAnimation->Pause() ); |
584 NoAnimIfError( iAnimation->Pause() ); |
560 } |
585 } |
561 } |
586 } |
562 |
587 |
563 // ----------------------------------------------------------------------------- |
588 // ----------------------------------------------------------------------------- |
|
589 // CPbk2ContactViewCustomListBoxDataExtension::SkinChangedL |
|
590 // ----------------------------------------------------------------------------- |
|
591 // |
|
592 void CPbk2ContactViewCustomListBoxDataExtension::SkinChangedL() |
|
593 { |
|
594 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
595 DeleteAnim(); |
|
596 TryCreateAnimation(); |
|
597 CreateColorBitmapsL(); |
|
598 LoadMarkingIconsL(); |
|
599 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
600 } |
|
601 // ----------------------------------------------------------------------------- |
564 // CPbk2ContactViewCustomListBoxDataExtension::SkinChanged |
602 // CPbk2ContactViewCustomListBoxDataExtension::SkinChanged |
565 // ----------------------------------------------------------------------------- |
603 // ----------------------------------------------------------------------------- |
566 // |
604 // |
567 void CPbk2ContactViewCustomListBoxDataExtension::SkinChanged() |
605 void CPbk2ContactViewCustomListBoxDataExtension::SkinChanged() |
568 { |
606 { |
1140 aGc, |
1178 aGc, |
1141 aOutRect, |
1179 aOutRect, |
1142 aInnerRect, |
1180 aInnerRect, |
1143 KAknsIIDQsnFrListPressed, |
1181 KAknsIIDQsnFrListPressed, |
1144 KAknsIIDQsnFrListCenterPressed ); |
1182 KAknsIIDQsnFrListCenterPressed ); |
|
1183 } |
|
1184 |
|
1185 // ----------------------------------------------------------------------------- |
|
1186 // CPbk2ContactViewCustomListBoxDataExtension::LoadMarkingIconsL |
|
1187 // ----------------------------------------------------------------------------- |
|
1188 // |
|
1189 void CPbk2ContactViewCustomListBoxDataExtension::LoadMarkingIconsL() |
|
1190 { |
|
1191 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
1192 if ( !iMarkingIconArray ) |
|
1193 { |
|
1194 iMarkingIconArray = new ( ELeave ) CAknIconArray( 2 ); |
|
1195 } |
|
1196 else |
|
1197 { |
|
1198 iMarkingIconArray->ResetAndDestroy(); |
|
1199 } |
|
1200 |
|
1201 CGulIcon* icon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), |
|
1202 KAknsIIDQgnPropCheckboxOn, |
|
1203 AknIconUtils::AvkonIconFileName(), |
|
1204 EMbmAvkonQgn_prop_checkbox_on, |
|
1205 EMbmAvkonQgn_prop_checkbox_on_mask ); |
|
1206 |
|
1207 CleanupStack::PushL( icon ); |
|
1208 iMarkingIconArray->AppendL( icon ); |
|
1209 CleanupStack::Pop( icon ); |
|
1210 |
|
1211 icon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), |
|
1212 KAknsIIDQgnPropCheckboxOff, |
|
1213 AknIconUtils::AvkonIconFileName(), |
|
1214 EMbmAvkonQgn_prop_checkbox_off, |
|
1215 EMbmAvkonQgn_prop_checkbox_off_mask ); |
|
1216 |
|
1217 CleanupStack::PushL( icon ); |
|
1218 iMarkingIconArray->AppendL( icon ); |
|
1219 CleanupStack::Pop( icon ); |
|
1220 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
1145 } |
1221 } |
1146 |
1222 |
1147 CCoeControl *CPbk2ContactViewCustomListBoxData::Control() const |
1223 CCoeControl *CPbk2ContactViewCustomListBoxData::Control() const |
1148 { |
1224 { |
1149 return iExtension->iControl; |
1225 return iExtension->iControl; |
1948 const TRect& aRect, |
2024 const TRect& aRect, |
1949 TBool aHighlight, |
2025 TBool aHighlight, |
1950 const TColors& aColors, |
2026 const TColors& aColors, |
1951 TInt aItemIndex ) const |
2027 TInt aItemIndex ) const |
1952 { |
2028 { |
|
2029 |
|
2030 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2031 if ( listbox && !listbox->View()->ViewRect().Intersects( aRect ) ) |
|
2032 { |
|
2033 // outside of the clipping rect -> don't process this item |
|
2034 return; |
|
2035 } |
|
2036 |
1953 TInt lastColumn = Min( LastColumn(), KMaxColumn ); |
2037 TInt lastColumn = Min( LastColumn(), KMaxColumn ); |
1954 TInt column=0; |
2038 TInt column=0; |
1955 TPtrC text; |
2039 TPtrC text; |
1956 TPtrC tempText; |
2040 TPtrC tempText; |
1957 |
2041 |
1958 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
2042 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
|
2043 |
|
2044 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2045 TBool markingMode = EFalse; |
|
2046 TRect itemRect( aRect ); |
|
2047 |
|
2048 if ( listbox->View() && listbox->View()->ItemDrawer() ) |
|
2049 { |
|
2050 if ( listbox->View()->ItemDrawer()->Flags() |
|
2051 & CListItemDrawer::EMarkingModeEnabled |
|
2052 && iExtension->iMarkingIconArray |
|
2053 && iExtension->iMarkingIconArray->Count() == 2 ) |
|
2054 { |
|
2055 markingMode = ETrue; |
|
2056 itemRect.iTl.iX += |
|
2057 AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 0 ).LayoutLine().il; |
|
2058 } |
|
2059 } |
|
2060 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
1959 |
2061 |
1960 MAknsSkinInstance *skin = AknsUtils::SkinInstance(); |
2062 MAknsSkinInstance *skin = AknsUtils::SkinInstance(); |
1961 MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() ); |
2063 MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() ); |
1962 if (!cc) |
2064 if (!cc) |
1963 { |
2065 { |
1969 |
2071 |
1970 Mem::FillZ( &rectClipped[0], KMaxColumn * sizeof( TBool ) ); |
2072 Mem::FillZ( &rectClipped[0], KMaxColumn * sizeof( TBool ) ); |
1971 |
2073 |
1972 if ( iExtension->iSubCellsMightIntersect ) |
2074 if ( iExtension->iSubCellsMightIntersect ) |
1973 { |
2075 { |
|
2076 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2077 CheckIfSubCellsIntersectL( &textLines[0], &rectClipped[0], *aText, itemRect ); |
|
2078 } |
|
2079 #else |
1974 CheckIfSubCellsIntersectL( &textLines[0], &rectClipped[0], *aText, aRect ); |
2080 CheckIfSubCellsIntersectL( &textLines[0], &rectClipped[0], *aText, aRect ); |
1975 } |
2081 } |
1976 |
2082 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
1977 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
1978 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2083 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
1979 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
2084 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
1980 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2085 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
1981 |
2086 |
1982 if ( !listbox || !listbox->BackgroundDrawingSuppressed() ) |
2087 if ( !listbox || !listbox->BackgroundDrawingSuppressed() ) |
2012 if ( iExtension->iCurrentRow < list->BottomItemIndex() ) |
2117 if ( iExtension->iCurrentRow < list->BottomItemIndex() ) |
2013 { |
2118 { |
2014 AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin ); |
2119 AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin ); |
2015 } |
2120 } |
2016 DrawHighLight( aGc, aRect, aHighlight, skin ); |
2121 DrawHighLight( aGc, aRect, aHighlight, skin ); |
|
2122 |
|
2123 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2124 if ( markingMode && !aItemProperties.IsSelectionHidden() ) |
|
2125 { |
|
2126 TAknLayoutRect layoutRect; |
|
2127 layoutRect.LayoutRect( aRect, |
|
2128 AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) ); |
|
2129 |
|
2130 aGc.SetPenColor( aColors.iText ); |
|
2131 aGc.SetPenStyle( CGraphicsContext::ESolidPen ); |
|
2132 |
|
2133 CGulIcon* icon = (*iExtension->iMarkingIconArray)[1]; // unchecked |
|
2134 |
|
2135 if ( listbox->View()->ItemIsSelected( iExtension->iCurrentRow ) ) |
|
2136 { |
|
2137 icon = (*iExtension->iMarkingIconArray)[0]; |
|
2138 } |
|
2139 |
|
2140 CFbsBitmap* bitmap = icon->Bitmap(); |
|
2141 |
|
2142 if ( bitmap ) |
|
2143 { |
|
2144 TSize size( bitmap->SizeInPixels() ); // set size if not already |
|
2145 TSize targetSize( layoutRect.Rect().Size() ); |
|
2146 |
|
2147 if ( size.iWidth != targetSize.iWidth && size.iHeight != targetSize.iHeight ) |
|
2148 { |
|
2149 AknIconUtils::SetSize( bitmap, targetSize, |
|
2150 EAspectRatioPreservedAndUnusedSpaceRemoved ); |
|
2151 } |
|
2152 |
|
2153 aGc.BitBltMasked( layoutRect.Rect().iTl, bitmap, TRect( layoutRect.Rect().Size() ), icon->Mask(), EFalse ); |
|
2154 } |
|
2155 |
|
2156 } |
|
2157 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2017 |
2158 |
2018 // The column draw loop |
2159 // The column draw loop |
2019 column = 0; |
2160 column = 0; |
2020 TInt subCellIndex = 0; |
2161 TInt subCellIndex = 0; |
2021 // Whether need to redraw the PopupCharacter |
2162 // Whether need to redraw the PopupCharacter |
2127 default: break; |
2268 default: break; |
2128 }; |
2269 }; |
2129 } |
2270 } |
2130 |
2271 |
2131 TAknLayoutText textLayout; |
2272 TAknLayoutText textLayout; |
|
2273 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2274 textLayout.LayoutText( itemRect, textLineLayout, usedFont ); |
|
2275 TRect layoutedRect( itemRect); |
|
2276 #else |
2132 textLayout.LayoutText( aRect, textLineLayout, usedFont ); |
2277 textLayout.LayoutText( aRect, textLineLayout, usedFont ); |
2133 TRect layoutedRect( aRect ); |
2278 TRect layoutedRect( aRect ); |
|
2279 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2134 |
2280 |
2135 // *2 == leave some room for marquee |
2281 // *2 == leave some room for marquee |
2136 const TInt maxlen( KMaxColumnDataLength * 2 ); |
2282 const TInt maxlen( KMaxColumnDataLength * 2 ); |
2137 TBuf<maxlen> convBuf = text.Left(maxlen); |
2283 TBuf<maxlen> convBuf = text.Left(maxlen); |
2138 |
2284 |
2175 |
2321 |
2176 if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled ) |
2322 if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled ) |
2177 { |
2323 { |
2178 iExtension->iMarquee->UseLogicalToVisualConversion( bidiConv ); |
2324 iExtension->iMarquee->UseLogicalToVisualConversion( bidiConv ); |
2179 |
2325 |
|
2326 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2327 if ( iExtension->iMarquee->DrawText( aGc, itemRect, textLineLayout, convBuf, usedFont, textColor ) ) |
|
2328 #else |
2180 if ( iExtension->iMarquee->DrawText( aGc, aRect, textLineLayout, convBuf, usedFont, textColor ) ) |
2329 if ( iExtension->iMarquee->DrawText( aGc, aRect, textLineLayout, convBuf, usedFont, textColor ) ) |
|
2330 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2181 { |
2331 { |
2182 // all the loops have been executed |
2332 // all the loops have been executed |
2183 textLayout.DrawText( aGc, convBuf, bidiConv, textColor ); |
2333 textLayout.DrawText( aGc, convBuf, bidiConv, textColor ); |
2184 } |
2334 } |
2185 } |
2335 } |
2277 __ASSERT_DEBUG((index>=0 && index<IconArray()->Count()),Panic(EPanicColumnListInvalidBitmapIndexListBoxData)); |
2427 __ASSERT_DEBUG((index>=0 && index<IconArray()->Count()),Panic(EPanicColumnListInvalidBitmapIndexListBoxData)); |
2278 |
2428 |
2279 TAknWindowLineLayout graphicLayout = iExtension->AtSL(subCellIndex).iGraphicLayout; |
2429 TAknWindowLineLayout graphicLayout = iExtension->AtSL(subCellIndex).iGraphicLayout; |
2280 TAknLayoutRect graphicRect; |
2430 TAknLayoutRect graphicRect; |
2281 |
2431 |
|
2432 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2433 graphicRect.LayoutRect( itemRect,graphicLayout ); |
|
2434 #else |
2282 graphicRect.LayoutRect(aRect,graphicLayout); |
2435 graphicRect.LayoutRect(aRect,graphicLayout); |
|
2436 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2283 TSize graphicSize( graphicRect.Rect().Size() ); |
2437 TSize graphicSize( graphicRect.Rect().Size() ); |
2284 |
2438 |
2285 if (index>=0 && IconArray()) |
2439 if (index>=0 && IconArray()) |
2286 { |
2440 { |
2287 CGulIcon* icon=(*IconArray())[index]; |
2441 CGulIcon* icon=(*IconArray())[index]; |
2372 aGc.DiscardFont(); |
2526 aGc.DiscardFont(); |
2373 } |
2527 } |
2374 return; |
2528 return; |
2375 } |
2529 } |
2376 |
2530 |
|
2531 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2532 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2533 TBool markingMode = EFalse; |
|
2534 TRect itemRect( aRect ); |
|
2535 |
|
2536 if ( listbox->View() && listbox->View()->ItemDrawer() ) |
|
2537 { |
|
2538 if ( listbox->View()->ItemDrawer()->Flags() |
|
2539 & CListItemDrawer::EMarkingModeEnabled && |
|
2540 iExtension->iMarkingIconArray && |
|
2541 iExtension->iMarkingIconArray->Count() == 2 ) |
|
2542 { |
|
2543 markingMode = ETrue; |
|
2544 itemRect.iTl.iX += |
|
2545 AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 0 ).LayoutLine().il; |
|
2546 } |
|
2547 } |
|
2548 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2549 |
2377 TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels()); |
2550 TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels()); |
2378 TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels(); |
2551 TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels(); |
|
2552 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2553 TRect textRect( itemRect ); |
|
2554 TRect textMRect; // textrect with margins. |
|
2555 textRect.iBr.iX = itemRect.iTl.iX; |
|
2556 #else |
2379 TRect textRect( aRect ); |
2557 TRect textRect( aRect ); |
2380 TRect textMRect; // textrect with margins. |
2558 TRect textMRect; // textrect with margins. |
2381 textRect.iBr.iX=aRect.iTl.iX; |
2559 textRect.iBr.iX=aRect.iTl.iX; |
|
2560 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2382 TInt column=0; |
2561 TInt column=0; |
2383 TPtrC text; |
2562 TPtrC text; |
2384 |
2563 |
2385 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
2564 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
2386 |
2565 |
2387 // Turned the drawing to multipass algorithm, because optionalcolumns drawing will |
2566 // Turned the drawing to multipass algorithm, because optionalcolumns drawing will |
2388 // be too difficult to do without - and this is cleaner solution. |
2567 // be too difficult to do without - and this is cleaner solution. |
2389 |
2568 |
2390 // pass 1, figures out x-coordinates for columns. |
2569 // pass 1, figures out x-coordinates for columns. |
|
2570 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2571 TInt x = itemRect.iTl.iX; |
|
2572 #else |
2391 TInt x = aRect.iTl.iX; |
2573 TInt x = aRect.iTl.iX; |
|
2574 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2575 |
2392 TBool mirror = AknLayoutUtils::LayoutMirrored(); |
2576 TBool mirror = AknLayoutUtils::LayoutMirrored(); |
2393 if (mirror) |
2577 if (mirror) |
2394 { |
2578 { |
|
2579 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2580 x = itemRect.iBr.iX; |
|
2581 #else |
2395 x = aRect.iBr.iX; |
2582 x = aRect.iBr.iX; |
|
2583 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2396 } |
2584 } |
2397 TInt maxx = x; |
2585 TInt maxx = x; |
2398 while(column <= lastColumn) |
2586 while(column <= lastColumn) |
2399 { |
2587 { |
2400 // order of instructions is important here, do not change. |
2588 // order of instructions is important here, do not change. |
2463 if (!cc) |
2651 if (!cc) |
2464 { |
2652 { |
2465 cc = SkinBackgroundContext(); |
2653 cc = SkinBackgroundContext(); |
2466 } |
2654 } |
2467 |
2655 |
|
2656 #ifndef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2468 // aRect is list item's rect, width of which is smaller than width of the list |
2657 // aRect is list item's rect, width of which is smaller than width of the list |
2469 // with a scroll bar. List needs to draw under scroll bar anyway, so we need to |
2658 // with a scroll bar. List needs to draw under scroll bar anyway, so we need to |
2470 // modify given rect here. |
2659 // modify given rect here. |
2471 TRect r(aRect); |
2660 TRect r(aRect); |
2472 |
2661 |
2473 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
2662 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2663 #endif // !PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2474 |
2664 |
2475 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2665 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2476 |
2666 |
2477 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
2667 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
2478 |
2668 |
2505 transApi->StopDrawing(); |
2695 transApi->StopDrawing(); |
2506 } |
2696 } |
2507 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2697 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2508 } |
2698 } |
2509 |
2699 |
|
2700 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2701 if ( iExtension->iCurrentRow < listbox->BottomItemIndex() ) |
|
2702 #else |
2510 CEikListBox* list = static_cast<CEikListBox*>( iExtension->iControl ); |
2703 CEikListBox* list = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2704 |
2511 if ( iExtension->iCurrentRow < list->BottomItemIndex() ) |
2705 if ( iExtension->iCurrentRow < list->BottomItemIndex() ) |
|
2706 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
2512 { |
2707 { |
2513 AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin ); |
2708 AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin ); |
2514 } |
2709 } |
2515 |
2710 |
2516 // LISTBOX LINES NEED TO BE DRAWN HERE. |
2711 // LISTBOX LINES NEED TO BE DRAWN HERE. |
2523 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
2718 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
2524 aGc.SetClippingRect( view->ViewRect() ); |
2719 aGc.SetClippingRect( view->ViewRect() ); |
2525 } |
2720 } |
2526 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2721 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2527 |
2722 |
|
2723 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2724 if ( markingMode && !aItemProperties.IsSelectionHidden() ) |
|
2725 { |
|
2726 TAknLayoutRect layoutRect; |
|
2727 layoutRect.LayoutRect( |
|
2728 aRect, |
|
2729 AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) ); |
|
2730 |
|
2731 aGc.SetPenColor( aColors.iText ); |
|
2732 aGc.SetPenStyle( CGraphicsContext::ESolidPen ); |
|
2733 |
|
2734 CGulIcon* icon = (*iExtension->iMarkingIconArray)[1]; // unchecked |
|
2735 |
|
2736 if ( listbox->View()->ItemIsSelected( iExtension->iCurrentRow ) ) |
|
2737 { |
|
2738 icon = (*iExtension->iMarkingIconArray)[0]; |
|
2739 } |
|
2740 |
|
2741 CFbsBitmap* bitmap = icon->Bitmap(); |
|
2742 |
|
2743 if ( bitmap ) |
|
2744 { |
|
2745 TSize size( bitmap->SizeInPixels() ); // set size if not already |
|
2746 TSize targetSize( layoutRect.Rect().Size() ); |
|
2747 |
|
2748 if ( size.iWidth != targetSize.iWidth && |
|
2749 size.iHeight != targetSize.iHeight ) |
|
2750 { |
|
2751 AknIconUtils::SetSize( |
|
2752 bitmap, |
|
2753 targetSize, |
|
2754 EAspectRatioPreservedAndUnusedSpaceRemoved ); |
|
2755 } |
|
2756 |
|
2757 aGc.BitBltMasked( layoutRect.Rect().iTl, |
|
2758 bitmap, |
|
2759 TRect( layoutRect.Rect().Size() ), |
|
2760 icon->Mask(), |
|
2761 EFalse ); |
|
2762 } |
|
2763 } |
|
2764 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
2765 |
2528 // The column draw loop |
2766 // The column draw loop |
2529 column = 0; |
2767 column = 0; |
2530 FOREVER |
2768 FOREVER |
2531 { |
2769 { |
2532 if (column > lastColumn) break; |
2770 if (column > lastColumn) break; |
3142 { |
3380 { |
3143 // Animation is skin dependent, whenever skin changes animation changes |
3381 // Animation is skin dependent, whenever skin changes animation changes |
3144 // too. |
3382 // too. |
3145 if( KAknsMessageSkinChange == aType ) |
3383 if( KAknsMessageSkinChange == aType ) |
3146 { |
3384 { |
|
3385 #ifdef PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
|
3386 TRAP_IGNORE( iExtension->SkinChangedL() ); |
|
3387 #else |
3147 iExtension->SkinChanged(); |
3388 iExtension->SkinChanged(); |
|
3389 #endif // PBK2_AVKON_TOUCH_MARKINGMODE_CHANGES |
3148 } |
3390 } |
3149 else if(aType == KEikDynamicLayoutVariantSwitch) |
3391 else if(aType == KEikDynamicLayoutVariantSwitch) |
3150 { |
3392 { |
3151 // What is under highlight may have changed -> we need to update |
3393 // What is under highlight may have changed -> we need to update |
3152 // highlight background to animation. |
3394 // highlight background to animation. |