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