graphicsuis_plat/svgt_viewer_ui_api/inc/SVGTThumbnailUtil.h
branchRCL_3
changeset 20 5fd161fa28b6
equal deleted inserted replaced
17:e52958d06c29 20:5fd161fa28b6
       
     1 /*
       
     2 * Copyright (c) 2004,2005 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:  SVGT Thumbnail Utility Class implements the thumbnail
       
    15 *                used to display SVGT content.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __SVGTTHUMBNAILUTIL_H__
       
    22 #define __SVGTTHUMBNAILUTIL_H__
       
    23 
       
    24 // INCLUDES
       
    25 
       
    26 #include <SVGRequestObserver.h>
       
    27 
       
    28 
       
    29 // FUNCTION PROTOTYPES
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class   CSvgEngineInterfaceImpl;
       
    33 class   CFbsBitmap;
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  CSVGTThumbnailUtil is a utility class used to generate thumbnails.
       
    38 *  It is used through dialog provided by CSVGTUIDialog.
       
    39 *
       
    40 *  @lib SVGTUIControl.lib
       
    41 *  @since 3.0
       
    42 */
       
    43 
       
    44 class CSVGTThumbnailUtil : public CBase,
       
    45                            public MSvgRequestObserver
       
    46     {
       
    47     public: // Constructors and destructor
       
    48         /**
       
    49         * Generate thumbnails for SVGT content.
       
    50         * @since 3.0
       
    51         * @param aFileHandle File Handle to the SVGT file.
       
    52         * @param aThumbnailBitmap Bitmap - Client provided bitmap to render 
       
    53         *   the SVGT contents opening screen.
       
    54         * @param aThumbnailBitmap Bitmap - Client provided bitmap mask.
       
    55         * @return Boolean ETrue indicates thumbnail generated successfully,
       
    56         *                 EFalse otherwise.
       
    57         */
       
    58         IMPORT_C static TBool GenerateThumbnailLD( RFile& aFileHandle,
       
    59                                            CFbsBitmap& aThumbnailBitmap,
       
    60                                            CFbsBitmap& aThumbnailBitmapMask );
       
    61 
       
    62     public: // New functions
       
    63 
       
    64     public: // Functions from base classes
       
    65 
       
    66   
       
    67         /**
       
    68         * This function is called to initialize the SVGT-Engine interface.
       
    69         * @since 3.0
       
    70         */
       
    71         void InitializeEngineL();
       
    72 
       
    73         /**
       
    74         * Generates Thumbnail of initial screen of SVG content.
       
    75         * @since 3.0     
       
    76         * @return Boolean ETrue indicates thumbnail generated successfully,
       
    77         *                 EFalse otherwise.
       
    78         */
       
    79 
       
    80         TBool GenerateThumbnail();
       
    81         
       
    82      
       
    83     protected:  // Functions from base classes
       
    84         
       
    85         /**
       
    86         * From MSvgRequestObserver Method called by SVG Engine
       
    87         *  after it has rendered a frame.
       
    88         * @since 3.0
       
    89         */
       
    90         void UpdateScreen();
       
    91 
       
    92         /**
       
    93         * From MSvgRequestObserver This method is for future extension,
       
    94         *  in which an external script engine could be used to evaluate
       
    95         *  a script description.
       
    96         * @since 3.0
       
    97         * @param aScript Descriptor containing script
       
    98         * @param aCallerElement SVG Element that calls the script by a
       
    99         *  an event of the "on" attribute.
       
   100         * @return TBool.
       
   101         */
       
   102         TBool ScriptCall( const TDesC& aScript,
       
   103                           CSvgElementImpl* aCallerElement );
       
   104 
       
   105         /**
       
   106         * From MSvgRequestObserver This method is called by the SVG engine
       
   107         *  to retrieve the absolute path of the image file.
       
   108         * @since 3.0
       
   109         * @param aUri Descriptor containing the relative path of the image.
       
   110         * @param aFilePath Descriptor which contains absolute path that is
       
   111         *  to be used by the Engine to retrieve the image.
       
   112         * @return TBool -
       
   113         *  ETrue indicates absolute path is present in aFilePath.
       
   114         *  EFalse otherwise.
       
   115         */  
       
   116         TInt FetchImage( const TDesC& aUri, 
       
   117                           RFs& aSession, RFile& aFileHandle ) ;
       
   118 
       
   119         TInt FetchFont( const TDesC& /* aUri */, 
       
   120                                     RFs& /* aSession */, RFile& /* aFileHandle */ );
       
   121 
       
   122         /**
       
   123         * From MSvgRequestObserver This method is called by the SVG engine
       
   124         *  to get the SMIL Fit attribute value.
       
   125         * @since 3.0
       
   126         * @param aSmilValue Descriptor containing the SMIL Fit attribute.
       
   127         */
       
   128         void GetSmilFitValue( TDes& aSmilValue );
       
   129 
       
   130         /**
       
   131         * From MSvgRequestObserver This method is called by the SVG engine
       
   132         *  to update the presentation status.
       
   133         * @since 3.0
       
   134         * @param aNoOfAnimation Integer. When called for the first time
       
   135         *  it indicates total number of animations.
       
   136         *  Subsequently it contains number of animations that were completed.
       
   137         */
       
   138         void UpdatePresentation( const TInt32&  aNoOfAnimation );        
       
   139     private:
       
   140 
       
   141         /**
       
   142         * C++ default constructor.
       
   143         */
       
   144         CSVGTThumbnailUtil( RFile& aFileHandle );
       
   145 
       
   146         /**
       
   147         * Second Phase constructor.
       
   148         * @param aThumbnailBitmap Client provided bitmap to render the SVGT
       
   149         *   contents opening screen.
       
   150         * @param aThumbnailBitmapMask Bitmap - Client provided bitmap for SVGT
       
   151         *   bitmap mask.
       
   152         */
       
   153         void ConstructL( CFbsBitmap& aThumbnailBitmap,
       
   154                          CFbsBitmap& aThumbnailBitmapMask );
       
   155 
       
   156         /**
       
   157         * Two-phased constructor for thumbnail creation.
       
   158         * @since 3.0
       
   159         * @param aFileHandle file handle to the SVGT file.
       
   160         * @param aThumbnailBitmap Bitmap - Client provided bitmap to render
       
   161         *   the SVGT contents opening screen.
       
   162         * @param aThumbnailBitmapMask Bitmap - Client provided bitmap for SVGT
       
   163         *   bitmap mask.
       
   164         * @return CSVGTThumbnailUtil*
       
   165         */
       
   166 
       
   167         static CSVGTThumbnailUtil* NewL( RFile& aFileHandle,
       
   168                                        CFbsBitmap& aThumbnailBitmap,
       
   169                                        CFbsBitmap& aThumbnailBitmapMask );
       
   170 
       
   171         /**
       
   172         * Two-phased constructor for thumbnail creation that pushes the
       
   173         * object on the cleanup stack.
       
   174         * @since 3.0
       
   175         * @param aFileHandle file handle to the SVGT file.
       
   176         * @param aThumbnailBitmap Client provided bitmap to render the SVGT
       
   177         *                         contents opening screen.
       
   178         * @param aThumbnailBitmapMask Bitmap - Client provided bitmap for SVGT
       
   179         *   bitmap mask.
       
   180         * @return CSVGTThumbnailUtil*
       
   181         */
       
   182 
       
   183         static CSVGTThumbnailUtil* NewLC( RFile& aFileHandle,
       
   184                                         CFbsBitmap& aThumbnailBitmap,
       
   185                                         CFbsBitmap& aThumbnailBitmapMask );
       
   186         /**
       
   187         * Destructor.
       
   188         */
       
   189 
       
   190         virtual ~CSVGTThumbnailUtil();
       
   191 
       
   192     private:    // Data
       
   193         // Dummy Bitmap used by SVG Engine to render content.
       
   194         CFbsBitmap*  iSVGTBitMapDummy;
       
   195 
       
   196         // SVG Engine Interface Implementation pointer
       
   197         CSvgEngineInterfaceImpl*     iSvgModule;
       
   198 
       
   199         // Thumbnail bitmap used by SVG Engine to render content.
       
   200         CFbsBitmap*  iThumbnailBitmap;
       
   201 
       
   202         // Thumbnail bitmap mask used by SVG Engine to render content mask.
       
   203         CFbsBitmap*  iThumbnailBitmapMask;
       
   204 
       
   205         // SVG Thumbnail Handle
       
   206         TInt iThumbnailHandle;
       
   207           
       
   208         // SVGT content filename descriptor
       
   209         RFile& iContentFileHandle;
       
   210     };
       
   211 
       
   212 #endif  // __SVGTTHUMBNAILUTIL_H__
       
   213 
       
   214 // End of File