#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <qmainwindow.h>
#include <QWorkspace>

		
class QAction;
class CScreenW;		
class CSpritesW;
class QCloseEvent;


class CMainWindow: public QMainWindow
{
	Q_OBJECT

public:
	CMainWindow();

protected:
	void closeEvent(QCloseEvent *event);
	
private slots:
	void OnNewProject();
	void OnLoadProject();
	void OnSaveProject();
	void OnSaveAsProject();
	void OnCloseProject();
	void OnImportPolkaProject();
	void OnExportPolkaProject();
	void OnQuit();
	void OnUndo();
				
	void OnNewScreen();
	void OnLoadScreen();
	void OnSaveScreen();
	void OnSaveAsScreen();
	void OnExportScreenData();
	void OnExportScreenDataHexa();
	void OnExportScreenBin();
	void OnExportScreenBinPletter();
    void OnExportScreenPNG();
    void OnFillScreen1to255();
	
	void OnNewTiles();
	void OnLoadTiles();
	void OnSaveTiles();
	void OnSaveAsTiles();
	void OnExportTilesData();
	void OnExportTilesDataHexa();
	void OnExportTilesBin();
	void OnExportTilesBinPletter();
    void OnExportTilesPNG();
    void OnImportTilesPNG();
    void OnImportTilesPNGAdv();
	void OnImportTiles();
	void OnLoadTilesLibrary();
	void OnGroupTiles();

	void OnCopyTiles();
	void OnPasteTiles();
	void OnPasteTilesColors();
	
	void OnNewSprites();
	void OnLoadSprites();
	void OnSaveSprites();
	void OnSaveAsSprites();
	void OnCloseSprites();		
	void OnExportSprites();
	
	void OnAbout();
		
private:
	void EnableMenuItems();

	QString m_ProjectFile;
	QString m_ScreenFile;
	QString m_TilesFile;
	QString m_SpritesFile;
	
	
	QAction *m_pActNewProject;
	QAction *m_pActLoadProject;
	QAction *m_pActSaveProject;
	QAction *m_pActSaveAsProject;
	QAction *m_pActCloseProject;
	QAction *m_pActImportPolkaProject;
	QAction *m_pActExportPolkaProject;
	QAction *m_pActQuit;
	
	QAction *m_pActCopy;
	QAction *m_pActPaste;
	
	QAction *m_pActNewScreen;
	QAction *m_pActLoadScreen;
	QAction *m_pActSaveScreen;
	QAction *m_pActSaveAsScreen;
	QAction *m_pActExportScreenData;
	QAction *m_pActExportScreenDataHexa;
	QAction *m_pActExportScreenBin;
	QAction *m_pActExportScreenBinPletter;
    QAction *m_pActExportScreenPNG;
    QAction *m_pActFillScreen1to255;
	
	QAction *m_pActNewTiles;
	QAction *m_pActLoadTiles;
	QAction *m_pActSaveTiles;
	QAction *m_pActSaveAsTiles;
	QAction *m_pActExportTilesData;
	QAction *m_pActExportTilesDataHexa;
	QAction *m_pActExportTilesBin;
	QAction *m_pActExportTilesBinPletter;
    QAction *m_pActExportTilesPNG;
    QAction *m_pActImportTilesPNG;
	QAction *m_pActImportTiles;
    QAction *m_pActImportTilesPNGAdv;
	QAction *m_pActLoadTilesLibrary;
	QAction *m_pActGroupTiles;
	
	QAction *m_pActCopyTiles;
	QAction *m_pActPasteTiles;
	QAction *m_pActPasteTilesColors;
	QAction *m_pActUndo;
	
	QAction *m_pActNewSprites;
	QAction *m_pActLoadSprites;
	QAction *m_pActSaveSprites;
	QAction *m_pActSaveAsSprites;
	QAction *m_pActCloseSprites;
	QAction *m_pActExportSprites;
	
	QAction *m_pActAbout;
	
	QMenu *m_pMenu;

	QWorkspace *m_pWks;
	CScreenW *m_pScreen;
	CSpritesW *m_pSprites;

	QString m_LastPath;

	QString m_Version;

	void SaveProject();
};
#endif
