services/terminalmodeservice/inc/upnpsvgimageconverter.h
branchRCL_3
changeset 29 5c72fd91570d
equal deleted inserted replaced
7:8116cc943311 29:5c72fd91570d
       
     1 /**
       
     2 * Copyright (c) 2010 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: CUpnpSvgImageConverter class declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef __UPNPSVGIMAGECONVERTER_H__
       
    19 #define __UPNPSVGIMAGECONVERTER_H__
       
    20 
       
    21 // Include Files
       
    22 #include <SVGEngineInterfaceImpl.h>
       
    23 
       
    24 /**
       
    25  * CUpnpSvgImageConverter class acts as an intermediate between the invoker and the
       
    26  * actual converter.Class encapsulates svg to bitmap conversion process.
       
    27  * Does all the pre-processing needed before invoking actual conversion API.
       
    28  * It takes svg file as an input and provides bmp ( converted ) file as an output.
       
    29  * This class is responsible for creating a new thread and allocating resources to it.
       
    30  * The icon file conversion happens in the new thread being created.
       
    31  */
       
    32 class CUpnpSvgImageConverter : public CBase                      
       
    33     {
       
    34 public:
       
    35     /**
       
    36     * Two-phased constructor
       
    37     * @param aIconWidth width of the requested icon
       
    38     * @param aIconHeight height of the requested icon
       
    39     */
       
    40     static CUpnpSvgImageConverter* NewL( TInt aIconWidth, TInt aIconHeight );
       
    41     /**
       
    42      * Prepares the DOM for given SVG file, creates a new thread and returns
       
    43      * the converted icon(bmp) file path
       
    44      */ 
       
    45     void ConvertToBitmapL( const TDesC& aSvgFile, RBuf& aBitmapFile );
       
    46     ~CUpnpSvgImageConverter();
       
    47     CFbsBitmap& BitmapObject()const;
       
    48     //static thread method serving as thread's main function
       
    49     static TInt ImageConverter( TAny* aParam );
       
    50     //Leaving variant of thread function
       
    51     static void ImageConverterL( CUpnpSvgImageConverter& aSvgConverter ); 
       
    52   
       
    53 private: 
       
    54     // Constructors
       
    55     CUpnpSvgImageConverter( );
       
    56     void ConstructL( TInt aIconWidth, TInt aIconHeight );
       
    57     // Thread creation method
       
    58     void StartThreadL( );
       
    59     // "Getter" method to fetch file path
       
    60     const TDesC& Filepath( )const;
       
    61         
       
    62 private:
       
    63     RFbsSession                  iFbsSession;
       
    64     RFs                          iFileSession; 
       
    65     CFbsBitmap*                  iMask;
       
    66     CSvgEngineInterfaceImpl*     iSvgModule;
       
    67     RBuf                         iBitMapFilePath;
       
    68     CFbsBitmap*                  iBitmap;
       
    69     };
       
    70 
       
    71 #endif // __UPNPSVGIMAGECONVERTER_H__