emailuis/uicomponents/src/fstreerichitemvisualizer.cpp
changeset 0 8466d47a6819
child 18 6b8f3b30d0ec
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  A visualizer for data items with rich text.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #include "emailtrace.h"
       
    21 #include <txtrich.h>
       
    22 //<cmail> removed __FS_ALFRED_SUPPORT flag
       
    23 //#include <fsconfig.h>
       
    24 //</cmail> removed __FS_ALFRED_SUPPORT flag
       
    25 
       
    26 // <cmail> SF
       
    27 #include <alf/alfcontrol.h>
       
    28 #include <alf/alflayout.h>
       
    29 #include <alf/alfflowlayout.h>
       
    30 #include <alf/alftextvisual.h>
       
    31 #include <alf/alfgradientbrush.h>
       
    32 #include <alf/alfanchorlayout.h>
       
    33 #include <alf/alfimage.h>
       
    34 #include <alf/alfimagevisual.h>
       
    35 #include <alf/alfbrusharray.h>
       
    36 #include <alf/alfenv.h>
       
    37 // </cmail>
       
    38 
       
    39 #include "fstreerichitemvisualizer.h"
       
    40 #include "fstreerichitemdata.h"
       
    41 #include "fsgenericpanic.h"
       
    42 #include "fsrichtext.h"
       
    43 #include "fstreelist.h"
       
    44 #include "fsscrollbarset.h"
       
    45 #include "fsalftextstylemanager.h"
       
    46 #include "fslayoutmanager.h"
       
    47 
       
    48 // ======== MEMBER FUNCTIONS ========
       
    49 
       
    50 
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // C++ constructor.
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 CFsTreeRichItemVisualizer::CFsTreeRichItemVisualizer(
       
    57     CAlfControl& aOwnerControl, CFsAlfTextStyleManager& aTextStyleManager )
       
    58     : CFsTreeItemVisualizerBase(aOwnerControl)
       
    59     {
       
    60     FUNC_LOG;
       
    61     iTextStyleManager = &aTextStyleManager;
       
    62     }
       
    63 
       
    64 
       
    65 
       
    66 // ---------------------------------------------------------------------------
       
    67 // 2nd phase constructor.
       
    68 // ---------------------------------------------------------------------------
       
    69 //
       
    70 void CFsTreeRichItemVisualizer::ConstructL()
       
    71     {
       
    72     FUNC_LOG;
       
    73     }
       
    74 
       
    75 
       
    76 
       
    77 // ---------------------------------------------------------------------------
       
    78 // Two-phase constructor.
       
    79 // ---------------------------------------------------------------------------
       
    80 //
       
    81 EXPORT_C CFsTreeRichItemVisualizer* CFsTreeRichItemVisualizer::NewL(
       
    82     CAlfControl& aOwnerControl, CFsAlfTextStyleManager& aTextStyleManager )
       
    83     {
       
    84     FUNC_LOG;
       
    85     CFsTreeRichItemVisualizer* self =
       
    86         new( ELeave ) CFsTreeRichItemVisualizer(aOwnerControl, aTextStyleManager);
       
    87     CleanupStack::PushL( self );
       
    88     self->ConstructL();
       
    89     CleanupStack::Pop( self );
       
    90     return self;
       
    91     }
       
    92 
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // C++ destructor.
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 CFsTreeRichItemVisualizer::~CFsTreeRichItemVisualizer()
       
    99     {
       
   100     FUNC_LOG;
       
   101     }
       
   102 
       
   103 
       
   104 // ---------------------------------------------------------------------------
       
   105 // Returns visualizer's type.
       
   106 // ---------------------------------------------------------------------------
       
   107 //
       
   108 TFsTreeItemVisualizerType CFsTreeRichItemVisualizer::Type() const
       
   109     {
       
   110     FUNC_LOG;
       
   111     return EFsTreeRichItemVisualizer;
       
   112     }
       
   113 
       
   114 
       
   115 
       
   116 // ---------------------------------------------------------------------------
       
   117 //  Create a visual based on the text object.
       
   118 // ---------------------------------------------------------------------------
       
   119 //
       
   120 CAlfFlowLayout* CFsTreeRichItemVisualizer::CreateTextLineL(
       
   121     CAlfControl& aOwnerControl,
       
   122     CAlfLayout* aParentLayout,
       
   123     const CFsTreeRichItemData* aText,
       
   124     TSize aSize )
       
   125     {
       
   126     FUNC_LOG;
       
   127     CAlfFlowLayout* textLayout(
       
   128             CAlfFlowLayout::AddNewL(aOwnerControl, aParentLayout));
       
   129     textLayout->SetFlowDirection(CAlfFlowLayout::EFlowHorizontal);
       
   130     textLayout->SetCentering( EFalse );
       
   131     textLayout->EnableBrushesL();
       
   132     textLayout->SetSize( aSize );
       
   133     textLayout->SetClipping(ETrue);
       
   134 
       
   135     CAlfTextVisual* textVisual;
       
   136     TCharFormat charFormat;
       
   137     TPtrC16 text;
       
   138     TInt textPos( 0 );
       
   139     TInt xPos( 0 );
       
   140 
       
   141     textLayout->SetFlag(EAlfVisualFlagFreezeLayout);
       
   142 
       
   143     while ( aText->Text().DocumentLength() > textPos )
       
   144         {
       
   145         // Need to create a new visual for every text block with different
       
   146         // markup.
       
   147         aText->Text().GetChars( text, charFormat, textPos );
       
   148         textVisual = CAlfTextVisual::AddNewL( aOwnerControl, textLayout );
       
   149         textVisual->EnableShadow( iFlags & KFsTreeListItemTextShadow );
       
   150         textVisual->EnableBrushesL();
       
   151         textVisual->SetTextL( text );
       
   152 
       
   153         TInt styleId( iTextStyleManager->GetStyleIDL( charFormat ) );
       
   154         textVisual->SetTextStyle( styleId );
       
   155         textVisual->SetColor( charFormat.iFontPresentation.iTextColor );
       
   156 
       
   157         if ( TFontPresentation::EFontHighlightNone
       
   158             != charFormat.iFontPresentation.iHighlightStyle )
       
   159             {
       
   160             CAlfGradientBrush* brush( CAlfGradientBrush::NewLC(textLayout->Env()));
       
   161             brush->SetColor( charFormat.iFontPresentation.iHighlightColor );
       
   162             textVisual->Brushes()->AppendL(brush, EAlfHasOwnership);
       
   163             CleanupStack::Pop( brush );
       
   164             }
       
   165 
       
   166         textVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
       
   167 
       
   168         textVisual->SetSize( TSize(textVisual->TextExtents().iWidth,
       
   169                 iSize.iHeight) );
       
   170 
       
   171         TInt visualWidth( textVisual->Size().Target().iX );
       
   172         if ( xPos + visualWidth >= aSize.iWidth )
       
   173             {
       
   174             // The width limit has been reached and the last item need to be
       
   175             // resized.
       
   176             TAlfRealSize size;
       
   177             size.iWidth = aSize.iWidth - xPos;
       
   178             size.iHeight = textVisual->Size().iY.Target();
       
   179             textVisual->SetSize(size, 0);
       
   180             break;
       
   181             }
       
   182         xPos += visualWidth;
       
   183         textPos += text.Length();
       
   184         }
       
   185     textLayout->SetFlag(EAlfVisualFlagFreezeLayout);
       
   186     textLayout->UpdateChildrenLayout(0);
       
   187 
       
   188     return textLayout;
       
   189     }
       
   190 
       
   191 
       
   192 // ---------------------------------------------------------------------------
       
   193 // From class MFsTreeItemVisualizer.
       
   194 // Sets the size of the item visualization when item is not in expanded
       
   195 // state. The value is taken from layout manager.
       
   196 // ---------------------------------------------------------------------------
       
   197 //
       
   198 void CFsTreeRichItemVisualizer::UpdateLayout(
       
   199         const CFsTreeRichItemData* aData,
       
   200         const TInt aIndentation )
       
   201     {
       
   202     FUNC_LOG;
       
   203     TRect rect;
       
   204 
       
   205     TAlfTimedPoint tpMainIconTl, tpMainIconBr;
       
   206     TAlfTimedPoint tpTextTl, tpTextBr;
       
   207     TAlfTimedPoint tpMarkIconTl, tpMarkIconBr;
       
   208     TAlfTimedPoint tpMenuIconTl, tpMenuIconBr;
       
   209 
       
   210     CFsLayoutManager::TFsLayoutMetrics
       
   211         mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG1,
       
   212         markIconMetrics = CFsLayoutManager::EFsLmListMediumLineG3G2,
       
   213         menuIconMetrics = CFsLayoutManager::EFsLmListMediumLineG3G3,
       
   214         textMetrics     = CFsLayoutManager::EFsLmListMediumLineG3T1,
       
   215         sizeMetrics     = CFsLayoutManager::EFsLmListSingleDycRowPane;
       
   216 
       
   217     if (aData->IsIconSet())
       
   218         {
       
   219         if (iFlags & KFsTreeListItemMarked)
       
   220             {
       
   221             if (iMenu && (iFlags & KFsTreeListItemFocused))
       
   222                 {
       
   223                 //mainIcon + markIcon + menuIcon
       
   224                 //the metrics defined when declared
       
   225                 }
       
   226             else
       
   227                 {
       
   228                 //mainIcon + markIcon
       
   229                 mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G1;
       
   230                 markIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G2;
       
   231                 textMetrics     = CFsLayoutManager::EFsLmListMediumLineG2T1;
       
   232                 }
       
   233             }
       
   234         else
       
   235             {
       
   236             if ((iFlags & KFsTreeListItemHasMenu)
       
   237                     && (iFlags & KFsTreeListItemFocused))
       
   238                 {
       
   239                 //mainIcon + menuIcon
       
   240                 mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G1;
       
   241                 menuIconMetrics = CFsLayoutManager::EFsLmListMediumLineG2G2;
       
   242                 textMetrics     = CFsLayoutManager::EFsLmListMediumLineG2T1;
       
   243                 }
       
   244             else
       
   245                 {
       
   246                 //mainIcon
       
   247                 mainIconMetrics = CFsLayoutManager::EFsLmListMediumLineG1;
       
   248                 textMetrics     = CFsLayoutManager::EFsLmListMediumLineT1;
       
   249                 }
       
   250             }
       
   251         }
       
   252     else
       
   253         {
       
   254         if (iFlags & KFsTreeListItemMarked)
       
   255             {
       
   256             if (iMenu && (iFlags & KFsTreeListItemFocused))
       
   257                 {
       
   258                 //markIcon + menuIcon
       
   259                 markIconMetrics =
       
   260                     CFsLayoutManager::EFsLmListMediumLineRightIconx2G1;
       
   261                 menuIconMetrics =
       
   262                     CFsLayoutManager::EFsLmListMediumLineRightIconx2G2;
       
   263                 textMetrics     =
       
   264                     CFsLayoutManager::EFsLmListMediumLineRightIconx2T1;
       
   265                 }
       
   266             else
       
   267                 {
       
   268                 //markIcon
       
   269                 markIconMetrics =
       
   270                     CFsLayoutManager::EFsLmListMediumLineRightIconG1;
       
   271                 textMetrics     =
       
   272                     CFsLayoutManager::EFsLmListMediumLineRightIconT1;
       
   273                 }
       
   274             }
       
   275         else
       
   276             {
       
   277             if ((iFlags & KFsTreeListItemHasMenu)
       
   278                     && (iFlags & KFsTreeListItemFocused))
       
   279                 {
       
   280                 //menuIcon
       
   281                 menuIconMetrics =
       
   282                     CFsLayoutManager::EFsLmListMediumLineRightIconG1;
       
   283                 textMetrics     =
       
   284                     CFsLayoutManager::EFsLmListMediumLineRightIconT1;
       
   285                 }
       
   286             else
       
   287                 {
       
   288                 //plain item
       
   289                 textMetrics     =
       
   290                     CFsLayoutManager::EFsLmListMediumLinePlainT1;
       
   291                 }
       
   292             }
       
   293         }
       
   294 
       
   295     //layout manager is queried for medium values - LM returnes rects based on phone's global text settings
       
   296 
       
   297     TRect parentLayoutRect = TRect(iParentLayout->Size().Target().AsSize());
       
   298     parentLayoutRect.Resize(-(iParentLayout->HorizontalPadding()*2), 0);
       
   299 
       
   300     if (iFlags & KFsTreeListItemManagedLayout)
       
   301         {
       
   302         CFsLayoutManager::LayoutMetricsSize(
       
   303                 parentLayoutRect,
       
   304                 sizeMetrics,
       
   305                 iSize );
       
   306         }
       
   307 
       
   308     TRect currentSize = iSize;
       
   309     if (CFsLayoutManager::IsMirrored())
       
   310         {
       
   311         currentSize.iBr = currentSize.iBr - TPoint(aIndentation, 0);
       
   312         }
       
   313     else
       
   314         {
       
   315         currentSize.iTl = currentSize.iTl + TPoint(aIndentation, 0);
       
   316         }
       
   317 
       
   318     CFsLayoutManager::LayoutMetricsRect(
       
   319             currentSize,
       
   320             mainIconMetrics,
       
   321             rect );
       
   322     tpMainIconTl.SetTarget(TAlfRealPoint(rect.iTl));
       
   323     tpMainIconBr.SetTarget(TAlfRealPoint(rect.iBr));
       
   324 
       
   325     CFsLayoutManager::LayoutMetricsRect(
       
   326             currentSize,
       
   327             markIconMetrics,
       
   328             rect );
       
   329     tpMarkIconTl.SetTarget(TAlfRealPoint(rect.iTl));
       
   330     tpMarkIconBr.SetTarget(TAlfRealPoint(rect.iBr));
       
   331 
       
   332     CFsLayoutManager::LayoutMetricsRect(
       
   333             currentSize,
       
   334             menuIconMetrics,
       
   335             rect );
       
   336     tpMenuIconTl.SetTarget(TAlfRealPoint(rect.iTl));
       
   337     tpMenuIconBr.SetTarget(TAlfRealPoint(rect.iBr));
       
   338 
       
   339     CFsLayoutManager::TFsText textInfo;
       
   340     CFsLayoutManager::LayoutMetricsText(currentSize, textMetrics, textInfo);
       
   341 
       
   342     tpTextTl.SetTarget(TAlfRealPoint(textInfo.iTextRect.iTl));
       
   343     tpTextBr.SetTarget(TAlfRealPoint(textInfo.iTextRect.iBr));
       
   344 
       
   345     TInt visualIconIndex = iLayout->FindVisual(iIconVisual);
       
   346     if ( visualIconIndex != KErrNotFound )
       
   347         {
       
   348         iLayout->SetAnchor( EAlfAnchorTopLeft,
       
   349                 visualIconIndex,
       
   350                 EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
       
   351                 EAlfAnchorMetricAbsolute,
       
   352                 EAlfAnchorMetricAbsolute,
       
   353                 tpMainIconTl );
       
   354         iLayout->SetAnchor( EAlfAnchorBottomRight,
       
   355                 visualIconIndex,
       
   356                 EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
       
   357                 EAlfAnchorMetricAbsolute,
       
   358                 EAlfAnchorMetricAbsolute,
       
   359                 tpMainIconBr );
       
   360         }
       
   361 
       
   362     if ((iFlags & KFsTreeListItemHasMenu)
       
   363             && (iFlags & KFsTreeListItemFocused))
       
   364         {
       
   365         TInt iconMenuVisIndex = iLayout->FindVisual(iIconMenu);
       
   366         if ( iconMenuVisIndex != KErrNotFound )
       
   367             {
       
   368             iLayout->SetAnchor(EAlfAnchorTopLeft,
       
   369                     iconMenuVisIndex,
       
   370                     EAlfAnchorOriginLeft,EAlfAnchorOriginTop,
       
   371                     EAlfAnchorMetricAbsolute,EAlfAnchorMetricAbsolute,
       
   372                     tpMenuIconTl );
       
   373             iLayout->SetAnchor(EAlfAnchorBottomRight,
       
   374                     iconMenuVisIndex,
       
   375                     EAlfAnchorOriginLeft,EAlfAnchorOriginTop,
       
   376                     EAlfAnchorMetricAbsolute,EAlfAnchorMetricAbsolute,
       
   377                     tpMenuIconBr );
       
   378 
       
   379             TAlfTimedValue opacity;
       
   380             opacity.SetValueNow(1.0f);
       
   381             iIconMenu->SetOpacity(opacity);
       
   382             }
       
   383         }
       
   384     else
       
   385         {
       
   386         TAlfTimedValue opacity;
       
   387         opacity.SetValueNow(0.0f);
       
   388         iIconMenu->SetOpacity(opacity);
       
   389         }
       
   390 
       
   391     if (iTextLayout)
       
   392         {
       
   393         TInt textVisIndex = iLayout->FindVisual(iTextLayout);
       
   394         if ( textVisIndex != KErrNotFound )
       
   395             {
       
   396             iLayout->SetAnchor(EAlfAnchorTopLeft,
       
   397                     textVisIndex,
       
   398                     EAlfAnchorOriginLeft,EAlfAnchorOriginTop,
       
   399                     EAlfAnchorMetricAbsolute,
       
   400                     EAlfAnchorMetricAbsolute,
       
   401                     tpTextTl );
       
   402             iLayout->SetAnchor(EAlfAnchorBottomRight,
       
   403                     textVisIndex,
       
   404                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
       
   405                     EAlfAnchorMetricAbsolute,
       
   406                     EAlfAnchorMetricAbsolute,
       
   407                     tpTextBr );
       
   408             }
       
   409         }
       
   410 
       
   411     if ( iFlags & KFsTreeListItemMarked )
       
   412         {
       
   413         TInt iconMarkedVisIndex =
       
   414                             iLayout->FindVisual(iIconMarked);
       
   415         if ( iconMarkedVisIndex != KErrNotFound )
       
   416             {
       
   417             iLayout->SetAnchor(EAlfAnchorTopLeft,
       
   418                     iconMarkedVisIndex,
       
   419                     EAlfAnchorOriginLeft,EAlfAnchorOriginTop,
       
   420                     EAlfAnchorMetricAbsolute,
       
   421                     EAlfAnchorMetricAbsolute,
       
   422                     tpMarkIconTl );
       
   423             iLayout->SetAnchor(EAlfAnchorBottomRight,
       
   424                     iconMarkedVisIndex,
       
   425                     EAlfAnchorOriginLeft, EAlfAnchorOriginTop,
       
   426                     EAlfAnchorMetricAbsolute,
       
   427                     EAlfAnchorMetricAbsolute,
       
   428                     tpMarkIconBr );
       
   429 
       
   430             TAlfTimedValue opacity;
       
   431             opacity.SetValueNow(1.0f);
       
   432             iIconMarked->SetOpacity(opacity);
       
   433             }
       
   434         }
       
   435     else
       
   436         {
       
   437         if (iIconMarked)
       
   438             {
       
   439             TAlfTimedValue opacity;
       
   440             opacity.SetValueNow(0.0f);
       
   441             iIconMarked->SetOpacity(opacity);
       
   442             }
       
   443         }
       
   444     iLayout->UpdateChildrenLayout();
       
   445     }
       
   446 
       
   447 
       
   448 // ---------------------------------------------------------------------------
       
   449 // From class MFsTreeItemVisualizer.
       
   450 // A call to this function means that the item is requested to draw itself
       
   451 // within specified parent layout.
       
   452 // ---------------------------------------------------------------------------
       
   453 //
       
   454 void CFsTreeRichItemVisualizer::ShowL( CAlfLayout& aParentLayout, const TUint aTimeout )
       
   455     {
       
   456     FUNC_LOG;
       
   457     if ( !iLayout )
       
   458         {
       
   459         iParentLayout = &aParentLayout;
       
   460 
       
   461         iLayout = CAlfAnchorLayout::AddNewL(iOwnerControl, iParentLayout);
       
   462         iLayout->EnableBrushesL();
       
   463         iLayout->SetClipping(ETrue);
       
   464 
       
   465         if ( !iIconVisual )
       
   466             {
       
   467             iIconVisual =
       
   468                 CAlfImageVisual::AddNewL( iOwnerControl, iLayout );
       
   469             iIconVisual->SetScaleMode( CAlfImageVisual::EScaleFit );
       
   470             }
       
   471 
       
   472         if ( !iIconMarked )
       
   473             {
       
   474             iIconMarked =
       
   475                 CAlfImageVisual::AddNewL( iOwnerControl, iLayout );
       
   476             iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFit );
       
   477             }
       
   478 
       
   479         if ( !iIconMenu )
       
   480             {
       
   481             iIconMenu =
       
   482                 CAlfImageVisual::AddNewL( iOwnerControl, iLayout );
       
   483             iIconMenu->SetScaleMode( CAlfImageVisual::EScaleFit );
       
   484             }
       
   485         }
       
   486     else
       
   487         {
       
   488         //visuals are already created but not attached to the list layout
       
   489         if (!iLayout->Layout())
       
   490             {
       
   491             aParentLayout.Append(iLayout, aTimeout);
       
   492             iParentLayout = &aParentLayout;
       
   493             }
       
   494         }
       
   495     }
       
   496 
       
   497 
       
   498 // ---------------------------------------------------------------------------
       
   499 // From class MFsTreeItemVisualizer.
       
   500 // A call to this function means that the item is requested to update its
       
   501 // visual content.
       
   502 // ---------------------------------------------------------------------------
       
   503 //
       
   504 void CFsTreeRichItemVisualizer::UpdateL(
       
   505     const MFsTreeItemData& aData,
       
   506     TBool /*aFocused*/,
       
   507     const TUint aLevel,
       
   508     CAlfTexture*& aMarkIcon,
       
   509     CAlfTexture*& aMenuIcon,
       
   510     const TUint /*aTimeout*/,
       
   511     TBool aUpdateData)
       
   512     {
       
   513     FUNC_LOG;
       
   514     if ( iLayout )
       
   515         {
       
   516         iSize.iWidth = iParentLayout->Size().Target().iX -
       
   517                        iParentLayout->PaddingInPixels().Width();
       
   518         iExtendedSize.iWidth = iSize.iWidth;
       
   519 
       
   520         if ( KFsTreeRichItemDataType == aData.Type() )
       
   521             {
       
   522             const CFsTreeRichItemData* data(
       
   523                 static_cast<const CFsTreeRichItemData*>(&aData));
       
   524 
       
   525             if (iIconVisual)
       
   526                 {
       
   527                 if ( data->IsIconSet() )
       
   528                     {
       
   529                     iIconVisual->SetScaleMode( CAlfImageVisual::EScaleFit );
       
   530                     iIconVisual->SetImage( TAlfImage(data->Icon()));
       
   531                     }
       
   532                 }
       
   533 
       
   534             if (iFlags & KFsTreeListItemMarked)
       
   535                 {
       
   536                 iIconMarked->SetScaleMode( CAlfImageVisual::EScaleFit );
       
   537                 iIconMarked->SetImage(TAlfImage(*aMarkIcon));
       
   538                 }
       
   539 
       
   540             if (iFlags & KFsTreeListItemHasMenu)
       
   541                 {
       
   542                 iIconMenu->SetScaleMode( CAlfImageVisual::EScaleFit );
       
   543                 iIconMenu->SetImage(TAlfImage(*aMenuIcon));
       
   544                 }
       
   545 
       
   546             iLayout->Env().SetRefreshMode(EAlfRefreshModeManual);
       
   547 
       
   548             if (iTextLayout)
       
   549                 {
       
   550                 iTextLayout->RemoveAndDestroyAllD();
       
   551                 }
       
   552             iTextLayout = CAlfFlowLayout::AddNewL(iOwnerControl, iLayout);
       
   553             iTextLayout->SetFlowDirection(CAlfFlowLayout::EFlowHorizontal);
       
   554 
       
   555             const TInt indent( iTextIndentation * ( aLevel - 1 ) );
       
   556             UpdateLayout(data, indent);
       
   557 
       
   558             if (aUpdateData)
       
   559                 {
       
   560                 CreateTextLineL(iOwnerControl, iTextLayout, data,
       
   561                         iTextLayout->Size().Target().AsSize());
       
   562                 }
       
   563 
       
   564             iLayout->Env().SetRefreshMode(EAlfRefreshModeAutomatic);
       
   565 
       
   566             }
       
   567         }
       
   568     }
       
   569 
       
   570 
       
   571 // ---------------------------------------------------------------------------
       
   572 // From class MFsTreeItemVisualizer.
       
   573 // A call to this function means that the item goes out of the visible items
       
   574 // scope.
       
   575 // ---------------------------------------------------------------------------
       
   576 //
       
   577 void CFsTreeRichItemVisualizer::Hide( const TInt aTimeout )
       
   578     {
       
   579     FUNC_LOG;
       
   580     if ( iLayout )
       
   581         {
       
   582         iParentLayout->Remove( iLayout, aTimeout );
       
   583         iLayout->RemoveAndDestroyAllD();
       
   584         iLayout = NULL;
       
   585         iParentLayout = NULL;
       
   586         iTextLayout = NULL;
       
   587         iIconMarked = NULL;
       
   588         iIconMenu = NULL;
       
   589         iIconVisual = NULL;
       
   590         }
       
   591     }
       
   592 
       
   593 
       
   594 // ---------------------------------------------------------------------------
       
   595 //  From MFsTreeItemVisualizer.
       
   596 //  This method marquees the text in tree item if it is too long.
       
   597 // ---------------------------------------------------------------------------
       
   598 //
       
   599 void CFsTreeRichItemVisualizer::MarqueeL(const TFsTextMarqueeType /*aMarqueeType*/,
       
   600                                          const TUint /*aMarqueeSpeed*/,
       
   601                                          const TInt /*aMarqueeStartDelay*/,
       
   602                                          const TInt /*aMarqueeCycleStartDelay*/,
       
   603                                          const TInt /*aMarqueeRepetitions*/)
       
   604     {
       
   605     FUNC_LOG;
       
   606     }
       
   607