mobilemessaging/smilui/mediasrc/SmilSVGRenderer.cpp
branchRCL_3
changeset 27 7fdbb852d323
parent 0 72b543305e3a
equal deleted inserted replaced
26:ebe688cedc25 27:7fdbb852d323
       
     1 /*
       
     2 * Copyright (c) 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:   Implementation of CSmilSVGRenderer class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <AknUtils.h>
       
    23 #include <AknsUtils.h>
       
    24 #include <data_caging_path_literals.hrh>
       
    25 #include <gulicon.h>
       
    26 
       
    27 #include <aknlayoutscalable_apps.cdl.h>
       
    28 #include <aknlayoutscalable_avkon.cdl.h>
       
    29 
       
    30 #include <AknDialog.h>
       
    31 #include <SVGTUIDialog.h>
       
    32 #include <SVGEngineInterfaceImpl.h>
       
    33 #include <SVGTAppObserverUtil.h>
       
    34 
       
    35 #include <smilmedia.h>
       
    36 #include <uniutils.mbg>
       
    37 
       
    38 #include "SmilSVGRenderer.h"
       
    39 #include "MMediaFactoryFileInfo.h"
       
    40 
       
    41 //#define SVG_DEBUG
       
    42 #ifdef SVG_DEBUG
       
    43 #include "SmilMediaLogging.h"
       
    44 #endif
       
    45 
       
    46 // EXTERNAL DATA STRUCTURES
       
    47 
       
    48 // EXTERNAL FUNCTION PROTOTYPES  
       
    49 
       
    50 // CONSTANTS
       
    51 
       
    52 // MACROS
       
    53 
       
    54 // LOCAL CONSTANTS AND MACROS
       
    55 const TInt KSVGDefaultDuration = 5000;
       
    56 
       
    57 _LIT( KUniUtilsBitmapFile, "uniutils.mbm" );
       
    58 
       
    59 // MODULE DATA STRUCTURES
       
    60 
       
    61 // LOCAL FUNCTION PROTOTYPES
       
    62 
       
    63 // FORWARD DECLARATIONS
       
    64 
       
    65 // ============================= LOCAL FUNCTIONS ===============================
       
    66 
       
    67 // ============================ MEMBER FUNCTIONS ===============================
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CSmilSVGRenderer::CSmilSVGRenderer
       
    71 // C++ constructor can NOT contain any code, that might leave.
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CSmilSVGRenderer::CSmilSVGRenderer( MSmilMedia* aMedia, 
       
    75                                     MMediaFactoryFileInfo* aFileInfo,
       
    76                                     DRMCommon& aDrmCommon,
       
    77                                     CDRMHelper& aDrmHelper ) :
       
    78     CSmilMediaRendererBase( EMsgMediaSvg, aMedia, aDrmCommon, aDrmHelper ),
       
    79     iFileInfo( aFileInfo )
       
    80     {
       
    81     }
       
    82 
       
    83 // -----------------------------------------------------------------------------
       
    84 // CSmilSVGRenderer::ConstructL
       
    85 // Symbian 2nd phase constructor can leave.
       
    86 // -----------------------------------------------------------------------------
       
    87 //
       
    88 void CSmilSVGRenderer::ConstructL( RFile& aFileHandle )
       
    89     {
       
    90 #ifdef SVG_DEBUG
       
    91     SMILUILOGGER_WRITE_TIMESTAMP( " --------------------------------" )
       
    92     SMILUILOGGER_ENTERFN( "[SMILUI] SVG: ConstructL" )
       
    93 #endif
       
    94 
       
    95     if ( iFileInfo == NULL )
       
    96         {
       
    97         User::Leave( KErrArgument );
       
    98         }
       
    99     
       
   100     User::LeaveIfError( iFileHandle.Duplicate( aFileHandle ) );
       
   101     
       
   102     
       
   103     BaseConstructL( iFileHandle );   
       
   104     User::LeaveIfError( CheckDRMRights() );
       
   105     
       
   106     TRect mediaRect = iMedia->GetRegion()->GetRectangle();
       
   107     
       
   108     iThumbnailBitmap = new ( ELeave ) CFbsBitmap;
       
   109     User::LeaveIfError( iThumbnailBitmap->Create( mediaRect.Size(), 
       
   110                                                   iCoeEnv->ScreenDevice()->DisplayMode() ) );
       
   111                                                   
       
   112     iThumbnailMask = new ( ELeave ) CFbsBitmap;
       
   113     User::LeaveIfError( iThumbnailMask->Create( mediaRect.Size(), 
       
   114                                                 EGray256 ) );
       
   115 	                                            
       
   116     GenerateThumbnailL();
       
   117     
       
   118     TParse fileParse;
       
   119     fileParse.Set( KUniUtilsBitmapFile, &KDC_APP_BITMAP_DIR, NULL );
       
   120     
       
   121     iIndicatorIcon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), 
       
   122                                                 KAknsIIDQgnGrafMmsPres,
       
   123                                                 fileParse.FullName(), 
       
   124                                                 EMbmUniutilsQgn_graf_mms_pres, 
       
   125                                                 EMbmUniutilsQgn_graf_mms_pres_mask );
       
   126     
       
   127     iIndicatorSize = RetrieveIconSize();
       
   128     User::LeaveIfError( AknIconUtils::SetSize( iIndicatorIcon->Bitmap(), iIndicatorSize ) );    
       
   129 
       
   130     static_cast<CSmilMedia*>( iMedia )->SetFocusable( ETrue );
       
   131     
       
   132 #ifdef SVG_DEBUG  
       
   133     SMILUILOGGER_LEAVEFN( "[SMILUI] SVG: ConstructL" )
       
   134 #endif
       
   135     }
       
   136 
       
   137 // -----------------------------------------------------------------------------
       
   138 // CSmilSVGRenderer::NewL
       
   139 // Two-phased constructor.
       
   140 // -----------------------------------------------------------------------------
       
   141 //
       
   142 CSmilSVGRenderer* CSmilSVGRenderer::NewL( RFile& aFileHandle, 
       
   143                                           MSmilMedia* aMedia,
       
   144                                           MMediaFactoryFileInfo* aFileInfo,
       
   145                                           DRMCommon& aDrmCommon,
       
   146                                           CDRMHelper& aDrmHelper )
       
   147     {
       
   148     CSmilSVGRenderer* self = new( ELeave ) CSmilSVGRenderer( aMedia, 
       
   149                                                              aFileInfo, 
       
   150                                                              aDrmCommon, 
       
   151                                                              aDrmHelper );
       
   152     
       
   153     CleanupStack::PushL( self );
       
   154     self->ConstructL( aFileHandle );
       
   155     CleanupStack::Pop( self );
       
   156 
       
   157     return self;
       
   158     }
       
   159 
       
   160     
       
   161 // -----------------------------------------------------------------------------
       
   162 // CSmilSVGRenderer::~CSmilSVGRenderer
       
   163 // (other items were commented in a header).
       
   164 // -----------------------------------------------------------------------------
       
   165 //
       
   166 CSmilSVGRenderer::~CSmilSVGRenderer()
       
   167     {
       
   168     iFileHandle.Close();
       
   169     
       
   170     delete iThumbnailBitmap;
       
   171     delete iThumbnailMask;
       
   172     delete iIndicatorIcon;
       
   173     
       
   174     delete iObserverUtil;
       
   175     
       
   176     iMedia = NULL; // For LINT
       
   177     iFileInfo = NULL; // For LINT
       
   178     }
       
   179 
       
   180 
       
   181 // -----------------------------------------------------------------------------
       
   182 // CSmilSVGRenderer::IsVisual
       
   183 // (other items were commented in a header).
       
   184 // -----------------------------------------------------------------------------
       
   185 //
       
   186 TBool CSmilSVGRenderer::IsVisual() const
       
   187     {
       
   188     return ETrue;
       
   189     }
       
   190 
       
   191 // -----------------------------------------------------------------------------
       
   192 // CSmilSVGRenderer::IntrinsicWidth
       
   193 // (other items were commented in a header).
       
   194 // -----------------------------------------------------------------------------
       
   195 //
       
   196 TInt CSmilSVGRenderer::IntrinsicWidth() const
       
   197     {
       
   198     return iThumbnailBitmap->SizeInPixels().iWidth;
       
   199     }
       
   200 
       
   201 
       
   202 // -----------------------------------------------------------------------------
       
   203 // CSmilSVGRenderer::IntrinsicHeight
       
   204 // (other items were commented in a header).
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207 TInt CSmilSVGRenderer::IntrinsicHeight() const
       
   208     {
       
   209     return iThumbnailBitmap->SizeInPixels().iHeight;
       
   210     }
       
   211 
       
   212 // -----------------------------------------------------------------------------
       
   213 // CSmilSVGRenderer::IntrinsicDuration
       
   214 // (other items were commented in a header).
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 TSmilTime CSmilSVGRenderer::IntrinsicDuration() const
       
   218     {
       
   219     return KSVGDefaultDuration;
       
   220     }
       
   221 
       
   222 // -----------------------------------------------------------------------------
       
   223 // CSmilSVGRenderer::PrepareMediaL
       
   224 // (other items were commented in a header).
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 void CSmilSVGRenderer::PrepareMediaL()
       
   228     {
       
   229     }
       
   230 
       
   231 // -----------------------------------------------------------------------------
       
   232 // CSmilSVGRenderer::SeekMediaL
       
   233 // (other items were commented in a header).
       
   234 // -----------------------------------------------------------------------------
       
   235 //
       
   236 void CSmilSVGRenderer::SeekMediaL( const TSmilTime& /*aTime*/ )
       
   237     {
       
   238     }
       
   239 
       
   240 // -----------------------------------------------------------------------------
       
   241 // CSmilSVGRenderer::ShowMediaL
       
   242 // (other items were commented in a header).
       
   243 // -----------------------------------------------------------------------------
       
   244 //
       
   245 void CSmilSVGRenderer::ShowMediaL()
       
   246     {
       
   247     iVisible = ETrue;
       
   248     iMedia->Redraw();
       
   249     }
       
   250 
       
   251 // -----------------------------------------------------------------------------
       
   252 // CSmilSVGRenderer::HideMedia
       
   253 // (other items were commented in a header).
       
   254 // -----------------------------------------------------------------------------
       
   255 //
       
   256 void CSmilSVGRenderer::HideMedia()
       
   257     {
       
   258     iVisible = EFalse;
       
   259     iMedia->Redraw();
       
   260     }
       
   261     
       
   262     // -----------------------------------------------------------------------------
       
   263 // CSmilSVGRenderer::FreezeMedia
       
   264 // (other items were commented in a header).
       
   265 // -----------------------------------------------------------------------------
       
   266 //
       
   267 void CSmilSVGRenderer::FreezeMedia()
       
   268     {
       
   269     }
       
   270     
       
   271 // -----------------------------------------------------------------------------
       
   272 // CSmilSVGRenderer::ResumeMedia
       
   273 // (other items were commented in a header).
       
   274 // -----------------------------------------------------------------------------
       
   275 //
       
   276 void CSmilSVGRenderer::ResumeMedia()
       
   277     {
       
   278     }
       
   279     
       
   280 // -----------------------------------------------------------------------------
       
   281 // CSmilSVGRenderer::Draw
       
   282 // (other items were commented in a header).
       
   283 // -----------------------------------------------------------------------------
       
   284 //
       
   285 void CSmilSVGRenderer::Draw( CGraphicsContext& aGc,
       
   286                              const TRect& /*aRect*/,
       
   287                              CSmilTransitionFilter* /*aTransitionFilter*/,
       
   288                              const MSmilFocus* aFocus )
       
   289     {
       
   290     if ( iVisible )
       
   291         {
       
   292         CBitmapContext* tmpBitmapContext = static_cast<CBitmapContext*>( &aGc );
       
   293         
       
   294         tmpBitmapContext->SetBrushStyle( CGraphicsContext::ENullBrush );
       
   295         
       
   296         tmpBitmapContext->BitBltMasked( iFocusRect.iTl, 
       
   297                                         iThumbnailBitmap,
       
   298                                         iThumbnailSize,
       
   299                                         iThumbnailMask,
       
   300                                         ETrue );
       
   301         
       
   302 
       
   303         TPoint indicatorPosition( iFocusRect.iTl.iX,
       
   304                                   iFocusRect.iBr.iY );
       
   305         
       
   306         indicatorPosition.iY -= iIndicatorSize.iHeight;
       
   307         
       
   308         tmpBitmapContext->BitBltMasked( indicatorPosition, 
       
   309                                         iIndicatorIcon->Bitmap(),
       
   310                                         iIndicatorSize,
       
   311                                         iIndicatorIcon->Mask(),
       
   312                                         ETrue );
       
   313             
       
   314         DrawFocus( aGc, aFocus );
       
   315         }
       
   316     }
       
   317 
       
   318 // -----------------------------------------------------------------------------
       
   319 // CSmilSVGRenderer::ActivateRendererL
       
   320 // (other items were commented in a header).
       
   321 // -----------------------------------------------------------------------------
       
   322 //
       
   323 EXPORT_C void CSmilSVGRenderer::ActivateRendererL()
       
   324     {                   
       
   325     CSVGTUIDialog* svgtDialog = CSVGTUIDialog::NewL();
       
   326     
       
   327     delete iObserverUtil;
       
   328     iObserverUtil = NULL;
       
   329     
       
   330     iObserverUtil = CSVGTAppObserverUtil::NewL( svgtDialog, &iFileHandle );
       
   331     
       
   332     svgtDialog->ExecuteLD( iFileHandle, this );
       
   333     }
       
   334 
       
   335 
       
   336 // -----------------------------------------------------------------------------
       
   337 // CSmilSVGRenderer::FetchImage
       
   338 // (other items were commented in a header).
       
   339 // -----------------------------------------------------------------------------
       
   340 //
       
   341 TInt CSmilSVGRenderer::FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle )
       
   342     {
       
   343     TRAPD( error, iFileInfo->GetFileHandleL( aUri, aFileHandle ) );
       
   344     
       
   345     if ( error != KErrNone )
       
   346         {
       
   347         error = iObserverUtil->FetchImage( aUri, aSession, aFileHandle );
       
   348         }
       
   349     
       
   350     return error;
       
   351     }
       
   352 
       
   353 // -----------------------------------------------------------------------------
       
   354 // CSmilSVGRenderer::LinkActivated
       
   355 // (other items were commented in a header).
       
   356 // -----------------------------------------------------------------------------
       
   357 //
       
   358 TBool CSmilSVGRenderer::LinkActivated( const TDesC& aUri )
       
   359     {
       
   360     return iObserverUtil->LinkActivated( aUri );
       
   361     }
       
   362 
       
   363 // -----------------------------------------------------------------------------
       
   364 // CSmilSVGRenderer::LinkActivatedWithShow
       
   365 // (other items were commented in a header).
       
   366 // -----------------------------------------------------------------------------
       
   367 //      
       
   368 TBool CSmilSVGRenderer::LinkActivatedWithShow( const TDesC& aUri, const TDesC& aShow )
       
   369     {
       
   370     return iObserverUtil->LinkActivatedWithShow( aUri, aShow );
       
   371     }
       
   372 
       
   373 // -----------------------------------------------------------------------------
       
   374 // CSmilSVGRenderer::DisplayDowloadMenuL
       
   375 // (other items were commented in a header).
       
   376 // -----------------------------------------------------------------------------
       
   377 //                                                    
       
   378 void CSmilSVGRenderer::DisplayDownloadMenuL()
       
   379     {
       
   380     iObserverUtil->DisplayDownloadMenuL();
       
   381     }
       
   382 
       
   383 // -----------------------------------------------------------------------------
       
   384 // CSmilSVGRenderer::GetSmilFitValue
       
   385 // (other items were commented in a header).
       
   386 // -----------------------------------------------------------------------------
       
   387 //                                              
       
   388 void CSmilSVGRenderer::GetSmilFitValue( TDes& aSmilValue )
       
   389     {
       
   390     iObserverUtil->GetSmilFitValue( aSmilValue );
       
   391     }
       
   392                                                      
       
   393 // -----------------------------------------------------------------------------
       
   394 // CSmilSVGRenderer::CanShowSave
       
   395 // (other items were commented in a header).
       
   396 // -----------------------------------------------------------------------------
       
   397 //  
       
   398 TBool CSmilSVGRenderer::CanShowSave()
       
   399     {
       
   400     return iObserverUtil->CanShowSave();
       
   401     }
       
   402 
       
   403 // -----------------------------------------------------------------------------
       
   404 // CSmilSVGRenderer::IsSavingDone
       
   405 // (other items were commented in a header).
       
   406 // -----------------------------------------------------------------------------
       
   407 // 
       
   408 TBool CSmilSVGRenderer::IsSavingDone()
       
   409     {
       
   410     return ETrue;
       
   411     }
       
   412 
       
   413 // -----------------------------------------------------------------------------
       
   414 // CSmilSVGRenderer::CanShowDownload
       
   415 // (other items were commented in a header).
       
   416 // -----------------------------------------------------------------------------
       
   417 // 
       
   418 TBool CSmilSVGRenderer::CanShowDownload() const
       
   419     {
       
   420     return iObserverUtil->CanShowDownload();
       
   421     }
       
   422 
       
   423 // -----------------------------------------------------------------------------
       
   424 // CSmilSVGRenderer::DoSaveL
       
   425 // (other items were commented in a header).
       
   426 // -----------------------------------------------------------------------------
       
   427 // 
       
   428 void CSmilSVGRenderer::DoSaveL( TInt aButtonid )
       
   429     {
       
   430     iObserverUtil->DoSaveL( aButtonid );
       
   431     }
       
   432 
       
   433 // -----------------------------------------------------------------------------
       
   434 // CSmilSVGRenderer::NewFetchImageData
       
   435 // (other items were commented in a header).
       
   436 // -----------------------------------------------------------------------------
       
   437 //                                       
       
   438 TInt CSmilSVGRenderer::NewFetchImageData( const TDesC& aUri )
       
   439     {
       
   440     return iObserverUtil->NewFetchImageData( aUri );
       
   441     }
       
   442 
       
   443 // -----------------------------------------------------------------------------
       
   444 // CSmilSVGRenderer::AssignEmbededDataL
       
   445 // (other items were commented in a header).
       
   446 // -----------------------------------------------------------------------------
       
   447 //
       
   448 void CSmilSVGRenderer::AssignEmbededDataL( const TDesC& aUri )
       
   449     {
       
   450     iObserverUtil->AssignEmbededDataL( aUri );
       
   451     }
       
   452 
       
   453 
       
   454 // -----------------------------------------------------------------------------
       
   455 // CSmilSVGRenderer::UpdateScreen
       
   456 // (other items were commented in a header).
       
   457 // -----------------------------------------------------------------------------
       
   458 //
       
   459 void CSmilSVGRenderer::UpdateScreen()
       
   460     {    
       
   461     }
       
   462 
       
   463 // -----------------------------------------------------------------------------
       
   464 // CSmilSVGRenderer::ScriptCall
       
   465 // (other items were commented in a header).
       
   466 // -----------------------------------------------------------------------------
       
   467 //
       
   468 TBool CSmilSVGRenderer::ScriptCall( const TDesC& /*aScript*/, CSvgElementImpl* /*aCallerElement*/ )
       
   469     {
       
   470     return EFalse;
       
   471     }
       
   472 
       
   473 // -----------------------------------------------------------------------------
       
   474 // CSmilSVGRenderer::FetchFont
       
   475 // (other items were commented in a header).
       
   476 // -----------------------------------------------------------------------------
       
   477 //
       
   478 TInt CSmilSVGRenderer::FetchFont( const TDesC& aUri, RFs& /*aSession*/, RFile& aFileHandle )
       
   479     {
       
   480     TRAPD( error, iFileInfo->GetFileHandleL( aUri, aFileHandle ) );
       
   481     return error;
       
   482     }
       
   483 
       
   484 // -----------------------------------------------------------------------------
       
   485 // CSmilSVGRenderer::UpdatePresentation
       
   486 // (other items were commented in a header).
       
   487 // -----------------------------------------------------------------------------
       
   488 //
       
   489 void CSmilSVGRenderer::UpdatePresentation( const TInt32&  /*aNoOfAnimation*/ )
       
   490     {
       
   491     }
       
   492 
       
   493 
       
   494 // -----------------------------------------------------------------------------
       
   495 // CSmilSVGRenderer::UpdatePresentation
       
   496 // (other items were commented in a header).
       
   497 // -----------------------------------------------------------------------------
       
   498 //
       
   499 void CSmilSVGRenderer::GenerateThumbnailL()
       
   500     {
       
   501 #ifdef SVG_DEBUG
       
   502     SMILUILOGGER_ENTERFN( "SVG, GenerateThumbnailL" );
       
   503 #endif
       
   504 
       
   505     TFontSpec spec;
       
   506     CSvgEngineInterfaceImpl* svgEngine = CSvgEngineInterfaceImpl::NewL( iThumbnailBitmap, this, spec );
       
   507     CleanupStack::PushL( svgEngine );
       
   508     
       
   509     svgEngine->SetBackgroundColor( KRgbWhite.Value() );
       
   510     
       
   511     TInt domHandle( KNullHandle );
       
   512     MSvgError* result = svgEngine->PrepareDom( iFileHandle, domHandle );
       
   513     
       
   514     HandleSVGEngineErrorL( result );
       
   515         
       
   516     result = svgEngine->UseDom( domHandle, iThumbnailBitmap, iThumbnailMask );
       
   517     
       
   518     HandleSVGEngineErrorL( result );
       
   519         
       
   520     iThumbnailSize = svgEngine->Size();
       
   521     
       
   522     if ( iThumbnailSize.iHeight <= 0 &&
       
   523          iThumbnailSize.iWidth <= 0 )
       
   524         {
       
   525         // SVG engine might fail to set proper size so in that case
       
   526         // we use the original size.
       
   527         iThumbnailSize = svgEngine->GetUnscaledContentSize( domHandle );
       
   528         }
       
   529     
       
   530     if ( iThumbnailSize.iHeight > 0 &&
       
   531          iThumbnailSize.iWidth > 0 )
       
   532         {
       
   533         TRect mediaRect = iMedia->GetRegion()->GetRectangle();
       
   534           
       
   535         TReal widthRatio = static_cast<TReal>( mediaRect.Width() ) / 
       
   536                            static_cast<TReal>( iThumbnailSize.iWidth );
       
   537         TReal heightRatio = static_cast<TReal>( mediaRect.Height() ) / 
       
   538                             static_cast<TReal>( iThumbnailSize.iHeight );
       
   539         
       
   540         // Calculate "meet" ratio                    
       
   541         TReal scaleFactor = ( widthRatio < heightRatio ) ? widthRatio : heightRatio;
       
   542         
       
   543         iThumbnailSize.iHeight *= scaleFactor;
       
   544         iThumbnailSize.iWidth *= scaleFactor;
       
   545         
       
   546         svgEngine->SetSvgDimensionToFrameBuffer( iThumbnailSize.iWidth, iThumbnailSize.iHeight );
       
   547         
       
   548         // Chooses view box for SVG files where it has not bee set.
       
   549         svgEngine->ChooseViewBoxIfNotSet( domHandle );    
       
   550         svgEngine->InitializeEngine();
       
   551         
       
   552         // Render the content on consumer provided bitmap
       
   553         svgEngine->RenderFrame( NULL, 0 );
       
   554         
       
   555         iFocusRect = mediaRect;
       
   556         
       
   557         // Center the focus rect.
       
   558         iFocusRect.Shrink( ( mediaRect.Width() - iThumbnailSize.iWidth ) / 2, 
       
   559                            ( mediaRect.Height() - iThumbnailSize.iHeight ) / 2 );        
       
   560         }
       
   561     
       
   562     CleanupStack::PopAndDestroy( svgEngine );
       
   563     
       
   564 #ifdef SVG_DEBUG
       
   565     SMILUILOGGER_LEAVEFN( "SVG: GenerateThumbnailL" );
       
   566     SMILUILOGGER_WRITEF( _L("") );
       
   567 #endif
       
   568     }
       
   569 
       
   570 
       
   571 // -----------------------------------------------------------------------------
       
   572 // CSmilSVGRenderer::HandleSVGEngineErrorL
       
   573 // (other items were commented in a header).
       
   574 // -----------------------------------------------------------------------------
       
   575 //
       
   576 void CSmilSVGRenderer::HandleSVGEngineErrorL( MSvgError* aError ) const
       
   577     {
       
   578     if ( !aError )
       
   579         {
       
   580 #ifdef SVG_DEBUG
       
   581         SMILUILOGGER_WRITEF( _L("[SMILUI] SVG: Engine error: no memory") );
       
   582 #endif  
       
   583         User::Leave( KErrNoMemory ); 
       
   584         }
       
   585     else if ( aError->HasError() && !aError->IsWarning() )
       
   586         {
       
   587 #ifdef SVG_DEBUG
       
   588         SMILUILOGGER_WRITEF( _L("[SMILUI] SVG: Engine error: %d"), aError->SystemErrorCode() );
       
   589 #endif  
       
   590         User::Leave( aError->SystemErrorCode() ); 
       
   591         
       
   592         }
       
   593     }
       
   594 
       
   595 // -----------------------------------------------------------------------------
       
   596 // CSmilSVGRenderer::ExitWhenOrientationChange
       
   597 // (other items were commented in a header).
       
   598 // -----------------------------------------------------------------------------
       
   599 //
       
   600 TBool CSmilSVGRenderer::ExitWhenOrientationChange()
       
   601     {
       
   602         return ETrue;
       
   603     }
       
   604 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   605 
       
   606 //  End of File