uifw/eikctl/src/EIKCLBD.CPP
branchRCL_3
changeset 16 71dd06cfe933
parent 15 08e69e956a8c
child 23 3d340a0166ff
equal deleted inserted replaced
15:08e69e956a8c 16:71dd06cfe933
  1942                                      const TRect& aRect,
  1942                                      const TRect& aRect,
  1943                                      TBool aHighlight,
  1943                                      TBool aHighlight,
  1944                                      const TColors& aColors ) const
  1944                                      const TColors& aColors ) const
  1945     {
  1945     {
  1946     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );    
  1946     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );    
  1947     CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1947     
  1948     if ( !view->ViewRect().Intersects( aRect ) )
  1948     __ASSERT_DEBUG( iExtension->iControl, Panic( EEikPanicNullPointer ));
       
  1949     
       
  1950     CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
       
  1951     if ( listbox && !listbox->View()->ViewRect().Intersects( aRect ) )
  1949         {
  1952         {
  1950         // outside of the clipping rect -> don't process this item
  1953         // outside of the clipping rect -> don't process this item
  1951         return;
  1954         return;
  1952         }
  1955         }
  1953 
  1956 
  1958 
  1961 
  1959     TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText;
  1962     TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText;
  1960 
  1963 
  1961     MAknsSkinInstance *skin = AknsUtils::SkinInstance();
  1964     MAknsSkinInstance *skin = AknsUtils::SkinInstance();
  1962     MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
  1965     MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
  1963     if (!cc)
  1966     if ( !cc )
  1964         {
  1967         {
  1965         cc = SkinBackgroundContext();
  1968         cc = SkinBackgroundContext();
  1966         }
  1969         }
  1967 
  1970 
  1968     TAknTextLineLayout textLines[KMaxColumn];
  1971     TAknTextLineLayout textLines[KMaxColumn];
  1973     if ( iExtension->iSubCellsMightIntersect )
  1976     if ( iExtension->iSubCellsMightIntersect )
  1974         {
  1977         {
  1975         CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, aRect );
  1978         CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, aRect );
  1976         }
  1979         }
  1977 
  1980 
  1978     CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
       
  1979 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1981 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1980     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
  1982     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
  1981 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  1983 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  1982 
  1984 
  1983     if ( !listbox || !listbox->BackgroundDrawingSuppressed() )
  1985     if ( !listbox || !listbox->BackgroundDrawingSuppressed() )
  2006             {
  2008             {
  2007             transApi->StopDrawing();
  2009             transApi->StopDrawing();
  2008             }
  2010             }
  2009 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2011 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2010         }
  2012         }
  2011 
  2013  
  2012     CEikListBox* list = static_cast<CEikListBox*>( iExtension->iControl );
  2014     if ( iExtension->iCurrentRow < listbox->BottomItemIndex() )
  2013     
       
  2014     if ( iExtension->iCurrentRow < list->BottomItemIndex() )
       
  2015         {
  2015         {
  2016         AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
  2016         AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
  2017         }
  2017         }
  2018     DrawHighLight( aGc, aRect, aHighlight, skin );
  2018     DrawHighLight( aGc, aRect, aHighlight, skin );
  2019     
  2019     
  2025     
  2025     
  2026 #ifdef RD_UI_TRANSITION_EFFECTS_LIST   
  2026 #ifdef RD_UI_TRANSITION_EFFECTS_LIST   
  2027     if ( transApi )
  2027     if ( transApi )
  2028         {
  2028         {
  2029         transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
  2029         transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
  2030         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  2030         CListBoxView* view = listbox->View();
  2031         aGc.SetClippingRect( view->ViewRect() );
  2031         aGc.SetClippingRect( view->ViewRect() );
  2032         }
  2032         }
  2033 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2033 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2034     
  2034     
  2035     for( column = 0; column <= lastColumn; column++ )
  2035     for( column = 0; column <= lastColumn; column++ )
  2046             {
  2046             {
  2047             aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
  2047             aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
  2048             
  2048             
  2049             TRgb textColor( aTextColor );
  2049             TRgb textColor( aTextColor );
  2050             
  2050             
  2051             if (aHighlight)
  2051             if ( aHighlight )
  2052                 {
  2052                 {
  2053                 textColor = aColors.iHighlightedText;
  2053                 textColor = aColors.iHighlightedText;
  2054                 aGc.SetBrushColor(aColors.iHighlightedBack);    
  2054                 aGc.SetBrushColor(aColors.iHighlightedBack);    
  2055                 }
  2055                 }
  2056             if (AknsUtils::AvkonSkinEnabled())
  2056             if ( AknsUtils::AvkonSkinEnabled() )
  2057                 {
  2057                 {
  2058                 if (iExtension->iTextColor != NULL)
  2058                 if ( iExtension->iTextColor != NULL )
  2059                     {
  2059                     {
  2060                     textColor = iExtension->iTextColor;
  2060                     textColor = iExtension->iTextColor;
  2061                     }
  2061                     }
  2062                 
  2062                 
  2063                 if (aHighlight && iExtension->iHighlightedTextColor != NULL)
  2063                 if ( aHighlight && iExtension->iHighlightedTextColor != NULL )
  2064                     {
  2064                     {
  2065                     textColor = iExtension->iHighlightedTextColor;
  2065                     textColor = iExtension->iHighlightedTextColor;
  2066                     }
  2066                     }
  2067                 }
  2067                 }
  2068                 
  2068                 
  2080             else
  2080             else
  2081                 {
  2081                 {
  2082                 // check if there are icons affecting this text layout
  2082                 // check if there are icons affecting this text layout
  2083                 TInt gSC = iExtension->AtSL(subCellIndex).iConditionValue; // graphical subcell which might affect this text subcell
  2083                 TInt gSC = iExtension->AtSL(subCellIndex).iConditionValue; // graphical subcell which might affect this text subcell
  2084                 
  2084                 
  2085                 if (gSC > -1)
  2085                 if ( gSC > -1 )
  2086                     {
  2086                     {
  2087                     TInt tempIndex;
  2087                     TInt tempIndex;
  2088                     while (gSC > -1) // when gSC == -1, we have found our graphical subcell
  2088                     while (gSC > -1) // when gSC == -1, we have found our graphical subcell
  2089                         {
  2089                         {
  2090                         if (iExtension->FindSLSubCellIndex(tempIndex,gSC)!=0) break;
  2090                         if (iExtension->FindSLSubCellIndex(tempIndex,gSC)!=0) break;
  2096                             }
  2096                             }
  2097                         gSC = iExtension->AtSL(tempIndex).iConditionValue;
  2097                         gSC = iExtension->AtSL(tempIndex).iConditionValue;
  2098                         }
  2098                         }
  2099                     }
  2099                     }
  2100                     
  2100                     
  2101                 if (gSC == -1) // no affecting icons -> use default layout
  2101                 if ( gSC == -1 ) // no affecting icons -> use default layout
  2102                     {
  2102                     {
  2103                     textLineLayout = iExtension->AtSL(subCellIndex).iTextLayout;
  2103                     textLineLayout = iExtension->AtSL(subCellIndex).iTextLayout;
  2104                     }
  2104                     }
  2105                 }
  2105                 }
  2106             
  2106             
  2107   
  2107   
  2108             if( !isLayoutAlignment )
  2108             if( !isLayoutAlignment )
  2109                 { 
  2109                 { 
  2110                 switch(align) 
  2110                 switch( align ) 
  2111                     {
  2111                     {
  2112                     case CGraphicsContext::ELeft : 
  2112                     case CGraphicsContext::ELeft : 
  2113                         {
  2113                         {
  2114                         textLineLayout.iJ = ELayoutAlignLeft;    
  2114                         textLineLayout.iJ = ELayoutAlignLeft;    
  2115                         }
  2115                         }
  2163                 {
  2163                 {
  2164                 iExtension->iClippedColumns |= ( 1 << column );
  2164                 iExtension->iClippedColumns |= ( 1 << column );
  2165                 }
  2165                 }
  2166 
  2166 
  2167             TBool marqueeDisabled(EFalse);
  2167             TBool marqueeDisabled(EFalse);
  2168             if (listbox != NULL && 
  2168             if ( listbox != NULL && 
  2169                 listbox->View() != NULL && 
  2169                  listbox->View() != NULL && 
  2170                 listbox->View()->ItemDrawer() != NULL)
  2170                  listbox->View()->ItemDrawer() != NULL)
  2171                 {
  2171                 {
  2172                 marqueeDisabled = listbox->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee;
  2172                 marqueeDisabled = listbox->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee;
  2173                 }
  2173                 }
  2174             
  2174             
  2175             if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled )
  2175             if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled )
  2253             if ( !IconArray() )
  2253             if ( !IconArray() )
  2254                 {
  2254                 {
  2255                 continue;
  2255                 continue;
  2256                 }
  2256                 }
  2257 
  2257 
  2258             if (aHighlight && (index > 0xffff))
  2258             if ( aHighlight && (index > 0xffff) )
  2259                 {
  2259                 {
  2260                 index = index >> 16; // we have different icon for highlight
  2260                 index = index >> 16; // we have different icon for highlight
  2261                 }
  2261                 }
  2262 
  2262 
  2263              index = index & 0xffff; // mask off possible highlight icon
  2263              index = index & 0xffff; // mask off possible highlight icon
  2267             TAknLayoutRect graphicRect; 
  2267             TAknLayoutRect graphicRect; 
  2268             
  2268             
  2269             graphicRect.LayoutRect(aRect,graphicLayout);
  2269             graphicRect.LayoutRect(aRect,graphicLayout);
  2270             TSize graphicSize( graphicRect.Rect().Size() );
  2270             TSize graphicSize( graphicRect.Rect().Size() );
  2271             
  2271             
  2272             if (index>=0 && IconArray())
  2272             if ( index>=0 && IconArray() )
  2273                 {
  2273                 {
  2274                 CGulIcon* icon=(*IconArray())[index];
  2274                 CGulIcon* icon=(*IconArray())[index];
  2275                 CFbsBitmap* bitmap=icon->Bitmap();
  2275                 CFbsBitmap* bitmap=icon->Bitmap();
  2276                 // Sometimes we get fake bitmap...
  2276                 // Sometimes we get fake bitmap...
  2277                 if ( bitmap )
  2277                 if ( bitmap )
  2278                     {
  2278                     {
  2279                     TSize size( bitmap->SizeInPixels() );
  2279                     TSize size( bitmap->SizeInPixels() );
  2280                     
  2280                     
  2281                     if (size.iWidth != graphicSize.iWidth &&
  2281                     if ( size.iWidth != graphicSize.iWidth &&
  2282                         size.iHeight != graphicSize.iHeight )
  2282                          size.iHeight != graphicSize.iHeight )
  2283                         {
  2283                         {
  2284                         AknIconUtils::SetSize( bitmap,
  2284                         AknIconUtils::SetSize( bitmap,
  2285                                                graphicSize,
  2285                                                graphicSize,
  2286                                                EAspectRatioPreservedAndUnusedSpaceRemoved );
  2286                                                EAspectRatioPreservedAndUnusedSpaceRemoved );
  2287                         }
  2287                         }