|
1 /* |
|
2 * Copyright (c) 2009 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: Mifconv bitmap converters class. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __MIFCONVBITMAPCONVERTER_H__ |
|
20 #define __MIFCONVBITMAPCONVERTER_H__ |
|
21 |
|
22 #include "mifconv_fileconverter.h" |
|
23 #include <fstream> |
|
24 |
|
25 /** |
|
26 * Converter class for converting .bmp files to .mbm file. |
|
27 */ |
|
28 |
|
29 class MifConvBitmapConverter : public MifConvFileConverter |
|
30 { |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Default constructor |
|
35 */ |
|
36 MifConvBitmapConverter(); |
|
37 |
|
38 /** |
|
39 * Destructor |
|
40 */ |
|
41 virtual ~MifConvBitmapConverter(); |
|
42 |
|
43 // From MifConvFileConverter |
|
44 virtual void AppendFile( const MifConvSourceFile& sourcefile ); |
|
45 virtual void Convert(); |
|
46 virtual void Cleanup(bool err = false); |
|
47 virtual void Init(); |
|
48 virtual void CleanupTargetFiles(); |
|
49 |
|
50 protected: |
|
51 |
|
52 /** |
|
53 * Converts files to .mbm file |
|
54 */ |
|
55 virtual void ConvertToMbm(); |
|
56 |
|
57 /** |
|
58 * Removes temporary files from the file system. |
|
59 */ |
|
60 virtual void CleanupTempFiles(); |
|
61 |
|
62 /** |
|
63 * Runs external bmconv application, which builds the .mbm file. |
|
64 */ |
|
65 void RunBmconv(); |
|
66 |
|
67 /** |
|
68 * Creates and initializes the temporary file. |
|
69 */ |
|
70 void InitTempFile(); |
|
71 |
|
72 /** |
|
73 * Add bitmap file to the temporary file |
|
74 * @param stream file stream for temporary file |
|
75 * @param bmpFile Source file object representing the bitmap file. |
|
76 */ |
|
77 void AppendBmpToTempFile(fstream& stream, const MifConvSourceFile& bmpFile); |
|
78 |
|
79 /** |
|
80 * Returns the default path for the external bmconv executable. |
|
81 * @return Default bmconv path. |
|
82 */ |
|
83 const MifConvString& GetDefaultBmConvPath(); |
|
84 private: |
|
85 |
|
86 MifConvString iTempDir; |
|
87 MifConvString iTempFilename; |
|
88 MifConvString iDefaultBmConvPath; |
|
89 MifConvString iTargetFilename; |
|
90 }; |
|
91 |
|
92 |
|
93 #endif |