emailuis/uicomponents/src/fstextviewer.cpp
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c)  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:  Implementation of class CFsTextViewer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //<cmail> removed __FS_ALFRED_SUPPORT flag
       
    20 //#include <fsconfig.h>
       
    21 //</cmail> removed __FS_ALFRED_SUPPORT flag
       
    22 // <cmail> SF
       
    23 #include "emailtrace.h"
       
    24 #include <alf/alfbrush.h>
       
    25 #include <alf/alfimagebrush.h>
       
    26 #include <alf/alfgradientbrush.h>
       
    27 // </cmail>
       
    28 
       
    29 #include "fstextviewer.h"
       
    30 #include "fstextviewercontrol.h"
       
    31 #include "fstextviewervisualizer.h"
       
    32 #include "fstextviewerkeys.h"
       
    33 #include "fstextviewervisualizersettings.h"
       
    34 #include "fstextviewervisualizerdata.h"
       
    35 
       
    36 // ---------------------------------------------------------------------------
       
    37 // NewL
       
    38 // ---------------------------------------------------------------------------
       
    39 EXPORT_C CFsTextViewer* CFsTextViewer::NewL ( CAlfEnv& aEnv )
       
    40     {
       
    41     FUNC_LOG;
       
    42     CFsTextViewer* self = new ( ELeave ) CFsTextViewer( aEnv );
       
    43     CleanupStack::PushL( self );
       
    44     self->ConstructL( aEnv );
       
    45     CleanupStack::Pop( self );
       
    46     return self;
       
    47     }
       
    48 
       
    49 // ---------------------------------------------------------------------------
       
    50 // ~CFsTextViewer
       
    51 // ---------------------------------------------------------------------------
       
    52 EXPORT_C CFsTextViewer::~CFsTextViewer()
       
    53     {
       
    54     FUNC_LOG;
       
    55     delete iControl->Keys();
       
    56 
       
    57     delete iVisualizer;
       
    58     iVisualizer = NULL;
       
    59 
       
    60     for ( TInt i = 0; i < iSettings->iPartBgs.Count(); ++i )
       
    61         {
       
    62         delete iSettings->iPartBgs[i].iBrush;
       
    63         }
       
    64 
       
    65     delete iSettings;
       
    66     iSettings = NULL;
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // GetControl
       
    71 // ---------------------------------------------------------------------------
       
    72 EXPORT_C CAlfControl* CFsTextViewer::GetControl() const
       
    73     {
       
    74     FUNC_LOG;
       
    75     return static_cast< CAlfControl* >( iControl );
       
    76     }
       
    77 
       
    78 // ---------------------------------------------------------------------------
       
    79 // SetText
       
    80 // ---------------------------------------------------------------------------
       
    81 EXPORT_C void CFsTextViewer::SetTextL( 
       
    82         CFsRichText* aText, 
       
    83         CFsSmileyDictionary* aSmDict )
       
    84     {
       
    85     FUNC_LOG;
       
    86     if ( iVisualizer )
       
    87         {
       
    88         delete iVisualizer;
       
    89         iVisualizer = NULL;
       
    90         }
       
    91 
       
    92     iVisualizer = CFsTextViewerVisualizer::NewL( 
       
    93             *iControl, 
       
    94             aText, 
       
    95             aSmDict, 
       
    96             iSettings );
       
    97     if ( iBackColorSet )
       
    98         {
       
    99         iVisualizer->SetBackgroundColorL( iColor );
       
   100         }
       
   101     if ( iTexture )
       
   102         {
       
   103         iVisualizer->SetBackgroundImageL( *iTexture );
       
   104         }
       
   105 
       
   106     iVisualizer->RefreshPartBgsL();
       
   107 
       
   108     iControl->SetVisualizer( iVisualizer );
       
   109     }
       
   110 
       
   111 // ---------------------------------------------------------------------------
       
   112 // Show
       
   113 // ---------------------------------------------------------------------------
       
   114 EXPORT_C void CFsTextViewer::Show()
       
   115     {
       
   116     FUNC_LOG;
       
   117     
       
   118     }
       
   119 
       
   120 // ---------------------------------------------------------------------------
       
   121 // Hide
       
   122 // ---------------------------------------------------------------------------
       
   123 EXPORT_C void CFsTextViewer::Hide()
       
   124     {
       
   125     FUNC_LOG;
       
   126     
       
   127     }
       
   128 
       
   129 // ---------------------------------------------------------------------------
       
   130 // SetObserver
       
   131 // ---------------------------------------------------------------------------
       
   132 EXPORT_C void CFsTextViewer::SetObserver( MFsTextViewerObserver* aObserver )
       
   133     {
       
   134     FUNC_LOG;
       
   135     iControl->SetObserver( aObserver );
       
   136     }
       
   137 
       
   138 // ---------------------------------------------------------------------------
       
   139 // SetScrollOffsetInPx
       
   140 // ---------------------------------------------------------------------------
       
   141 EXPORT_C void CFsTextViewer::SetScrollOffsetInPx( TInt aPxOffset )
       
   142     {
       
   143     FUNC_LOG;
       
   144     iVisualizer->SetScrollOffsetInPx( aPxOffset );
       
   145     }
       
   146 
       
   147 // ---------------------------------------------------------------------------
       
   148 // SetScrollOffsetInLines
       
   149 // ---------------------------------------------------------------------------
       
   150 EXPORT_C void CFsTextViewer::SetScrollOffsetInLines( TInt aLineOffset )
       
   151     {
       
   152     FUNC_LOG;
       
   153     iVisualizer->SetScrollOffsetInLines( aLineOffset );
       
   154     }
       
   155 
       
   156 // ---------------------------------------------------------------------------
       
   157 // SetSmileySize
       
   158 // ---------------------------------------------------------------------------
       
   159 EXPORT_C void CFsTextViewer::SetSmileySize( TSize aSize )
       
   160     {
       
   161     FUNC_LOG;
       
   162     iVisualizer->SetSmileySize( aSize );
       
   163     }
       
   164 
       
   165 // ---------------------------------------------------------------------------
       
   166 // SetScrollDelay
       
   167 // ---------------------------------------------------------------------------
       
   168 EXPORT_C void CFsTextViewer::SetScrollDelay( TInt aDelay )
       
   169     {
       
   170     FUNC_LOG;
       
   171     iVisualizer->SetScrollDelay( aDelay );
       
   172     }
       
   173 
       
   174 // ---------------------------------------------------------------------------
       
   175 // SetCursorDelay
       
   176 // ---------------------------------------------------------------------------
       
   177 EXPORT_C void CFsTextViewer::SetCursorDelay( TInt aDelay )
       
   178     {
       
   179     FUNC_LOG;
       
   180     iVisualizer->SetCursorDelay( aDelay );
       
   181     }
       
   182 
       
   183 // ---------------------------------------------------------------------------
       
   184 // EnableSmileys
       
   185 // ---------------------------------------------------------------------------
       
   186 EXPORT_C void CFsTextViewer::EnableSmileys( TBool aStatus )
       
   187     {
       
   188     FUNC_LOG;
       
   189     if ( iVisualizer )
       
   190         {
       
   191         iVisualizer->EnableSmileys( aStatus );
       
   192         }
       
   193     }
       
   194 
       
   195 // ---------------------------------------------------------------------------
       
   196 // Smileys
       
   197 // ---------------------------------------------------------------------------
       
   198 EXPORT_C TBool CFsTextViewer::Smileys()
       
   199     {
       
   200     FUNC_LOG;
       
   201     TBool retVal = ETrue;
       
   202     if ( iVisualizer )
       
   203         {
       
   204         retVal = iVisualizer->SmileysEnabled();
       
   205         }
       
   206     return retVal;
       
   207     }
       
   208 
       
   209 // ---------------------------------------------------------------------------
       
   210 // ReloadTextL
       
   211 // ---------------------------------------------------------------------------
       
   212 EXPORT_C void CFsTextViewer::ReloadTextL()
       
   213     {
       
   214     FUNC_LOG;
       
   215     if ( iVisualizer )
       
   216         {
       
   217         iVisualizer->ReloadL();
       
   218         }
       
   219     }
       
   220 
       
   221 // ---------------------------------------------------------------------------
       
   222 // GetCurrentHotspotL
       
   223 // ---------------------------------------------------------------------------
       
   224 EXPORT_C void CFsTextViewer::GetCurrentHotspotL( TInt& aBegin, TInt& aEnd )
       
   225     {
       
   226     FUNC_LOG;
       
   227     iVisualizer->GetHotspotRangeL( aBegin, aEnd );
       
   228     }
       
   229 
       
   230 // ---------------------------------------------------------------------------
       
   231 // GetMarkedArea
       
   232 // ---------------------------------------------------------------------------
       
   233 EXPORT_C void CFsTextViewer::GetMarkedArea( TInt& aBegin, TInt& aEnd )
       
   234     {
       
   235     FUNC_LOG;
       
   236     iVisualizer->GetMarkedRange( aBegin, aEnd );
       
   237     }
       
   238 
       
   239 // ---------------------------------------------------------------------------
       
   240 // EnableCursorUpDown
       
   241 // ---------------------------------------------------------------------------
       
   242 EXPORT_C void CFsTextViewer::EnableCursorUpDown( TBool aStatus )
       
   243     {
       
   244     FUNC_LOG;
       
   245     iControl->EnableCursorScroll( aStatus );
       
   246     }
       
   247 
       
   248 // ---------------------------------------------------------------------------
       
   249 // CursorUpDown
       
   250 // ---------------------------------------------------------------------------
       
   251 EXPORT_C TBool CFsTextViewer::CursorUpDown()
       
   252     {
       
   253     FUNC_LOG;
       
   254     return iControl->CursorScroll();
       
   255     }
       
   256 
       
   257 // ---------------------------------------------------------------------------
       
   258 // CFsTextViewer
       
   259 // ---------------------------------------------------------------------------
       
   260 EXPORT_C void CFsTextViewer::SetCustomKeys( CFsTextViewerKeys* aKeys )
       
   261     {
       
   262     FUNC_LOG;
       
   263     if ( iControl )
       
   264         {
       
   265         if ( aKeys != iControl->Keys() )
       
   266             {
       
   267             CFsTextViewerKeys* keys = NULL;
       
   268             
       
   269             keys = iControl->Keys();
       
   270             
       
   271             delete keys;
       
   272             keys = NULL;
       
   273             }
       
   274         iControl->SetKeys( aKeys );
       
   275         }
       
   276     }
       
   277 
       
   278 // ---------------------------------------------------------------------------
       
   279 // Keys
       
   280 // ---------------------------------------------------------------------------
       
   281 EXPORT_C CFsTextViewerKeys* CFsTextViewer::Keys()
       
   282     {
       
   283     FUNC_LOG;
       
   284     CFsTextViewerKeys* retVal = NULL;
       
   285     if ( iControl )
       
   286         {
       
   287         retVal = iControl->Keys();
       
   288         }
       
   289     return retVal;
       
   290     }
       
   291 
       
   292 // ---------------------------------------------------------------------------
       
   293 // SetWatermark
       
   294 // ---------------------------------------------------------------------------
       
   295 EXPORT_C void CFsTextViewer::SetWatermarkL( 
       
   296         CFsTextViewerWatermark* aWatermark )
       
   297     {
       
   298     FUNC_LOG;
       
   299     iWatermark = aWatermark;
       
   300     if ( iVisualizer )
       
   301         {
       
   302         iVisualizer->SetWatermarkL( iWatermark );
       
   303         }
       
   304     }
       
   305 
       
   306 // ---------------------------------------------------------------------------
       
   307 // RootLayout
       
   308 // ---------------------------------------------------------------------------
       
   309 EXPORT_C CAlfLayout* CFsTextViewer::RootLayout()
       
   310     {
       
   311     FUNC_LOG;
       
   312     CAlfLayout* retVal = NULL;
       
   313     if ( iVisualizer )
       
   314         {
       
   315         retVal = iVisualizer->RootLayout();
       
   316         }
       
   317     return retVal;
       
   318     }
       
   319 
       
   320 // ---------------------------------------------------------------------------
       
   321 // SetBackgroundColor
       
   322 // ---------------------------------------------------------------------------
       
   323 EXPORT_C void CFsTextViewer::SetBackgroundColorL( const TRgb& aColor )
       
   324     {
       
   325     FUNC_LOG;
       
   326     iColor = aColor;
       
   327     iBackColorSet = ETrue;
       
   328     if ( iVisualizer )
       
   329         {
       
   330         iVisualizer->SetBackgroundColorL( iColor );
       
   331         }
       
   332     }
       
   333 
       
   334 // ---------------------------------------------------------------------------
       
   335 // SetBackgroundImage
       
   336 // ---------------------------------------------------------------------------
       
   337 EXPORT_C void CFsTextViewer::SetBackgroundImageL( CAlfTexture& aTexture )
       
   338     {
       
   339     FUNC_LOG;
       
   340     iTexture = &aTexture;
       
   341     if ( iVisualizer )
       
   342         {
       
   343         iVisualizer->SetBackgroundImageL( *iTexture );
       
   344         }
       
   345     }
       
   346 
       
   347 // ---------------------------------------------------------------------------
       
   348 // SetBackgroundOpacity
       
   349 // ---------------------------------------------------------------------------
       
   350 EXPORT_C void CFsTextViewer::SetBackgroundOpacity( const TAlfTimedValue& aOpacity )
       
   351     {
       
   352     FUNC_LOG;
       
   353     iSettings->iBackgroundOpacity = aOpacity;
       
   354     if ( iVisualizer )
       
   355         {
       
   356         iVisualizer->SetBackgroundOpacity();
       
   357         }
       
   358     }
       
   359 
       
   360 // ---------------------------------------------------------------------------
       
   361 // BackgroundOpacity
       
   362 // ---------------------------------------------------------------------------
       
   363 EXPORT_C const TAlfTimedValue& CFsTextViewer::BackgroundOpacity() const 
       
   364     {
       
   365     FUNC_LOG;
       
   366     return iSettings->iBackgroundOpacity;
       
   367     }
       
   368 
       
   369 // ---------------------------------------------------------------------------
       
   370 // SetPartBgColor
       
   371 // ---------------------------------------------------------------------------
       
   372 EXPORT_C void CFsTextViewer::SetPartBgColorL( 
       
   373         TInt aStartChar, 
       
   374         TInt aEndChar, 
       
   375         const TRgb& aColor )
       
   376     {
       
   377     FUNC_LOG;
       
   378     TFsPartBg background;
       
   379     background.iBrush = CAlfGradientBrush::NewL(iControl->Env());
       
   380     static_cast<CAlfGradientBrush*>( background.iBrush )->SetColor( aColor );
       
   381     background.iStart = aStartChar;
       
   382     background.iEnd = aEndChar;
       
   383     iSettings->iPartBgs.AppendL( background );
       
   384     if ( iVisualizer )
       
   385         {
       
   386         iVisualizer->RefreshPartBgsL();
       
   387         }
       
   388     }
       
   389 
       
   390 // ---------------------------------------------------------------------------
       
   391 // SetPartBgImage
       
   392 // ---------------------------------------------------------------------------
       
   393 EXPORT_C void CFsTextViewer::SetPartBgImageL( TInt aStartChar, TInt aEndChar, 
       
   394                                                 CAlfTexture& aTexture )
       
   395     {
       
   396     FUNC_LOG;
       
   397     TFsPartBg background;
       
   398     background.iBrush = CAlfImageBrush::NewL( iControl->Env(),TAlfImage( aTexture ) );
       
   399     background.iStart = aStartChar;
       
   400     background.iEnd = aEndChar;
       
   401     iSettings->iPartBgs.AppendL( background );
       
   402     if ( iVisualizer )
       
   403         {
       
   404         iVisualizer->RefreshPartBgsL();
       
   405         }
       
   406     }
       
   407 
       
   408 // ---------------------------------------------------------------------------
       
   409 // SetLiteLineBg
       
   410 // ---------------------------------------------------------------------------
       
   411 EXPORT_C void CFsTextViewer::SetLiteLineBg( 
       
   412         CAlfTexture& aTexture, 
       
   413         TReal32 aOpacity )
       
   414     {
       
   415     FUNC_LOG;
       
   416     iSettings->iHighlightLine = &aTexture;
       
   417     iSettings->iHighlightLineOpacity = aOpacity;
       
   418     }
       
   419 
       
   420 // ---------------------------------------------------------------------------
       
   421 // SetActionButton
       
   422 // ---------------------------------------------------------------------------
       
   423 EXPORT_C void CFsTextViewer::SetActionButton( 
       
   424         CAlfTexture& aTexture, 
       
   425         TReal32 aOpacity )
       
   426     {
       
   427     FUNC_LOG;
       
   428     iSettings->iActionButton = &aTexture;
       
   429     iSettings->iActionButtonOpacity = aOpacity;
       
   430     }
       
   431 
       
   432 // ---------------------------------------------------------------------------
       
   433 // SetActionButtonMargin
       
   434 // ---------------------------------------------------------------------------
       
   435 EXPORT_C void CFsTextViewer::SetActionButtonMargin( TReal32 aMargin )
       
   436     {
       
   437     FUNC_LOG;
       
   438     iSettings->iActionButtonMargin = aMargin;
       
   439     }
       
   440 
       
   441 // ---------------------------------------------------------------------------
       
   442 // SetActionButtonSize
       
   443 // ---------------------------------------------------------------------------
       
   444 EXPORT_C void CFsTextViewer::SetActionButtonSize( 
       
   445         TReal32 aWidth, 
       
   446         TReal32 aHeight )
       
   447     {
       
   448     FUNC_LOG;
       
   449     iSettings->iActionButtonWidth = aWidth;
       
   450     iSettings->iActionButtonHeight = aHeight;
       
   451     }
       
   452 
       
   453 // ---------------------------------------------------------------------------
       
   454 // CFsTextViewer
       
   455 // ---------------------------------------------------------------------------
       
   456 EXPORT_C void CFsTextViewer::SetMirroring( TBool aEnable )
       
   457     {
       
   458     FUNC_LOG;
       
   459     iSettings->iMirroring = aEnable;
       
   460     }
       
   461 
       
   462 // ---------------------------------------------------------------------------
       
   463 // GetTotalLines
       
   464 // ---------------------------------------------------------------------------
       
   465 EXPORT_C TInt CFsTextViewer::GetTotalLines()
       
   466     {
       
   467     FUNC_LOG;
       
   468     return iVisualizer->iTotalLines;
       
   469     }
       
   470 
       
   471 // ---------------------------------------------------------------------------
       
   472 // GetFirstDisplayedLine
       
   473 // ---------------------------------------------------------------------------
       
   474 EXPORT_C TInt CFsTextViewer::GetFirstDisplayedLine()
       
   475     {
       
   476     FUNC_LOG;
       
   477     TInt retVal = 0;
       
   478     if ( iVisualizer->Navigator()->GetLastVisible() )
       
   479         {
       
   480         retVal = iVisualizer->Navigator()->GetFirstVisible()->iLineNumber;
       
   481         }
       
   482 
       
   483     return retVal;
       
   484     }
       
   485 
       
   486 // <cmail>
       
   487 // ---------------------------------------------------------------------------
       
   488 // GetLineOffset - get offset of first char in the line (line offset)
       
   489 // ---------------------------------------------------------------------------
       
   490 EXPORT_C TInt CFsTextViewer::GetFirstCharInLine(TInt aLineNum)
       
   491     {
       
   492     FUNC_LOG;
       
   493     return iVisualizer->Navigator()->GetFirstCharInLine(aLineNum);
       
   494     }
       
   495 
       
   496 
       
   497 // ---------------------------------------------------------------------------
       
   498 // GetCharLineNumber - get the line number for the given line offset
       
   499 // ---------------------------------------------------------------------------
       
   500 EXPORT_C TInt CFsTextViewer::GetLineNumber(TInt aChar)
       
   501     {
       
   502     FUNC_LOG;
       
   503     return iVisualizer->Navigator()->GetCharLineNumber(aChar);
       
   504     }
       
   505 
       
   506 // </cmail>
       
   507 
       
   508 // ---------------------------------------------------------------------------
       
   509 // GetLastDisplayedLine
       
   510 // ---------------------------------------------------------------------------
       
   511 EXPORT_C TInt CFsTextViewer::GetLastDisplayedLine()
       
   512     {
       
   513     FUNC_LOG;
       
   514     TInt retVal = 0;
       
   515     if ( iVisualizer->Navigator()->GetLastVisible() )
       
   516         {
       
   517         retVal = iVisualizer->Navigator()->GetLastVisible()->iLineNumber + 1;
       
   518         }
       
   519 
       
   520     return retVal;
       
   521     }
       
   522 
       
   523 // ---------------------------------------------------------------------------
       
   524 // RemoveEndLines
       
   525 // ---------------------------------------------------------------------------
       
   526 EXPORT_C void CFsTextViewer::RemoveEndLinesL( TInt aLines )
       
   527     {
       
   528     FUNC_LOG;
       
   529     iVisualizer->RemoveEndLinesL( aLines );
       
   530     }
       
   531 
       
   532 // ---------------------------------------------------------------------------
       
   533 // ReplaceTextL
       
   534 // ---------------------------------------------------------------------------
       
   535 EXPORT_C void CFsTextViewer::ReplaceTextL( 
       
   536         CFsRichText* aRichText, 
       
   537         CFsSmileyDictionary* aSmDict )
       
   538     {
       
   539     FUNC_LOG;
       
   540     iVisualizer->ReplaceTextL( aRichText, aSmDict );
       
   541     }
       
   542 
       
   543 // ---------------------------------------------------------------------------
       
   544 // FocusLineL
       
   545 // ---------------------------------------------------------------------------
       
   546 EXPORT_C void CFsTextViewer::FocusLineL( TInt aLine, TBool aShowAsFirstLine )
       
   547     {
       
   548     FUNC_LOG;
       
   549     if ( iVisualizer && aLine > 0 )
       
   550         {
       
   551         iVisualizer->FocusLineL( aLine, aShowAsFirstLine );
       
   552         }
       
   553     }
       
   554 
       
   555 // ---------------------------------------------------------------------------
       
   556 // SetLeftMargin
       
   557 // ---------------------------------------------------------------------------
       
   558 EXPORT_C void CFsTextViewer::SetLeftMargin( TInt aMargin )
       
   559     {
       
   560     FUNC_LOG;
       
   561     if ( iSettings )
       
   562         {
       
   563         iSettings->iLeftMargin = aMargin;
       
   564         }
       
   565     }
       
   566 
       
   567 // ---------------------------------------------------------------------------
       
   568 // SetRightMargin
       
   569 // ---------------------------------------------------------------------------
       
   570 EXPORT_C void CFsTextViewer::SetRightMargin( TInt aMargin )
       
   571     {
       
   572     FUNC_LOG;
       
   573     if ( iSettings )
       
   574         {
       
   575         iSettings->iRightMargin = aMargin;
       
   576         }
       
   577     }
       
   578 
       
   579 // ---------------------------------------------------------------------------
       
   580 // ReloadPicturesL
       
   581 // ---------------------------------------------------------------------------
       
   582 EXPORT_C void CFsTextViewer::ReloadPicturesL( TInt aLine )
       
   583     {
       
   584     FUNC_LOG;
       
   585     if ( iVisualizer )
       
   586         {
       
   587         iVisualizer->ReloadPicturesL( aLine );
       
   588         }
       
   589     }
       
   590 
       
   591 // ---------------------------------------------------------------------------
       
   592 // GetVisibleFocusedHotspotLine
       
   593 // ---------------------------------------------------------------------------
       
   594 EXPORT_C TBool CFsTextViewer::GetVisibleFocusedHotspotLine( 
       
   595         TInt& aLineNum ) const
       
   596     {
       
   597     FUNC_LOG;
       
   598     TBool retVal = EFalse;
       
   599     if ( iVisualizer )
       
   600         {
       
   601         retVal = iVisualizer->GetVisibleFocusedHotspotLine( aLineNum );
       
   602         }
       
   603 
       
   604     return retVal;
       
   605     }
       
   606 
       
   607 // ---------------------------------------------------------------------------
       
   608 // HideActionButtonFromCurrentHighlightedHotspot
       
   609 // ---------------------------------------------------------------------------
       
   610 EXPORT_C void CFsTextViewer::HideActionButtonFromCurrentHighlightedHotspot()
       
   611     {
       
   612     FUNC_LOG;
       
   613     if ( iVisualizer && iVisualizer->Navigator())
       
   614         {
       
   615         iVisualizer
       
   616             ->Navigator()
       
   617             ->HideActionButtonFromCurrentHighlightedHotspot();
       
   618         }
       
   619     }
       
   620     
       
   621 // ---------------------------------------------------------------------------
       
   622 // ShowActionButtonForCurrentHighlightedHotspotL
       
   623 // ---------------------------------------------------------------------------
       
   624 EXPORT_C void CFsTextViewer::ShowActionButtonForCurrentHighlightedHotspotL()
       
   625     {
       
   626     FUNC_LOG;
       
   627     if ( iVisualizer && iVisualizer->Navigator())
       
   628         {
       
   629         iVisualizer
       
   630             ->Navigator()
       
   631             ->ShowActionButtonForCurrentHighlightedHotspotL();
       
   632         }
       
   633     }
       
   634 
       
   635 // ---------------------------------------------------------------------------
       
   636 // SetCurrentHotspotByOrderL
       
   637 // ---------------------------------------------------------------------------
       
   638 // <cmail>
       
   639 EXPORT_C void CFsTextViewer::SetCurrentHotspotByOrderL( TInt aIndex, TBool aFocusLine )
       
   640     {
       
   641     FUNC_LOG;
       
   642     if ( iVisualizer )
       
   643         {
       
   644         iVisualizer->SetCurrentHotspotByOrderL( aIndex, aFocusLine );
       
   645         }
       
   646     }
       
   647 
       
   648 EXPORT_C TInt CFsTextViewer::GetCurrentHotspotByOrder()
       
   649     {
       
   650     FUNC_LOG;
       
   651     if ( iVisualizer )
       
   652         {
       
   653         return iVisualizer->GetCurrentHotspotByOrder();
       
   654         }
       
   655     else
       
   656         {
       
   657         return KErrNotFound;
       
   658         }
       
   659     }
       
   660 // </cmail>
       
   661 // ---------------------------------------------------------------------------
       
   662 // SetCurrentHotspotByCharL
       
   663 // ---------------------------------------------------------------------------
       
   664 EXPORT_C void CFsTextViewer::SetCurrentHotspotByCharL( TInt aIndex )
       
   665     {
       
   666     FUNC_LOG;
       
   667     if ( iVisualizer )
       
   668         {
       
   669         iVisualizer->SetCurrentHotspotByCharL( aIndex );
       
   670         }
       
   671     }
       
   672 
       
   673 // ---------------------------------------------------------------------------
       
   674 // GetStatusLayout
       
   675 // ---------------------------------------------------------------------------
       
   676 EXPORT_C CAlfLayout* CFsTextViewer::GetStatusLayout()
       
   677     {
       
   678     FUNC_LOG;
       
   679     return iVisualizer->GetStatusLayout();
       
   680     }
       
   681 
       
   682 // ---------------------------------------------------------------------------
       
   683 // UpdateStatusLayout
       
   684 // ---------------------------------------------------------------------------
       
   685 EXPORT_C void CFsTextViewer::UpdateStatusLayout()
       
   686     {
       
   687     FUNC_LOG;
       
   688     iVisualizer->UpdateStatusLayout();
       
   689     }
       
   690 
       
   691 // ---------------------------------------------------------------------------
       
   692 // RemoveStatusLayout
       
   693 // ---------------------------------------------------------------------------
       
   694 EXPORT_C void CFsTextViewer::RemoveStatusLayout()
       
   695     {
       
   696     FUNC_LOG;
       
   697     iVisualizer->RemoveStatusLayout();
       
   698     }
       
   699 
       
   700 // ---------------------------------------------------------------------------
       
   701 // GetCurrentHotspotTextL
       
   702 // ---------------------------------------------------------------------------
       
   703 EXPORT_C HBufC* CFsTextViewer::GetCurrentHotspotTextL()
       
   704     {
       
   705     FUNC_LOG;
       
   706     return iVisualizer->GetCurrentHotspotTextL();
       
   707     }
       
   708 
       
   709 // ---------------------------------------------------------------------------
       
   710 // CFsTextViewer
       
   711 // ---------------------------------------------------------------------------
       
   712 CFsTextViewer::CFsTextViewer( CAlfEnv& /* aEnv */ )
       
   713     {
       
   714     FUNC_LOG;
       
   715     iBackColorSet = EFalse;
       
   716     }
       
   717 
       
   718 // ---------------------------------------------------------------------------
       
   719 // ConstructL
       
   720 // ---------------------------------------------------------------------------
       
   721 void CFsTextViewer::ConstructL( CAlfEnv& aEnv )
       
   722     {
       
   723     FUNC_LOG;
       
   724     iControl = CFsTextViewerControl::NewL( aEnv );
       
   725     iControl->SetKeys( CFsTextViewerKeys::NewL() );
       
   726     iSettings = new ( ELeave ) CFsTextViewerVisualizerSettings();
       
   727     }
       
   728