svgt_plat/svgt_api/inc/SVGRequestObserver.h
changeset 0 d46562c3d99d
equal deleted inserted replaced
-1:000000000000 0:d46562c3d99d
       
     1 /*
       
     2 * Copyright (c) 2003 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:  SVG Engine header file
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __INC_MSVGREQUESTOBSERVER__
       
    20 #define __INC_MSVGREQUESTOBSERVER__
       
    21 
       
    22 
       
    23 class   CSvgElementImpl;
       
    24 
       
    25 
       
    26 /**
       
    27  * This interface is the callback mechanism for the SVG Engine to communicate to
       
    28  * interested clients and to request for external data, such as images.
       
    29  * The callbacks will be active when the methods of this interace are implemented and
       
    30  * the pointer to the implementation object is passed in as the second parameter
       
    31  * of the 'ConstructL' method of the CSvgEngineInterface.  A 'null' value may be
       
    32  * passed-in if the callbacks are to be ignored.
       
    33  *
       
    34  *  @lib SVGEngine.lib
       
    35  *  @since 1.0
       
    36  */
       
    37 class MSvgRequestObserver
       
    38     {
       
    39     public:
       
    40 
       
    41         /**
       
    42          * This method is called by the SVG Engine when all data for a certain
       
    43          * step, such as animation frame, have been updated.  This usually means
       
    44          * the off-screen image (passed in to 'ConstructL' of CSvgEngineInterface)
       
    45          * has been updated.  The client usually redraws the image onto
       
    46          * the screen.
       
    47          *
       
    48          * @since 1.0
       
    49          * @param : none
       
    50          * @return : none
       
    51          */
       
    52         virtual void    UpdateScreen() = 0;
       
    53 
       
    54         /**
       
    55          * This method is for future extension, in which an external script engine
       
    56          * could be used to evaluate a script description.
       
    57          *
       
    58          * @since 1.0
       
    59          * @param : aScript -- A description of script from the "on" attribute.
       
    60          *
       
    61          * @param : aCallerElement -- The element that calls the script by a
       
    62          *                            an event of the "on" attribute.
       
    63          * @return : For future use.  Value is ignored.
       
    64          */
       
    65         virtual TBool   ScriptCall( const TDesC& aScript,
       
    66                                     CSvgElementImpl* aCallerElement ) = 0;
       
    67 
       
    68         /**
       
    69          * This method is called to retrieve the file handle of an image name.
       
    70          * The session (RFs) object passed in is guaranteed to be connected, so
       
    71          * the client must NOT call aSession.Connect().
       
    72          *
       
    73          * The implementation for the client of this method is usually if not always:
       
    74          * TInt X::FetchImage( const TDesC& aFilename, RFs& aSession, RFile& aFileHandle )
       
    75          *     {
       
    76          *     // Check for "http", get data from remote site, save to disk
       
    77          *     // Get absolute path to aFilename: absolutepath
       
    78          *     return aFileHandle.Open( aSession, absolutepath, EFileRead );
       
    79          *     }
       
    80          *
       
    81          * Note: Use EFileShareReadersOnly to prevent file locking.
       
    82          *
       
    83          * The API AssignImageData() can be used to avoid block the parsing
       
    84          * thread due this method taking too long to return.  This is
       
    85          * accomplished by returning a non-KErrNone value  (i.e. KErrNotFound),
       
    86          * and storing the URI parameter.  The image data then could be
       
    87          * assigned the the URI in another thread/Active-Object.
       
    88          *
       
    89          * @since 1.0
       
    90          * @param : aUri -- the relative path of an image file.
       
    91          * @param : aSession -- File session used by client to open file.
       
    92          * @param : aFileHandle -- File handle used by client to open file.
       
    93          * @return : KErrNone if Open command successful, otherwise error-code
       
    94          *           from Open command.  The SVG engine will proceed loading the file
       
    95          *           only if the return value is KErrNone.
       
    96          */
       
    97         virtual TInt FetchImage( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ) = 0;
       
    98 
       
    99 		/**
       
   100          * This method is called to retrieve the file handle of an svg font file.
       
   101          * This file must be SVG 1.1 .svg file.  When the engine comes acrossed
       
   102          * a font-family name that it doesnt know it will request "fontfamilyname".svg
       
   103          * file through this method.  The client can either provide the svg file
       
   104          * or the engine will default to system text.
       
   105          *
       
   106          * The usage of this method is exactly the same as the FetchImage method above
       
   107          *
       
   108          * @since 1.0
       
   109          * @param : aUri -- the relative path of an image file.
       
   110          * @param : aSession -- File session used by client to open file.
       
   111          * @param : aFileHandle -- File handle used by client to open file.
       
   112          * @return : KErrNone if Open command successful, otherwise error-code
       
   113          *           from Open command.  The SVG engine will proceed loading the file
       
   114          *           only if the return value is KErrNone.
       
   115          */
       
   116 		virtual TInt FetchFont( const TDesC& aUri, RFs& aSession, RFile& aFileHandle ) = 0;
       
   117 
       
   118         /**
       
   119          * This Method updates the presentation status
       
   120          * @since 1.0
       
   121          * @param : TInt32&  aNoOfAnimation
       
   122          * @return :
       
   123          */
       
   124         virtual  void UpdatePresentation(const TInt32&  aNoOfAnimation)=0;
       
   125 
       
   126 
       
   127     };
       
   128 
       
   129 #endif /*__INC_MSvgRequestObserver__*/