/***************************************************************************
 * songviewcommands.h: implementation of SetSongPropCommand class
 *                                       SetTrackPropCommand
 *                                       InsertTabsCommand
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2003-2006 the KTabEdit development team <mrgwen@gmail.com>
 * copyright (C) 2002-2003 the KGuitar 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 SONGVIEWCOMMANDS_H
#define SONGVIEWCOMMANDS_H

#include <QUndoCommand>

#include "songview.h"

class TabProperties;
class TabSongModel;
class TrackEditView;

class SongView::AddTrackCommand : public QUndoCommand {
public:
	AddTrackCommand(TabSongModel* tabSong, TabTrack* tabTrack);
	virtual ~AddTrackCommand();
	
	virtual void undo();
	virtual void redo();
private:
	TabSongModel* mTabSong;
	TabTrack* mTabTrack;
};

class SongView::DeleteTrackCommand: public QUndoCommand {
public:
	DeleteTrackCommand(TabSongModel* tabSong, TabTrack* tabTrack);
	virtual ~DeleteTrackCommand();
	
	virtual void undo();
	virtual void redo();
private:
	TabSongModel* mTabSong;
	TabTrack* mTabTrack;
	bool mEmpty;
	bool mExecuted;
};

class SongView::SetTrackPropCommand: public QUndoCommand {
public:
	SetTrackPropCommand(TrackProperties* trackProperties, TabTrack* tabTrack);
	virtual ~SetTrackPropCommand();
	
	virtual void undo();
	virtual void redo();
private:
	const TrackProperties* mTrackProperties;
	TrackProperties* mSavedProperties;
	TabTrack* mTabTrack;
};

class SongView::SetSongPropCommand : public QUndoCommand {
public:
	SetSongPropCommand(TabSongModel* tabSong, TabProperties* songProperties);
	virtual ~SetSongPropCommand();
	
	virtual void undo();
	virtual void redo();
private:
	TabSongModel* mTabSong;
	TabProperties* mSavedProperties;
	TabProperties* mProperties;
};

/*!
	Insert tabs
*/
class SongView::InsertTabsCommand: public QUndoCommand {
public:
	/*!
		TODO.
	*/
	InsertTabsCommand(TrackEditView& tv, TabTrack& trk, TabTrack& tabs, uint bar);
	
	/*!
		TODO.
	*/
	virtual ~InsertTabsCommand() {};
	
	/*!
		TODO.
	*/
	virtual void execute();
	
	/*!
		TODO.
	*/
	virtual void unexecute();
	
	/**
		Name of the command.
	*/
	virtual QString name() const;
private:
	uint barPosition;
	//TabTrack& currentTrack,& tempTrack, oldTrack;
	//TrackEditView& trackView;
};
#endif
