phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlauncherlpadmodel.cpp
branchRCL_3
changeset 6 e8e3147d53eb
parent 5 81f8547efd4f
child 7 b3431bff8c19
equal deleted inserted replaced
5:81f8547efd4f 6:e8e3147d53eb
    35 //Bitmap
    35 //Bitmap
    36 #include <bitdev.h> 
    36 #include <bitdev.h> 
    37 #include <cbsbitmap.h>
    37 #include <cbsbitmap.h>
    38 #include <AknIconUtils.h>
    38 #include <AknIconUtils.h>
    39 
    39 
       
    40 #include <AknBidiTextUtils.h>
    40 
    41 
    41 namespace {
    42 namespace {
    42 
    43 
    43 #define KOneVOIPServiceAvailable    1
    44 #define KOneVOIPServiceAvailable    1
    44 #define KVOIPButtonImageSet         0x1
    45 #define KVOIPButtonImageSet         0x1
   244 
   245 
   245     if ( iButtonDataArray.Count() > aIndex )
   246     if ( iButtonDataArray.Count() > aIndex )
   246         {
   247         {
   247         TPtr textPtr(iTextBuf->Des());
   248         TPtr textPtr(iTextBuf->Des());
   248         textPtr.Zero();
   249         textPtr.Zero();
   249         textPtr.Copy(iButtonDataArray[ aIndex ].iPopupText);
   250         TPtrC popupText;        
       
   251         TRAPD( error, popupText.Set( const_cast <CCCAppCommLauncherLPadModel*>(this)->TextForPopUpL( aIndex ) ) );
       
   252         if ( KErrNone == error )
       
   253             {
       
   254             textPtr.Copy( popupText );
       
   255             }
       
   256         else
       
   257             {
       
   258             textPtr.Copy( iButtonDataArray[ aIndex ].iPopupText );
       
   259             }
       
   260         
   250         if ( iButtonDataArray[ aIndex ].iClipFromBegining )
   261         if ( iButtonDataArray[ aIndex ].iClipFromBegining )
   251         	{
   262         	{
   252         	// Clip for second row text
   263         	// Clip for second row text
   253         	ClipFromBeginning( textPtr, aIndex, 2 );
   264         	ClipFromBeginning( textPtr, aIndex, 2 );
   254         	}
   265         	}
  1485     TInt aItemIndex,
  1496     TInt aItemIndex,
  1486     TInt aSubCellNumber) const
  1497     TInt aSubCellNumber) const
  1487 {
  1498 {
  1488     CAknDoubleLargeStyleListBox* listbox =
  1499     CAknDoubleLargeStyleListBox* listbox =
  1489         static_cast<CAknDoubleLargeStyleListBox*>(&iListBox);
  1500         static_cast<CAknDoubleLargeStyleListBox*>(&iListBox);
  1490 
  1501     TBool result = EFalse;
  1491     return AknTextUtils::ClipToFit(
  1502     if ( IfShowMultiIcon( aItemIndex ) )
       
  1503         {
       
  1504         TRect mainPane = iPlugin.ClientRect();
       
  1505         TAknLayoutRect listLayoutRect;
       
  1506         listLayoutRect.LayoutRect(
       
  1507             mainPane,
       
  1508             AknLayoutScalable_Apps::list_double_large_graphic_phob2_cc_pane_g3(0).LayoutLine() );
       
  1509         TInt multiIconWidth(listLayoutRect.Rect().Width());
       
  1510         const TInt KCalculationErrors = 1;
       
  1511         CFormattedCellListBoxData *data = listbox->ItemDrawer()->FormattedCellData();
       
  1512         const CFont *font = data->Font(listbox->ItemDrawer()->Properties(aItemIndex), aSubCellNumber);
       
  1513         TSize cellsize = data->SubCellSize(aSubCellNumber);
       
  1514         TMargins margin = data->SubCellMargins(aSubCellNumber);
       
  1515         TInt width = cellsize.iWidth - margin.iLeft - margin.iRight - 
       
  1516                         multiIconWidth - KAknBidiExtraSpacePerLine - KCalculationErrors;
       
  1517         TInt clipgap = data->SubCellTextClipGap(aSubCellNumber);
       
  1518         result = AknTextUtils::ClipToFit(
       
  1519             aBuffer, *font, width, AknTextUtils::EClipFromBeginning, width + clipgap);
       
  1520         }
       
  1521     else
       
  1522         {
       
  1523         result = AknTextUtils::ClipToFit(
  1492         aBuffer,
  1524         aBuffer,
  1493         AknTextUtils::EClipFromBeginning,
  1525         AknTextUtils::EClipFromBeginning,
  1494         listbox,
  1526         listbox,
  1495         aItemIndex,
  1527         aItemIndex,
  1496         aSubCellNumber);
  1528         aSubCellNumber);
  1497 }
  1529 }
  1498 
  1530     return result;
       
  1531     }
  1499 
  1532 
  1500 // End of File
  1533 // End of File