gfxconversion/mifconv/inc/mifconv_bitmapconverter.h
changeset 0 f453ebb75370
child 2 1f6339ced17d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gfxconversion/mifconv/inc/mifconv_bitmapconverter.h	Tue Feb 02 01:11:11 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Mifconv bitmap converters class.
+*
+*/
+
+
+#ifndef __MIFCONVBITMAPCONVERTER_H__
+#define __MIFCONVBITMAPCONVERTER_H__
+
+#include "mifconv_fileconverter.h"
+#include <fstream>
+
+/**
+ * Converter class for converting .bmp files to .mbm file.
+ */
+
+class MifConvBitmapConverter : public MifConvFileConverter
+{
+public:
+
+    /**
+     * Default constructor
+     */ 
+    MifConvBitmapConverter();
+
+    /**
+     * Destructor
+     */
+    virtual ~MifConvBitmapConverter();
+
+    // From MifConvFileConverter
+	virtual void AppendFile( const MifConvSourceFile& sourcefile );
+	virtual void Convert();
+	virtual void Cleanup(bool err = false);
+	virtual void Init();
+	virtual void CleanupTargetFiles();
+
+protected:
+
+    /**
+     * Converts files to .mbm file     
+     */
+	virtual void ConvertToMbm();
+
+    /**
+     * Removes temporary files from the file system.
+     */
+	virtual void CleanupTempFiles();
+
+    /**
+     * Runs external bmconv application, which builds the .mbm file.     
+     */
+    void RunBmconv();
+
+    /**
+     * Creates and initializes the temporary file.     
+     */
+    void InitTempFile();
+
+    /**
+     * Add bitmap file to the temporary file
+     * @param stream file stream for temporary file
+     * @param bmpFile Source file object representing the bitmap file.
+     */
+    void AppendBmpToTempFile(fstream& stream, const MifConvSourceFile& bmpFile);
+
+    /**
+     * Returns the default path for the external bmconv executable.
+     * @return Default bmconv path.
+     */
+    const MifConvString& GetDefaultBmConvPath();
+private:
+    
+    MifConvString iTempDir;
+    MifConvString iTempFilename;
+    MifConvString iDefaultBmConvPath;
+    MifConvString iTargetFilename;
+};
+
+
+#endif