/***************************************************************************
 * fingers.h: implementation of Fingers class
 *
 * 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 FINGERS_H
#define FINGERS_H

#include <QFrame>

#include "global.h"

class QScrollBar;

class TabTrack;

/**
@brief The Fingering class. This class draws the chord and manages the interact between the user and the chord builder
*/
class Fingering : public QFrame
{
    Q_OBJECT
public:
	Fingering(const TabTrack& track);
	~Fingering();
	void setFinger(int string, int fret);
	int  app(int string) const;
	void setApp(int string, int fret);

public
	slots:
	void setFingering(const int a[MAX_STRINGS]);

private 
	slots:
	void clear();
	void setFirstFret(int fret);
	
	signals:
	/**
	@brief Signal emitted when the user changes the chord.
	*/
	//TODO Implementation missing!
	void chordChange();
	
protected:
	virtual void paintEvent(QPaintEvent* event);
	virtual void mouseMoveEvent(QMouseEvent *);
	virtual void mousePressEvent(QMouseEvent *);
			void mouseHandle(const QPoint &pos, bool domute);
	
private:
	static const int msScale;
	static const int msCircle;
	static const int msCircBord;
	static const int msBorder;
	static const int msSpacer;
	static const int msFretText;
	static const int msScroller;
	static const int msNotes;
	
	const TabTrack& mTabTrack;
	QScrollBar *mScrollBar;
	
	int mChordDiagram[MAX_STRINGS];
	int mLastFret;
};

#endif
