/***************************************************************************
 * ktabedit.h
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2007- the KTabEdit development team <mrgwen@gmail.com>
 ***************************************************************************/

/***************************************************************************
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * See the file COPYING for more information.
 ***************************************************************************/

#ifndef KTABEDIT_H
#define KTABEDIT_H

#include <QMainWindow>

#include <tse3/MidiScheduler.h>

class QAction;
class QComboBox;
class QMenu;
class QToolBar;
class QUndoStack;

class Settings;
class SongView;
class TimidityLauncher;

class KTabEdit : public QMainWindow {
	Q_OBJECT
public:
	KTabEdit();
	virtual ~KTabEdit();
	
	virtual void createSettings();
	virtual void createMidiScheduler();
	virtual void createActions();
	virtual void createMenus();
	virtual void createToolBars();
	virtual void createStatusBar();
	virtual void connectSongViewActions();
	virtual void createCentralWidget();
	
	virtual void createDurationComboBoxForToolBar();
	virtual void createTupletComboBoxForToolBar();
	
	virtual bool exportOptionsDialog(const QString& ext);
	
	virtual void load(const QString& filename);
	virtual void save(const QString& filename);
	
public slots:
	virtual void fileNew();
	virtual void fileOpen();
	virtual void fileSave();
	virtual void fileSaveAs();
	virtual void filePrint();
	virtual void setDefaultDuration(int durationNumber);
	void showAboutBox();

protected:
	virtual void closeEvent(QCloseEvent* event);
	
private:
	QMenu* mFileMenu;
	QMenu* mEditMenu;
	QMenu* mViewMenu;
	QMenu* mSongMenu;
	QMenu* mTrackMenu;
	QMenu* mBarMenu;
	QMenu* mTimeMenu;
	QMenu* mHelpMenu;
	
	QMenu* mDurationMenu;
	QMenu* mEffectMenu;
	
	QComboBox* mDurationValues;
	QComboBox* mTupletValues;
	
	QToolBar* mFileToolBar;
	QToolBar* mEditToolBar;
	QToolBar* mViewToolBar;
	QToolBar* mTrackToolBar;
	QToolBar* mBarToolBar;
	QToolBar* mTimeToolBar;
	
	QAction* mNewAct;
	QAction* mOpenAct;
	QAction* mSaveAct;
	QAction* mSaveAsAct;
	QAction* mPrintAct;
	QAction* mExitAct;
	
	QAction* mCutAct;
	QAction* mCopyAct;
	QAction* mPasteAct;
	QAction* mSelectAllAct;
	QAction* mUndoAct;
	QAction* mRedoAct;
	
	QAction* mZoomInAct;
	QAction* mZoomOutAct;
	QAction* mMelodyEditorAct;
	QAction* mScoreAct;
	
	QAction* mSongPropertiesAct;
	
	QAction* mNewTrackAct;
	QAction* mDeleteTrackAct;
	QAction* mPropertiesTrackAct;
	
	QAction* mAddBarAct;
	QAction* mDeleteBarAct;
	QAction* mKeySignatureAct;
	QAction* mTimeSignatureAct;
	
	QAction* mAddTimeAct;
	QAction* mDeleteTimeAct;
	
	QAction* mChordAct;
	QAction* mDurationWholeAct;
	QAction* mDurationHalfAct;
	QAction* mDurationQuarterAct;
	QAction* mDurationEighthAct;
	QAction* mDurationSixteenthAct;
	QAction* mDurationThirtySecondAct;
	QAction* mDurationSixtyFourthAct;
	QAction* mDottedTimeAct;
	QAction* mRestAct;
	QAction* mLinkPrevAct;
	QAction* mLegatoAct;
	QAction* mSlideAct;
	QAction* mLetRingAct;
	QAction* mHarmonicAct;
	QAction* mPalmMutingAct;
	QAction* mTupletAct;
	QAction* mBendAct;
	QAction* mVibratoAct;
	QAction* mTrillAct;
	QAction* mTappingAct;
	QAction* mTremoloAct;
	
	QAction* mPlayAct;
	QAction* mStopAct;
	
	QAction* mAboutAct;
	QAction* mAboutQtAct;
	
	QUndoStack* mUndoStack;
	
	SongView* mSongView;
	
	Settings* mSettings;
	
	TSE3::MidiSchedulerFactory mFactory;
	TSE3::MidiScheduler* mScheduler;
	TimidityLauncher* mTimidityLauncher;
};

#endif
