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

#include <QWidget>
#include "tablatureModel/tabsongobserver.h"

class QTableWidget;
class TabSongModel;
class TabTrack;

class TrackPane : public QWidget, public TabSongObserver
{
	Q_OBJECT
public:
	TrackPane(const TabSongModel* tabSong, uint headerHeight, uint cellSide);
	virtual ~TrackPane();
	
	virtual void songUpdated();
	virtual void trackAdded(TabTrack*);
	virtual void trackDeleted(TabTrack*);
	virtual void trackUpdated();
	
public slots:
	void setTabTrack(TabTrack* track);
	void updateTrackList();
	
signals:
	void trackChanged(TabTrack*);
	void barSelected(uint);

protected:
	virtual void mousePressEvent(QMouseEvent *e);

private:
	const TabSongModel* mTabSong;
	TabTrack* mCurrentTrack;
	QTableWidget* mTableWidget;
	uint mHeaderHeight;
	uint mCellSide;
	uint mNbCells;
};

#endif
