startupservices/startupanimation/sanimsvgplugin/src/sanimsvgpluginbase.cpp
changeset 0 2e3d3ce01487
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of CSAnimSvgPluginBase class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <SVGEngineInterfaceImpl.h>
       
    20 
       
    21 #include "sanimsvgpluginbase.h"
       
    22 #include "assert.h"
       
    23 #include "trace.h"
       
    24 
       
    25 /** Default SMIL fit value to use. */
       
    26 _LIT( KDefaultSmilValue, "meetfill" );
       
    27 
       
    28 // ======== MEMBER FUNCTIONS ========
       
    29 
       
    30 // ---------------------------------------------------------------------------
       
    31 // CSAnimSvgPluginBase::CSAnimSvgPluginBase
       
    32 //
       
    33 // ---------------------------------------------------------------------------
       
    34 //
       
    35 CSAnimSvgPluginBase::CSAnimSvgPluginBase( TAny* aConstructionParameters )
       
    36   : CSAnimImagePlugin( aConstructionParameters ),
       
    37     iEngine( NULL )
       
    38     {
       
    39     FUNC_LOG;
       
    40     }
       
    41 
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // CSAnimSvgPluginBase::~CSAnimSvgPluginBase
       
    45 //
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 CSAnimSvgPluginBase::~CSAnimSvgPluginBase()
       
    49     {
       
    50     FUNC_LOG;
       
    51 
       
    52     delete iEngine;
       
    53     }
       
    54 
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // CSAnimSvgPluginBase::ScriptCall
       
    58 //
       
    59 // ---------------------------------------------------------------------------
       
    60 //
       
    61 TBool CSAnimSvgPluginBase::ScriptCall(
       
    62     const TDesC& /*aScript*/,
       
    63     CSvgElementImpl* /*aCallerElement*/ )
       
    64     {
       
    65     FUNC_LOG;
       
    66     return EFalse;
       
    67     }
       
    68 
       
    69 
       
    70 // ---------------------------------------------------------------------------
       
    71 // CSAnimSvgPluginBase::FetchImage
       
    72 //
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 TInt CSAnimSvgPluginBase::FetchImage(
       
    76     const TDesC& /*aUri*/,
       
    77     RFs& /*aSession*/,
       
    78     RFile& /*aFileHandle*/ )
       
    79     {
       
    80     FUNC_LOG;
       
    81     return KErrNotSupported;
       
    82     }
       
    83 
       
    84 
       
    85 // ---------------------------------------------------------------------------
       
    86 // CSAnimSvgPluginBase::FetchFont
       
    87 //
       
    88 // ---------------------------------------------------------------------------
       
    89 //
       
    90 TInt CSAnimSvgPluginBase::FetchFont(
       
    91     const TDesC& /*aUri*/,
       
    92     RFs& /*aSession*/,
       
    93     RFile& /*aFileHandle*/ )
       
    94     {
       
    95     FUNC_LOG;
       
    96     return KErrNotSupported;
       
    97     }
       
    98 
       
    99 
       
   100 // ---------------------------------------------------------------------------
       
   101 // CSAnimSvgPluginBase::GetSmilFitValue
       
   102 //
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 void CSAnimSvgPluginBase::GetSmilFitValue( TDes& aSmilValue )
       
   106     {
       
   107     FUNC_LOG;
       
   108     // this is one of "fill", "meet", "slice", or "".
       
   109 	aSmilValue = KDefaultSmilValue;
       
   110     }
       
   111 
       
   112 
       
   113 // ---------------------------------------------------------------------------
       
   114 // CSAnimSvgPluginBase::UpdatePresentation
       
   115 //
       
   116 // ---------------------------------------------------------------------------
       
   117 //
       
   118 void CSAnimSvgPluginBase::UpdatePresentation( const TInt32& /*aNoOfAnimation*/ )
       
   119     {
       
   120     FUNC_LOG;
       
   121     }
       
   122 
       
   123 
       
   124 // ---------------------------------------------------------------------------
       
   125 // CSAnimSvgPluginBase::SvgToSymbianErr
       
   126 //
       
   127 // ---------------------------------------------------------------------------
       
   128 //
       
   129 TInt CSAnimSvgPluginBase::SvgToSymbianErr( MSvgError* aError )
       
   130     {
       
   131     FUNC_LOG;
       
   132 
       
   133     if ( aError && aError->HasError() )
       
   134         {
       
   135         INFO_1( "Svg error code: %d", aError->ErrorCode() );
       
   136 
       
   137         switch ( aError->ErrorCode() )
       
   138             {
       
   139             case ESvgNoError: return KErrNone;
       
   140             case ESvgFileNotFound: return KErrNotFound;
       
   141             case ESvgDocumentNotValid: return KErrCorrupt;
       
   142             case ESvgDocumentNotAvailable: return KErrNotFound;
       
   143             case ESvgNoMemory: return KErrNoMemory;
       
   144             case ESvgDiskFull: return KErrDiskFull;
       
   145             case ESvgUnknown: return KErrGeneral;
       
   146             case ESvgMissingRequiredAttribute: return KErrArgument;
       
   147             case ESvgInvalidAttributeValue: return KErrArgument;
       
   148             case ESvgbFileNotValid: return KErrCorrupt;
       
   149             case ESvgDRMFailure: return KErrPermissionDenied;
       
   150             case ESvgThumbNailRestriction: return KErrPermissionDenied;
       
   151             default: return KErrGeneral;
       
   152             };
       
   153         }
       
   154 
       
   155     return KErrNone;
       
   156     }