mobilemessaging/smilui/mediasrc/SmilTextRenderer.cpp
branchRCL_3
changeset 60 7fdbb852d323
parent 0 72b543305e3a
equal deleted inserted replaced
57:ebe688cedc25 60:7fdbb852d323
       
     1 /*
       
     2 * Copyright (c) 2003-2006 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:  
       
    15 *       SMIL Player media renderer for displaying text files
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #include "SmilTextRenderer.h"
       
    22 
       
    23 #include <txtrich.h>
       
    24 #include <frmtview.h>
       
    25 
       
    26 #include <eikenv.h>
       
    27 #include <fbs.h>
       
    28 #include <gdi.h>
       
    29 
       
    30 // LAF
       
    31 #include <aknlayout.cdl.h>
       
    32 #include <applayout.cdl.h> 
       
    33 #include <aknlayoutscalable_apps.cdl.h>
       
    34 #include <aknlayoutscalable_avkon.cdl.h>
       
    35 
       
    36 #include <AknUtils.h>               // AknLayoutUtils
       
    37 #include <AknsUtils.h>              // AknsUtils
       
    38 #include <AknStatuspaneUtils.h>
       
    39 #include <AknLayoutFont.h>
       
    40 
       
    41 // pictograph support
       
    42 #include <AknPictographInterface.h>
       
    43 #include <AknPictographDrawerInterface.h>
       
    44 
       
    45 #include <msgtextutils.h>
       
    46 
       
    47 #include <smiltransitionfilter.h>
       
    48 #include <smilmediainterface.h>
       
    49 #include <smilparser.h>
       
    50 
       
    51 #ifdef TEXT_DEBUG
       
    52     #include "SmilMediaLogging.h"
       
    53 #endif
       
    54 
       
    55 //These are from LAF:
       
    56 const TInt KMarginSize = KFocusSize + 1;
       
    57 
       
    58 _LIT( KParamColor1, "foreground-color" );
       
    59 _LIT( KParamColor2, "color" );
       
    60 _LIT( KParamColor3, "ForegroundColor" );
       
    61 
       
    62 // ---------------------------------------------------------
       
    63 // CSmilTextRenderer::CSmilTextRenderer
       
    64 // ---------------------------------------------------------
       
    65 //
       
    66 CSmilTextRenderer::CSmilTextRenderer( MSmilMedia* aMedia,
       
    67                                       DRMCommon& aDrmCommon,
       
    68                                       CDRMHelper& aDrmHelper,
       
    69                                       TUint aCharset,
       
    70                                       TMsgMediaType aMediaType 
       
    71                                       ) :
       
    72     CSmilMediaRendererBase( aMediaType, aMedia, aDrmCommon, aDrmHelper ),                                     
       
    73     iCharset( aCharset ),
       
    74 #ifdef RD_SCALABLE_UI_V2 
       
    75     iNotYetDrawn( ETrue )
       
    76 #endif
       
    77     {
       
    78     }
       
    79 
       
    80 // ---------------------------------------------------------
       
    81 // CSmilTextRenderer::ConstructL
       
    82 // ---------------------------------------------------------
       
    83 //
       
    84 void CSmilTextRenderer::ConstructL( RFile& aFileHandle, CGraphicsContext& aGc )
       
    85     {
       
    86     iCustomDraw = CSmilTextRendererCustomDraw::NewL( *this, aGc );
       
    87 #ifdef RD_MSG_XHTML_SUPPORT
       
    88     if ( iMediaType == EMsgMediaXhtml )
       
    89     	{
       
    90 	    iXhtmlParser = CXhtmlParser::NewL( this );	
       
    91        	iXhtmlParser->SetMode( EFalse, ETrue );
       
    92     	}
       
    93 #endif
       
    94     CreateLayoutL();
       
    95     OpenTextL( aFileHandle );
       
    96     FormatTextL( aGc );
       
    97 #ifdef RD_SCALABLE_UI_V2    
       
    98     CCoeControl* parentControl = iMedia->Presentation()->GetPlayer()->GetControl( iMedia->Presentation() );
       
    99     SetContainerWindowL( *parentControl );
       
   100     TRect controlRect = iMedia->GetRegion()->GetRectangle();
       
   101     controlRect.Move( parentControl->Position() );
       
   102     SetRect( controlRect );
       
   103 #endif    
       
   104     }
       
   105 
       
   106 // ---------------------------------------------------------
       
   107 // CSmilTextRenderer::NewL
       
   108 // ---------------------------------------------------------
       
   109 //
       
   110 CSmilTextRenderer* CSmilTextRenderer::NewL( RFile& aFileHandle,
       
   111                                             MSmilMedia* aMedia,
       
   112                                             DRMCommon& aDrmCommon,
       
   113                                             CDRMHelper& aDrmHelper,
       
   114                                             TUint aCharset,
       
   115                                             CGraphicsContext& aGc,
       
   116                                             TMsgMediaType aMediaType 
       
   117 											)
       
   118     {
       
   119     CSmilTextRenderer* renderer = new(ELeave) CSmilTextRenderer( aMedia, 
       
   120                                                                  aDrmCommon,
       
   121                                                                  aDrmHelper,
       
   122                                                                  aCharset,
       
   123                                                                  aMediaType 
       
   124                                                                  );
       
   125     CleanupStack::PushL( renderer );
       
   126     renderer->ConstructL( aFileHandle, aGc );
       
   127     CleanupStack::Pop( renderer );
       
   128     return renderer;
       
   129     }
       
   130 
       
   131 // ---------------------------------------------------------
       
   132 // CSmilTextRenderer::~CSmilTextRenderer
       
   133 // ---------------------------------------------------------
       
   134 //
       
   135 CSmilTextRenderer::~CSmilTextRenderer()
       
   136     {
       
   137     delete iLayout; // text layout
       
   138     delete iRichText; // contained text object
       
   139     delete iCharFormatLayer; // char format layer
       
   140     delete iParaFormatLayer; // para format layer
       
   141     delete iCustomDraw;
       
   142     delete iBufferDevice;
       
   143     delete iBufferBitmap;
       
   144     delete iMaskDevice;
       
   145     delete iMaskBitmap;
       
   146 #ifdef RD_SCALABLE_UI_V2    
       
   147     delete iSBFrame;
       
   148 #endif    
       
   149 #ifdef RD_MSG_XHTML_SUPPORT
       
   150 	delete iXhtmlParser;
       
   151 #endif    
       
   152     iMedia = NULL; // For LINT
       
   153     }
       
   154 
       
   155 // ---------------------------------------------------------
       
   156 // CSmilTextRenderer::CreateLayoutL
       
   157 // ---------------------------------------------------------
       
   158 //
       
   159 void CSmilTextRenderer::CreateLayoutL()
       
   160     {
       
   161     TRect appWindowRect;
       
   162     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EApplicationWindow, appWindowRect );
       
   163     
       
   164     TAknLayoutRect mainPane;
       
   165     
       
   166     if ( AknStatuspaneUtils::StaconPaneActive() )
       
   167         {
       
   168         mainPane.LayoutRect( appWindowRect, AknLayoutScalable_Avkon::main_pane( 4 ) );   
       
   169         }
       
   170     else
       
   171         {
       
   172         mainPane.LayoutRect( appWindowRect, AknLayoutScalable_Avkon::main_pane( 0 ) );   
       
   173         }
       
   174         
       
   175     TAknLayoutRect mainSmilPane;
       
   176     mainSmilPane.LayoutRect( mainPane.Rect(), AknLayoutScalable_Apps::main_smil_pane() );
       
   177     
       
   178     TAknLayoutRect smilTextPane;
       
   179     smilTextPane.LayoutRect( mainSmilPane.Rect(), AknLayoutScalable_Apps::smil_text_pane() );
       
   180     
       
   181     TAknLayoutRect smilListTextPane;
       
   182     smilListTextPane.LayoutRect( smilTextPane.Rect(), AknLayoutScalable_Apps::list_smil_text_pane() );
       
   183     
       
   184     TAknLayoutText smiltextPane;    
       
   185     smiltextPane.LayoutText( smilListTextPane.Rect(), 
       
   186                              AknLayoutScalable_Apps::smil_text_list_pane_t1( 0, 0 ) );
       
   187     
       
   188 #ifdef RD_MSG_XHTML_SUPPORT
       
   189     if ( iMediaType == EMsgMediaXhtml )
       
   190     	{
       
   191     	TRgb textColor = smiltextPane.Color();
       
   192 
       
   193     	// Set default textColor for xhtml text
       
   194     	iXhtmlParser->SetDefaultTextColor( textColor );
       
   195     	
       
   196     	TAknLayoutText smilSmalltextPane;    
       
   197         smilSmalltextPane.LayoutText( smilListTextPane.Rect(), 
       
   198                                       AknLayoutScalable_Apps::smil_text_list_pane_t1( 0, 1 ) );
       
   199         
       
   200         TAknLayoutText smilLargetextPane;    
       
   201         smilLargetextPane.LayoutText( smilListTextPane.Rect(), 
       
   202                                       AknLayoutScalable_Apps::smil_text_list_pane_t1( 0, 2 ) );
       
   203     	
       
   204     	iXhtmlParser->SetFonts( smilLargetextPane.Font(),
       
   205 	                            smiltextPane.Font(),
       
   206 	                            smilSmalltextPane.Font(),
       
   207 	                            smiltextPane.Font() );   
       
   208     	}          
       
   209 #endif
       
   210 
       
   211     CParaFormat::TAlignment alignment( CParaFormat::ELeftAlign );
       
   212     switch ( smiltextPane.Align() )
       
   213         {
       
   214         case CGraphicsContext::ELeft:
       
   215             {
       
   216             alignment = CParaFormat::ELeftAlign;
       
   217             break;
       
   218             }
       
   219         case CGraphicsContext::ECenter:
       
   220             {
       
   221             alignment = CParaFormat::ECenterAlign;
       
   222             break;
       
   223             }
       
   224         case CGraphicsContext::ERight:
       
   225             {
       
   226             alignment = CParaFormat::ERightAlign;
       
   227             break;
       
   228             }
       
   229         default:
       
   230             {
       
   231             break;
       
   232             }
       
   233         }
       
   234     
       
   235     iLineHeight = smiltextPane.TextRect().Height();
       
   236     
       
   237     // Creates paragraph formatting parameter container.
       
   238     CParaFormat paraFormat;
       
   239     TParaFormatMask paraFormatMask;
       
   240     
       
   241     // Set up correct line spacing control parameters.
       
   242     paraFormatMask.SetAttrib( EAttLineSpacingControl );
       
   243     paraFormat.iLineSpacingControl = CParaFormat::ELineSpacingExactlyInPixels;
       
   244     
       
   245     paraFormatMask.SetAttrib( EAttLineSpacing );
       
   246     paraFormat.iLineSpacingInTwips = iLineHeight;
       
   247     
       
   248     // Set up correct horizontal alignment parameters.
       
   249     paraFormatMask.SetAttrib( EAttAlignment );
       
   250     paraFormat.iHorizontalAlignment = alignment;
       
   251 
       
   252     // Creates character formatting parameter container.
       
   253     TCharFormat charFormat;
       
   254     TCharFormatMask formatMask;
       
   255     
       
   256     // Set up correct character font.
       
   257     formatMask.SetAttrib( EAttFontTypeface );
       
   258     formatMask.SetAttrib( EAttFontHeight );
       
   259     formatMask.SetAttrib( EAttFontPosture );
       
   260     formatMask.SetAttrib( EAttFontStrokeWeight );
       
   261     
       
   262     charFormat.iFontSpec = smiltextPane.Font()->FontSpecInTwips();
       
   263 
       
   264     // Set up correct character color.
       
   265     formatMask.SetAttrib( EAttColor );
       
   266     charFormat.iFontPresentation.iTextColor = ResolveTextColorL( smiltextPane.Color() );
       
   267 
       
   268     iParaFormatLayer = CParaFormatLayer::NewL( &paraFormat, paraFormatMask );
       
   269     iCharFormatLayer = CCharFormatLayer::NewL( charFormat, formatMask );
       
   270     
       
   271     iRichText = CRichText::NewL( iParaFormatLayer, iCharFormatLayer );
       
   272     
       
   273     iLayout = CTextLayout::NewL( iRichText, iMedia->GetRectangle().Width() );
       
   274     iLayout->SetCustomDraw( iCustomDraw );
       
   275     
       
   276     // Do not automatically inflate the ascents inside Form 
       
   277     iLayout->SetFontHeightIncreaseFactor( 0 ); 
       
   278     
       
   279     // Allow minimum descent of 0
       
   280     iLayout->SetMinimumLineDescent( 0 );
       
   281     
       
   282     const CAknLayoutFont* layoutFont = CAknLayoutFont::AsCAknLayoutFontOrNull( smiltextPane.Font() );
       
   283     
       
   284     // Font must always be an CAknLayoutFont otherwise we cannot continue.
       
   285     if ( !layoutFont )
       
   286         {
       
   287         return;
       
   288         }
       
   289     
       
   290     const CFbsFont* fbsFont = NULL;
       
   291 
       
   292     if ( layoutFont->TypeUid() == KCFbsFontUid )
       
   293         {
       
   294         fbsFont = static_cast<const CFbsFont*>( layoutFont );
       
   295         }
       
   296     
       
   297     // Font maximum height & width.
       
   298     TInt maxHeight( 0 );
       
   299     
       
   300     if ( fbsFont && fbsFont->IsOpenFont() )
       
   301         {
       
   302         // FORM itself uses an OpenFont MaxHeight it if can get it. Account for this:
       
   303         TOpenFontMetrics metrics;
       
   304         fbsFont->GetFontMetrics( metrics );
       
   305         
       
   306         maxHeight = metrics.MaxHeight();
       
   307         }
       
   308     else
       
   309         {
       
   310         maxHeight = layoutFont->AscentInPixels();
       
   311         }
       
   312     
       
   313     // This space around the glyph areas is for cursor and highlight extensions but it 
       
   314     // might also be used by font.
       
   315     TAknTextDecorationMetrics decorationMetrics( layoutFont );
       
   316     
       
   317     TInt topMargin( 0 );
       
   318     TInt bottomMargin( 0 );
       
   319     decorationMetrics.GetTopAndBottomMargins( topMargin, bottomMargin );
       
   320    
       
   321     // This is the difference between what "ascent" I need, and the prediction of what FORM will use:
       
   322     TInt extraRoomForHighGlyphs = layoutFont->TextPaneTopToBaseline() - maxHeight;
       
   323     
       
   324     // Need to create dummy textView object as SetExcessHeightRequired is not exported for
       
   325     // CTextLayout. CTextView will not take ownership of iLayout.
       
   326     TRect empty;
       
   327     CTextView* texView = CTextView::NewL( iLayout, 
       
   328                                           empty, 
       
   329                                           NULL, 
       
   330                                           NULL, 
       
   331                                           &Window(), 
       
   332                                           NULL,
       
   333                                           &iCoeEnv->WsSession() );
       
   334     
       
   335     // Have to convince Form to draw into the ascent area.
       
   336     TInt excessHeightRequired = extraRoomForHighGlyphs + topMargin;
       
   337     texView->SetExcessHeightRequired( excessHeightRequired );
       
   338     
       
   339     delete texView; // Will not delete layout.
       
   340     }
       
   341 
       
   342 
       
   343 // ---------------------------------------------------------
       
   344 // CSmilTextRenderer::OpenTextL
       
   345 // ---------------------------------------------------------
       
   346 //
       
   347 void CSmilTextRenderer::OpenTextL( RFile& aFileHandle )
       
   348     {
       
   349     if ( iMediaType == EMsgMediaXhtml )
       
   350     	{
       
   351 #ifdef RD_MSG_XHTML_SUPPORT
       
   352 	    RFile tempHandle;
       
   353 	    tempHandle.Duplicate( aFileHandle );
       
   354     	iXhtmlParser->CreateDomL( tempHandle );
       
   355     	iError = 0;
       
   356     	BeginActiveWait();
       
   357     	User::LeaveIfError( iError );
       
   358 #endif    	
       
   359     	}
       
   360     else
       
   361     	{
       
   362 	    CMsgTextUtils* textUtils = CMsgTextUtils::NewL( iCoeEnv->FsSession() );
       
   363 	    CleanupStack::PushL( textUtils );
       
   364 	    
       
   365 	    TUint charset = textUtils->MibIdToCharconvIdL( iCharset );
       
   366 	    
       
   367 	    CleanupStack::PopAndDestroy( textUtils );
       
   368 	    
       
   369 	    RFile tempHandle;
       
   370 	    tempHandle.Duplicate( aFileHandle );
       
   371 	    
       
   372 	    RFileReadStream inputStream( tempHandle ); // Owns tempHandle
       
   373 	    CleanupClosePushL( inputStream );
       
   374 	    
       
   375 	    CPlainText::TImportExportParam param;
       
   376 	    param.iForeignEncoding = charset;
       
   377 	    CPlainText::TImportExportResult result;
       
   378 	    iRichText->ImportTextL( 0, inputStream, param, result );
       
   379 	    
       
   380 	    CleanupStack::PopAndDestroy( &inputStream );
       
   381     	}
       
   382     }
       
   383 
       
   384 // ---------------------------------------------------------
       
   385 // CSmilTextRenderer::ResolveTextColorL
       
   386 // ---------------------------------------------------------
       
   387 //
       
   388 TRgb CSmilTextRenderer::ResolveTextColorL( TRgb aDefaultColor ) const
       
   389     {
       
   390     TRgb textColor = aDefaultColor;
       
   391     TPtrC fgColor = iMedia->GetParam( KParamColor1 );
       
   392     if ( !fgColor.Length() )
       
   393         {
       
   394         fgColor.Set( iMedia->GetParam( KParamColor2 ) );
       
   395         }
       
   396     if ( !fgColor.Length() )
       
   397         {
       
   398         fgColor.Set( iMedia->GetParam( KParamColor3 ) );
       
   399         }
       
   400     if ( fgColor.Length() )
       
   401         {
       
   402         TBool transparent = EFalse;
       
   403         textColor = CSmilParser::ParseColor( fgColor, transparent );
       
   404         }
       
   405     return textColor;
       
   406     }
       
   407 
       
   408 // ---------------------------------------------------------
       
   409 // CSmilTextRenderer::FormatTextL
       
   410 // ---------------------------------------------------------
       
   411 //
       
   412 void CSmilTextRenderer::FormatTextL( const CGraphicsContext& aGc )
       
   413     {
       
   414     iLayout->SetImageDeviceMap( aGc.Device() );
       
   415     iLayout->SetFormatMode( CLayoutData::EFScreenMode,
       
   416                             iMedia->GetRectangle().Width(),
       
   417                             NULL );
       
   418                             
       
   419     MSmilRegion* region = iMedia->GetRegion();
       
   420     if ( region )
       
   421         {
       
   422         TInt maxWidth = region->GetRectangle().Width();
       
   423         maxWidth = Max( 0, maxWidth - ( 2 * KMarginSize ) );
       
   424         
       
   425         iLayout->SetBandHeight( CLayoutData::EFHeightForFormattingAllText );
       
   426         iLayout->SetWrapWidth( maxWidth );
       
   427         iLayout->FormatBandL();
       
   428         
       
   429         if ( iLayout->FormattedHeightInPixels() >
       
   430              region->GetRectangle().Height() - ( 2 * KMarginSize) )
       
   431             {
       
   432             //scrolling needed
       
   433             iScrollBar = ETrue;
       
   434             
       
   435             if ( !AknStatuspaneUtils::StaconPaneActive() )
       
   436                 {
       
   437                 // Calculates how much text is hidden under control pane and
       
   438                 // adds so many line breaks to the end of the text as is neccesary
       
   439                 // for all the text to become visible when it is scrolled.
       
   440                 TRect invisibleRect( region->GetRectangle() );
       
   441             
       
   442                 CCoeControl* parent = iMedia->Presentation()->GetPlayer()->GetControl( iMedia->Presentation() );
       
   443                 invisibleRect.Move( parent->PositionRelativeToScreen() );
       
   444                 
       
   445                 TRect controlPaneRect;
       
   446                 AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EControlPane, controlPaneRect );
       
   447                 
       
   448                 invisibleRect.Intersection( controlPaneRect );
       
   449                 if ( invisibleRect.Height() > 0 && 
       
   450                      iLineHeight > 0 )
       
   451                     {
       
   452                     TInt linesToAdd = invisibleRect.Height() / iLineHeight;
       
   453                     linesToAdd++;
       
   454                     
       
   455                     while ( linesToAdd > 0 )
       
   456                         {
       
   457                         iRichText->InsertL( iRichText->DocumentLength(), CEditableText::ELineBreak);
       
   458                         linesToAdd--;
       
   459                         }
       
   460                     }
       
   461                 }
       
   462 
       
   463 #ifdef RD_SCALABLE_UI_V2           
       
   464             
       
   465             TRect mainpaneRect;
       
   466             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainpaneRect );
       
   467     
       
   468             TAknLayoutRect scrollBarRect;
       
   469             scrollBarRect.LayoutRect( mainpaneRect, AknLayoutScalable_Avkon::scroll_pane(0) );
       
   470     
       
   471             iLayout->SetWrapWidth( Max( 0, ( maxWidth - scrollBarRect.Rect().Width() ) ) );
       
   472 #else
       
   473             iLayout->SetWrapWidth( Max( 0, ( maxWidth - KScrollBarSize ) ) );
       
   474 #endif            
       
   475             iLayout->FormatBandL();
       
   476             }
       
   477         }
       
   478     else
       
   479         {
       
   480         iLayout->SetWrapWidth( IntrinsicWidth() );
       
   481         iLayout->FormatBandL();
       
   482         }
       
   483     }
       
   484 
       
   485 
       
   486 // ---------------------------------------------------------
       
   487 // CSmilTextRenderer::IsVisual
       
   488 // ---------------------------------------------------------
       
   489 //
       
   490 TBool CSmilTextRenderer::IsVisual() const
       
   491     {
       
   492     return ETrue;
       
   493     }
       
   494 
       
   495 // ---------------------------------------------------------
       
   496 // CSmilTextRenderer::IsScrollable
       
   497 // ---------------------------------------------------------
       
   498 //
       
   499 TBool CSmilTextRenderer::IsScrollable() const
       
   500     {
       
   501     return iScrollBar;
       
   502     }
       
   503 
       
   504 // ---------------------------------------------------------
       
   505 // CSmilTextRenderer::IntrinsicWidth
       
   506 // ---------------------------------------------------------
       
   507 //
       
   508 TInt CSmilTextRenderer::IntrinsicWidth() const
       
   509     {
       
   510     return iMedia->GetRectangle().Width();
       
   511     }
       
   512 
       
   513 // ---------------------------------------------------------
       
   514 // CSmilTextRenderer::IntrinsicHeight
       
   515 // ---------------------------------------------------------
       
   516 //
       
   517 TInt CSmilTextRenderer::IntrinsicHeight() const
       
   518     {
       
   519     return iMedia->GetRectangle().Height();
       
   520     }
       
   521 
       
   522 // ---------------------------------------------------------
       
   523 // CSmilTextRenderer::SeekMediaL
       
   524 // ---------------------------------------------------------
       
   525 //
       
   526 void CSmilTextRenderer::SeekMediaL( const TSmilTime& /*aTime*/ )
       
   527     {
       
   528     }
       
   529 
       
   530 
       
   531 // ---------------------------------------------------------
       
   532 // CSmilTextRenderer::PrepareMediaL
       
   533 // ---------------------------------------------------------
       
   534 //
       
   535 void CSmilTextRenderer::PrepareMediaL()
       
   536     {
       
   537 #ifdef TEXT_DEBUG
       
   538     SMILUILOGGER_ENTERFN( "Text: PrepareMediaL" );
       
   539 #endif
       
   540 #ifdef RD_SCALABLE_UI_V2    
       
   541     CCoeControl* parentControl = iMedia->Presentation()->GetPlayer()->GetControl( iMedia->Presentation() );
       
   542     TRect controlRect( iMedia->GetRegion()->GetRectangle() );
       
   543     controlRect.Move( parentControl->Position() );
       
   544     SetRect( controlRect );
       
   545 #endif    
       
   546     }
       
   547 
       
   548 // ---------------------------------------------------------
       
   549 // CSmilTextRenderer::ShowMediaL
       
   550 // ---------------------------------------------------------
       
   551 //
       
   552 void CSmilTextRenderer::ShowMediaL()
       
   553     {
       
   554 #ifdef TEXT_DEBUG
       
   555     SMILUILOGGER_ENTERFN( "Text: ShowMediaL" );
       
   556 #endif
       
   557     iShowing = ETrue;    
       
   558     iMedia->Redraw();
       
   559     }
       
   560 
       
   561 // ---------------------------------------------------------
       
   562 // CSmilTextRenderer::HideMedia
       
   563 // ---------------------------------------------------------
       
   564 //
       
   565 void CSmilTextRenderer::HideMedia()
       
   566     {
       
   567 #ifdef TEXT_DEBUG
       
   568     SMILUILOGGER_ENTERFN( "Text: HideMedia" );
       
   569 #endif
       
   570     iShowing = EFalse;
       
   571     iMedia->Redraw();
       
   572 #ifdef RD_SCALABLE_UI_V2    
       
   573     iNotYetDrawn = ETrue;
       
   574     if ( iSBFrame )
       
   575         {
       
   576         TRAP_IGNORE( iSBFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff, 
       
   577                                                         CEikScrollBarFrame::EOff ) );
       
   578         }
       
   579 #endif        
       
   580     }
       
   581 
       
   582 // ---------------------------------------------------------
       
   583 // CSmilTextRenderer::FreezeMedia
       
   584 // ---------------------------------------------------------
       
   585 //
       
   586 void CSmilTextRenderer::FreezeMedia()
       
   587     {
       
   588 #ifdef TEXT_DEBUG
       
   589     SMILUILOGGER_ENTERFN( "Text: FreezeMedia" );
       
   590 #endif
       
   591     }
       
   592 
       
   593 // ---------------------------------------------------------
       
   594 // CSmilTextRenderer::ResumeMedia
       
   595 // ---------------------------------------------------------
       
   596 //
       
   597 void CSmilTextRenderer::ResumeMedia()
       
   598     {
       
   599 #ifdef TEXT_DEBUG
       
   600     SMILUILOGGER_ENTERFN( "Text: ResumeMedia" );
       
   601 #endif
       
   602     }
       
   603 
       
   604 // ---------------------------------------------------------
       
   605 // CSmilTextRenderer::Draw
       
   606 // ---------------------------------------------------------
       
   607 //
       
   608 void CSmilTextRenderer::Draw( CGraphicsContext& aGc,
       
   609                           const TRect& aRect,
       
   610                           CSmilTransitionFilter* aTransitionFilter,
       
   611                           const MSmilFocus* aFocus)
       
   612     {
       
   613     if (iShowing)
       
   614         {
       
   615         TRect overallRect( iMedia->GetRectangle() );
       
   616         overallRect.Shrink( KMarginSize, KMarginSize );
       
   617               
       
   618         TBool drawLayout( ETrue );
       
   619         
       
   620         // Move the text to start after scroll bar on mirrored
       
   621         // layout when scroll bar is present.
       
   622         if ( AknLayoutUtils::LayoutMirrored() && iScrollBar )
       
   623             {
       
   624 #ifdef RD_SCALABLE_UI_V2
       
   625             TRect mainpaneRect;
       
   626             AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainpaneRect );
       
   627             
       
   628             TAknLayoutRect scrollBarRect;
       
   629             scrollBarRect.LayoutRect( mainpaneRect, AknLayoutScalable_Avkon::scroll_pane(0) );
       
   630             
       
   631             overallRect.iTl.iX = overallRect.iTl.iX + scrollBarRect.Rect().Width() + 1;
       
   632 #else
       
   633             overallRect.iTl.iX = overallRect.iTl.iX + KScrollBarSize + 1;
       
   634 #endif
       
   635             if ( overallRect.iTl.iX > overallRect.iBr.iX )
       
   636                 {
       
   637                 overallRect.iTl.iX = overallRect.iBr.iX;
       
   638                 }
       
   639             }
       
   640         
       
   641         if ( aTransitionFilter )
       
   642             {
       
   643             TRAPD( err, DrawTransitionL( aGc, aTransitionFilter, overallRect ) );
       
   644             if ( err != KErrNone )
       
   645                 {
       
   646                 delete iBufferBitmap;
       
   647                 iBufferBitmap = NULL;
       
   648                 
       
   649                 delete iBufferDevice;
       
   650                 iBufferDevice = NULL;
       
   651                 
       
   652                 delete iMaskBitmap;
       
   653                 iMaskBitmap = NULL;
       
   654                 
       
   655                 delete iMaskDevice;
       
   656                 iMaskDevice = NULL;
       
   657                 }
       
   658             else
       
   659                 {
       
   660                 //transition was properly drawn
       
   661                 //->Don't draw "normal" layout
       
   662                 drawLayout = EFalse;
       
   663                 }
       
   664             }
       
   665        
       
   666         if ( drawLayout )
       
   667             {
       
   668             TRect updateRect( aRect );
       
   669             updateRect.Intersection( overallRect );
       
   670             
       
   671             iDrawContext.SetGc( &aGc );
       
   672             iDrawContext.iViewRect = overallRect;
       
   673             iDrawContext.SetDrawToEveryPixel( EFalse );
       
   674         
       
   675             TRAP_IGNORE( 
       
   676                 {
       
   677                 iLayout->DrawL( updateRect, &iDrawContext );
       
   678                 
       
   679                 if ( iScrollBar )
       
   680                     {           
       
   681                     DrawScrollBarL( aGc, updateRect );
       
   682                     } 
       
   683                 } );
       
   684             }
       
   685         }
       
   686 
       
   687     if ( aFocus )
       
   688         {
       
   689         DrawFocus( aGc, aFocus );
       
   690         }
       
   691     }
       
   692 
       
   693 // ---------------------------------------------------------
       
   694 // CSmilTextRenderer::GetText
       
   695 // ---------------------------------------------------------
       
   696 //
       
   697 EXPORT_C CPlainText* CSmilTextRenderer::GetText()
       
   698     {
       
   699     return static_cast<CPlainText*>( iRichText );
       
   700     }
       
   701 
       
   702 // ---------------------------------------------------------
       
   703 // CSmilTextRenderer::DrawPictoCallback
       
   704 // ---------------------------------------------------------
       
   705 //
       
   706 void CSmilTextRenderer::DrawPictoCallback() const
       
   707     {
       
   708     iMedia->Redraw();
       
   709     }
       
   710 
       
   711 // ---------------------------------------------------------
       
   712 // CSmilTextRenderer::Scroll
       
   713 // ---------------------------------------------------------
       
   714 //
       
   715 void CSmilTextRenderer::Scroll(TInt /*aDirX*/, TInt aDirY)
       
   716     {
       
   717 #ifdef TEXT_DEBUG
       
   718     SMILUILOGGER_WRITEF( _L("Text: Scroll, deltaY=%d"), aDirY );
       
   719 #endif
       
   720     ScrollWithOutThumbUpdate( aDirY * iLineHeight );
       
   721 #ifdef RD_SCALABLE_UI_V2    
       
   722     if ( iThumbPos > 0 && aDirY < 0 ||
       
   723         iThumbPos < iScrollSpan - 
       
   724             (iMedia->GetRegion()->GetRectangle().Height() )/ iLineHeight
       
   725          && aDirY > 0 )
       
   726     //the thumbspan needs to be substracted from the scrollspan          
       
   727         {
       
   728         iThumbPos += aDirY;
       
   729         iSBFrame->MoveVertThumbTo( iThumbPos );        
       
   730         }
       
   731 #endif        
       
   732     }
       
   733 
       
   734 // ---------------------------------------------------------
       
   735 // CSmilTextRenderer::ScrollWithOutThumbUpdate
       
   736 // This function is for scrolling when no thumbupdate is needed
       
   737 // ---------------------------------------------------------
       
   738 //
       
   739 void CSmilTextRenderer::ScrollWithOutThumbUpdate( TInt aDirY )
       
   740     {
       
   741 #ifdef TEXT_DEBUG
       
   742     SMILUILOGGER_WRITEF( _L("Text: ScrollWithOutThumbUpdate, aDirY=%d"), aDirY );
       
   743 #endif
       
   744     TInt remaining = 
       
   745         iLayout->FormattedHeightInPixels() - 
       
   746         ( iLayout->PixelsAboveBand() + 
       
   747         iMedia->GetRegion()->GetRectangle().Height() - ( 2 * KMarginSize ) );
       
   748     if ( remaining <= 0 && -aDirY < 0 )
       
   749         {
       
   750         return;
       
   751         }
       
   752     if ( aDirY > remaining )
       
   753         {
       
   754         aDirY = remaining;
       
   755         }
       
   756     TInt scrollValue = - aDirY;        
       
   757     TRAPD( error, iLayout->ChangeBandTopL( scrollValue, 
       
   758             CTextLayout::EFAllowScrollingBlankSpace ) );
       
   759     if ( error == KErrNone )
       
   760         {
       
   761         iMedia->Redraw();
       
   762         }
       
   763     }
       
   764     
       
   765 
       
   766 // ---------------------------------------------------------
       
   767 // CSmilTextRenderer::DrawScrollBarL
       
   768 // ---------------------------------------------------------
       
   769 //
       
   770 void CSmilTextRenderer::DrawScrollBarL( 
       
   771 #ifdef RD_SCALABLE_UI_V2
       
   772                                      CGraphicsContext& /*aGc*/,
       
   773 #else
       
   774                                      CGraphicsContext& aGc,
       
   775 #endif
       
   776                                       const TRect& /*aRect*/ ) 
       
   777     {
       
   778 #ifdef RD_SCALABLE_UI_V2
       
   779     if ( iNotYetDrawn )
       
   780         {
       
   781         if ( !iSBFrame )
       
   782             {
       
   783             iSBFrame = new (ELeave) CEikScrollBarFrame( this, this, ETrue );
       
   784             iSBFrame->CreateDoubleSpanScrollBarsL(ETrue, EFalse, ETrue, EFalse );
       
   785             iSBFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EDoubleSpan );
       
   786             iScrollSpan = (iLayout->FormattedHeightInPixels()+ ( 2 * KMarginSize )) / iLineHeight;
       
   787             if ( iScrollSpan *iLineHeight != 
       
   788                     (iLayout->FormattedHeightInPixels()+ ( 2 * KMarginSize ))   )
       
   789                 {
       
   790                 iScrollSpan += 1;
       
   791                 }
       
   792             }
       
   793        //these steps need to be redone as most likely 
       
   794        // TileL-function needs to be recalled also when only reactivating the existing bar
       
   795         iSBFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,CEikScrollBarFrame::EOn );    
       
   796          
       
   797         TEikScrollBarModel hSbarModel;
       
   798         TEikScrollBarModel vSbarModel;
       
   799         vSbarModel.iThumbPosition = iThumbPos; 
       
   800         vSbarModel.iScrollSpan = iScrollSpan;
       
   801         vSbarModel.iThumbSpan = iMedia->GetRegion()->GetRectangle().Height() / iLineHeight;
       
   802 
       
   803         // For EDoubleSpan type scrollbar
       
   804         TAknDoubleSpanScrollBarModel hDsSbarModel(hSbarModel);
       
   805         TAknDoubleSpanScrollBarModel vDsSbarModel(vSbarModel);
       
   806 
       
   807         TEikScrollBarFrameLayout layout;
       
   808         layout.iTilingMode = TEikScrollBarFrameLayout::EInclusiveRectConstant;
       
   809 
       
   810         TRect rect( Rect( ) ); 
       
   811         rect.Shrink( KMarginSize,KMarginSize );
       
   812 
       
   813         //Should have separate variable for "inclusiveRect" and "clientRect"
       
   814         TRect inclusiveRect( rect );
       
   815         TRect clientRect( rect );
       
   816                    
       
   817         iSBFrame->TileL( &hDsSbarModel, &vDsSbarModel, clientRect, inclusiveRect, layout );
       
   818    
       
   819         iSBFrame->SetVFocusPosToThumbPos( iThumbPos );
       
   820            
       
   821         iSBFrame->GetScrollBarHandle( CEikScrollBar::EVertical )->DrawDeferred();
       
   822         iNotYetDrawn = EFalse;
       
   823         Window().Invalidate();
       
   824         }
       
   825 #else
       
   826     TRect regionRect = iMedia->GetRegion()->GetRectangle();
       
   827     TRect textRect( regionRect );
       
   828     textRect.iTl.iY -= iLayout->PixelsAboveBand();
       
   829     textRect.iBr.iY = textRect.iTl.iY + iLayout->FormattedHeightInPixels();
       
   830 
       
   831     // from CSmilMediaRendererBase:
       
   832     DrawScrollBars( aGc, regionRect, textRect );
       
   833         
       
   834 #endif            
       
   835     }
       
   836 
       
   837 // ---------------------------------------------------------
       
   838 // CSmilTextRenderer::DrawTransitionL
       
   839 // ---------------------------------------------------------
       
   840 //
       
   841 void CSmilTextRenderer::DrawTransitionL( CGraphicsContext& aGc,
       
   842                                         CSmilTransitionFilter* aTransitionFilter,
       
   843                                         const TRect& aRect )
       
   844     {
       
   845     if ( !iBufferBitmap )
       
   846         {
       
   847         iBufferBitmap = new (ELeave) CFbsBitmap();
       
   848         User::LeaveIfError( iBufferBitmap->Create( aRect.Size(), EColor4K ) );
       
   849         iBufferDevice = CFbsBitmapDevice::NewL( iBufferBitmap );
       
   850     
       
   851         iMaskBitmap = new (ELeave) CFbsBitmap();
       
   852         User::LeaveIfError( iMaskBitmap->Create( aRect.Size(), EGray2 ) );
       
   853         iMaskDevice = CFbsBitmapDevice::NewL( iMaskBitmap );
       
   854         }
       
   855 
       
   856     CBitmapContext* bitmapContext = NULL;
       
   857     CBitmapContext* maskContext = NULL;
       
   858 
       
   859     User::LeaveIfError( iBufferDevice->CreateBitmapContext( bitmapContext ) );
       
   860     User::LeaveIfError( iMaskDevice->CreateBitmapContext( maskContext ) );
       
   861 
       
   862     TRect bitmapRect( TPoint(0,0), aRect.Size() );
       
   863 
       
   864     maskContext->SetBrushStyle( CGraphicsContext::ESolidBrush );
       
   865     maskContext->SetPenStyle( CGraphicsContext::ENullPen );
       
   866     maskContext->SetBrushColor( TRgb(0,0,0) );
       
   867     maskContext->DrawRect( bitmapRect );
       
   868 
       
   869     iDrawContext.SetGc( bitmapContext );
       
   870     iDrawContext.iViewRect = bitmapRect;
       
   871     
       
   872     TInt err = KErrNone;
       
   873     TRAP( err, iLayout->DrawL( bitmapRect, &iDrawContext ) );
       
   874 
       
   875     iDrawContext.SetGc( maskContext );                
       
   876     iCustomDraw->SetWhite( ETrue );
       
   877     TRAP( err, iLayout->DrawL( bitmapRect, &iDrawContext ) );
       
   878     iCustomDraw->SetWhite( EFalse );
       
   879 
       
   880     aTransitionFilter->Draw(
       
   881         aGc,
       
   882         bitmapRect,
       
   883         iBufferBitmap,
       
   884         aRect.iTl,
       
   885         iMaskBitmap );
       
   886 
       
   887     delete bitmapContext;
       
   888     delete maskContext;
       
   889     }
       
   890 
       
   891 // ---------------------------------------------------------
       
   892 // CSmilTextRendererCustomDraw::NewL
       
   893 // ---------------------------------------------------------
       
   894 //
       
   895 CSmilTextRendererCustomDraw* CSmilTextRendererCustomDraw::NewL(
       
   896     const CSmilTextRenderer& aParent,
       
   897     CGraphicsContext& aGc )
       
   898     {
       
   899     CSmilTextRendererCustomDraw* self = 
       
   900         new (ELeave) CSmilTextRendererCustomDraw( aParent, aGc );
       
   901     CleanupStack::PushL( self );
       
   902     self->ConstructL();
       
   903     CleanupStack::Pop( self );
       
   904     return self;
       
   905     }
       
   906 
       
   907 // ---------------------------------------------------------
       
   908 // CSmilTextRendererCustomDraw::ConstructL
       
   909 // ---------------------------------------------------------
       
   910 //
       
   911 void CSmilTextRendererCustomDraw::ConstructL()
       
   912     {
       
   913     iPictographDrawer = CAknPictographInterface::NewL(
       
   914         static_cast<CCoeControl&>( const_cast<CSmilTextRenderer&>( iParent ) ),
       
   915         *static_cast<MAknPictographAnimatorCallBack*>( this ) );
       
   916     }
       
   917 
       
   918 // ---------------------------------------------------------
       
   919 // CSmilTextRendererCustomDraw::CSmilTextRendererCustomDraw
       
   920 // ---------------------------------------------------------
       
   921 //
       
   922 CSmilTextRendererCustomDraw::CSmilTextRendererCustomDraw(
       
   923         const CSmilTextRenderer& aParent,
       
   924         CGraphicsContext& aGc ) :
       
   925     iParent( aParent ),
       
   926     iGc( aGc )
       
   927     {
       
   928     }
       
   929 
       
   930 // ---------------------------------------------------------
       
   931 // CSmilTextRendererCustomDraw::~CSmilTextRendererCustomDraw
       
   932 // ---------------------------------------------------------
       
   933 //
       
   934 CSmilTextRendererCustomDraw::~CSmilTextRendererCustomDraw()
       
   935     {
       
   936     delete iPictographDrawer;
       
   937     }
       
   938 
       
   939 // ---------------------------------------------------------
       
   940 // CSmilTextRendererCustomDraw::DrawBackground
       
   941 // ---------------------------------------------------------
       
   942 //
       
   943 void CSmilTextRendererCustomDraw::DrawBackground( const TParam& aParam,
       
   944                                                  const TRgb& /*aRgb*/,
       
   945                                                  TRect& aDrawn ) const 
       
   946     {
       
   947     aDrawn = aParam.iDrawRect;
       
   948     }
       
   949 
       
   950 
       
   951 // ---------------------------------------------------------
       
   952 // CSmilTextRendererCustomDraw::DrawText
       
   953 // ---------------------------------------------------------
       
   954 //
       
   955 void CSmilTextRendererCustomDraw::DrawText( const TParam& aParam,
       
   956               const TLineInfo& aLineInfo,
       
   957               const TCharFormat& aFormat,
       
   958               const TDesC& aText,
       
   959               const TPoint& aTextOrigin,
       
   960               TInt aExtraPixels ) const
       
   961     {
       
   962     if ( iWhite )
       
   963         {
       
   964         aParam.iGc.SetPenColor( KRgbWhite );
       
   965         }
       
   966 
       
   967     MFormCustomDraw::DrawText(
       
   968         aParam,
       
   969         aLineInfo,
       
   970         aFormat,
       
   971         aText,
       
   972         aTextOrigin,
       
   973         aExtraPixels );
       
   974 
       
   975     // Draw pictographs if the feature is supported.
       
   976     // Character justification is not supported.
       
   977     if ( iPictographDrawer && !aExtraPixels )
       
   978         {
       
   979         CBitmapContext* bitmapGc = NULL;
       
   980         bitmapGc = static_cast<CBitmapContext*>(&iGc);
       
   981         
       
   982         const TText* text = aText.Ptr();
       
   983         TInt length( aText.Length() );
       
   984 
       
   985         MAknPictographDrawer* drawer =
       
   986             iPictographDrawer->Interface();
       
   987 
       
   988         CFont* font = NULL;
       
   989         aParam.iMap.GetNearestFontInTwips( font, aFormat.iFontSpec );
       
   990 
       
   991         if ( font )
       
   992             {
       
   993             for ( TInt i = 0 ; i < length ; i++ )
       
   994                 {
       
   995                 if ( drawer->IsPictograph( text[i] ) )
       
   996                     {
       
   997                     TPoint point = aParam.iDrawRect.iTl;            
       
   998                     point.iX += font->TextWidthInPixels( aText.Left( i ) );
       
   999                     point.iY += font->AscentInPixels();
       
  1000 
       
  1001                     drawer->DrawPictographsInText(
       
  1002                         *bitmapGc,
       
  1003                         *font,
       
  1004                         aText.Mid( i, 1 ),
       
  1005                         point );
       
  1006                     }
       
  1007                 }
       
  1008 
       
  1009             aParam.iMap.ReleaseFont( font );
       
  1010             }
       
  1011         }
       
  1012     }
       
  1013 
       
  1014 // ---------------------------------------------------------
       
  1015 // CSmilTextRendererCustomDraw::SetWhite
       
  1016 // ---------------------------------------------------------
       
  1017 //
       
  1018 void CSmilTextRendererCustomDraw::SetWhite( TBool aWhite )
       
  1019     {
       
  1020     iWhite = aWhite;
       
  1021     }
       
  1022 
       
  1023 // ---------------------------------------------------------
       
  1024 // CSmilTextRendererCustomDraw::DrawPictographArea
       
  1025 // ---------------------------------------------------------
       
  1026 //
       
  1027 void CSmilTextRendererCustomDraw::DrawPictographArea()
       
  1028     {
       
  1029     iParent.DrawPictoCallback();
       
  1030     }
       
  1031 #ifdef RD_SCALABLE_UI_V2   
       
  1032 // -----------------------------------------------------------------------------
       
  1033 // CSmilTextRenderer::HandleScrollEventL
       
  1034 // -----------------------------------------------------------------------------
       
  1035 // 
       
  1036 void CSmilTextRenderer::HandleScrollEventL( 
       
  1037                     CEikScrollBar* aScrollBar, TEikScrollEvent aEventType )
       
  1038     {
       
  1039     const TInt KScrollValue = iLineHeight;
       
  1040     const TInt KScrollPageValue = iMedia->GetRegion()->GetRectangle().Height();
       
  1041     if ( AknLayoutUtils::PenEnabled() )
       
  1042         {
       
  1043         TInt oldThumbPos = iThumbPos;
       
  1044         iThumbPos = aScrollBar->ThumbPosition();
       
  1045     	switch ( aEventType )
       
  1046     		{ 
       
  1047        		case EEikScrollUp:
       
  1048        		    ScrollWithOutThumbUpdate( -KScrollValue );
       
  1049        		    break;
       
  1050        		case EEikScrollDown:
       
  1051        		    ScrollWithOutThumbUpdate( KScrollValue );
       
  1052        		    break;
       
  1053    		    case EEikScrollPageUp:
       
  1054    		        {
       
  1055    		        ScrollWithOutThumbUpdate( -KScrollPageValue );
       
  1056    		        break;
       
  1057    		        }
       
  1058    		    case EEikScrollPageDown:
       
  1059    		        {
       
  1060    		        ScrollWithOutThumbUpdate( KScrollPageValue );
       
  1061    		        break;
       
  1062    		        }
       
  1063         	case EEikScrollThumbDragVert:
       
  1064         	    {
       
  1065    		        //update the shown page to match with the thumb position
       
  1066                 ScrollWithOutThumbUpdate( (iThumbPos - oldThumbPos)*KScrollValue );    
       
  1067         	    break;
       
  1068         	    }
       
  1069         	   		        
       
  1070        		case EEikScrollLeft:
       
  1071     		case EEikScrollRight:
       
  1072         	case EEikScrollPageLeft:
       
  1073         	case EEikScrollPageRight:
       
  1074         	case EEikScrollThumbDragHoriz:
       
  1075         	case EEikScrollThumbReleaseHoriz:
       
  1076         	case EEikScrollThumbReleaseVert:	
       
  1077             case EEikScrollHome:
       
  1078         	case EEikScrollTop:
       
  1079         	case EEikScrollEnd:
       
  1080         	case EEikScrollBottom:
       
  1081        		default:
       
  1082        		    // Do nothing
       
  1083        			break;
       
  1084        			}
       
  1085         }
       
  1086     } 
       
  1087 #else
       
  1088 void CSmilTextRenderer::HandleScrollEventL( 
       
  1089                     CEikScrollBar* /*aScrollBar*/, TEikScrollEvent /*aEventType*/ )
       
  1090     {  }
       
  1091 #endif
       
  1092 
       
  1093 // -----------------------------------------------------------------------------
       
  1094 // CSmilTextRenderer::CompleteL
       
  1095 // Call back function used to inform a client of the Parser
       
  1096 // when a parsing operation completes.
       
  1097 // -----------------------------------------------------------------------------
       
  1098 //	
       
  1099 void CSmilTextRenderer::ParseCompleteL()
       
  1100 	{
       
  1101 #ifdef RD_MSG_XHTML_SUPPORT
       
  1102 	CRichText& text = *iRichText;
       
  1103     iXhtmlParser->ParseL( text );
       
  1104     EndActiveWait();
       
  1105 #endif	
       
  1106 	}
       
  1107 	
       
  1108 // -----------------------------------------------------------------------------
       
  1109 // CSmilTextRenderer::ParseError
       
  1110 // Call back function used to inform a client of the Parser
       
  1111 // about error.
       
  1112 // -----------------------------------------------------------------------------
       
  1113 //	
       
  1114 void CSmilTextRenderer::ParseError( TInt aError )
       
  1115 	{
       
  1116 	iError = aError;
       
  1117 #ifdef RD_MSG_XHTML_SUPPORT
       
  1118 	EndActiveWait();
       
  1119 #endif	
       
  1120 	}
       
  1121 
       
  1122 // End of file