/***************************************************************************
 * fingeritem.h: implementation of FingerItem class
 *
 * 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 FINGERITEM_H
#define FINGERITEM_H

#include <QWidget>

#include "fingerlist.h"

class FingerItem : public QWidget {
	Q_OBJECT
public:
	FingerItem(const ChordDiagram& chordDiagram);
	virtual ~FingerItem();
	
	virtual void setSelected(bool b);
	virtual bool isSelected() const;
	
	virtual void setNumberOfFrets(uchar frets);
	virtual uchar numberOfFrets() const;
	
	virtual void setNumberOfStrings(uchar strings);
	virtual uchar numberOfStrings() const;
	
protected:
	virtual void paintEvent(QPaintEvent *);
	
private:
	static const uint msScale;
	static const uint msCircle;
	static const uint msCircBord;
	static const uint msBorder;
	static const uint msSpacer;
	static const uint msFretText;
	static const uint msIconChord;
	static const double msFontFactor;
	
	int mNum;
	int mPerRow;
	int mCurSel;
	int mOldCol;
	int mOldRow;
	
	uchar mFrets;
	uchar mStrings;
	bool mSelected;
	QFont mFretNumberFont;
	ChordDiagram mChordDiagram;
};

#endif
