dependencies/mifconv/inc/mifconv_bitmapconverter.h
author Christian Morlok <symbian.org@christianmorlok.de>
Thu, 06 May 2010 15:56:48 +0200
branchv5backport
changeset 67 35a198a504a8
parent 21 11157e26c4a7
permissions -rw-r--r--
updated dependencies; everything (hssrv and hs) compiles with winscw_udeb without error
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     1
/*
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     3
* All rights reserved.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     8
*
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
     9
* Initial Contributors:
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    11
*
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    12
* Contributors:
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    13
*
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    14
* Description:  Mifconv bitmap converters class.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    15
*
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    16
*/
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    17
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    18
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    19
#ifndef __MIFCONVBITMAPCONVERTER_H__
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    20
#define __MIFCONVBITMAPCONVERTER_H__
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    21
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    22
#include "mifconv_fileconverter.h"
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    23
#include <fstream>
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    24
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    25
/**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    26
 * Converter class for converting .bmp files to .mbm file.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    27
 */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    28
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    29
class MifConvBitmapConverter : public MifConvFileConverter
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    30
{
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    31
public:
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    32
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    33
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    34
     * Default constructor
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    35
     */ 
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    36
    MifConvBitmapConverter();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    37
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    38
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    39
     * Destructor
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    40
     */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    41
    virtual ~MifConvBitmapConverter();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    42
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    43
    // From MifConvFileConverter
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    44
	virtual void AppendFile( const MifConvSourceFile& sourcefile );
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    45
	virtual void Convert();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    46
	virtual void Cleanup(bool err = false);
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    47
	virtual void Init();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    48
	virtual void CleanupTargetFiles();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    49
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    50
protected:
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    51
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    52
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    53
     * Converts files to .mbm file     
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    54
     */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    55
	virtual void ConvertToMbm();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    56
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    57
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    58
     * Removes temporary files from the file system.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    59
     */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    60
	virtual void CleanupTempFiles();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    61
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    62
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    63
     * Runs external bmconv application, which builds the .mbm file.     
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    64
     */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    65
    void RunBmconv();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    66
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    67
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    68
     * Creates and initializes the temporary file.     
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    69
     */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    70
    void InitTempFile();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    71
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    72
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    73
     * Add bitmap file to the temporary file
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    74
     * @param stream file stream for temporary file
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    75
     * @param bmpFile Source file object representing the bitmap file.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    76
     */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    77
    void AppendBmpToTempFile(fstream& stream, const MifConvSourceFile& bmpFile);
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    78
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    79
    /**
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    80
     * Returns the default path for the external bmconv executable.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    81
     * @return Default bmconv path.
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    82
     */
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    83
    const MifConvString& GetDefaultBmConvPath();
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    84
private:
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    85
    
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    86
    MifConvString iTempDir;
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    87
    MifConvString iTempFilename;
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    88
    MifConvString iDefaultBmConvPath;
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    89
    MifConvString iTargetFilename;
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    90
};
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    91
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    92
11157e26c4a7 added dependencies for homescreen package
Christian Morlok <symbian.org@christianmorlok.de>
parents:
diff changeset
    93
#endif