/***************************************************************************
 * tracktimeclassicalview.h: implementation of TrackTimeClassicalView class
 *
 * This file is part of KGuitar, a KDE tabulature editor
 *
 * copyright (C) 2006-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 TRACKTIMESCLASSICALVIEW_H
#define TRACKTIMESCLASSICALVIEW_H

#include <list>

#include <QGraphicsItem>
#include <QFont>

#include "drawingitem.h"

#include "tablature/trackproperties.h"
#include "tablature/tabkey.h"
#include "tablature/tabduration.h"

class TrackClassicalDurationView;
class TabTime;

class TrackTimesClassicalView : public DrawingItem
{
public:
	TrackTimesClassicalView(const TabTime* time, const TrackProperties* properties, const QFont& textFont, 
				uint strings, const Cm& lSpace, const Cm& tSpace, uint dpi);
	virtual ~TrackTimesClassicalView();
	
	virtual void setNextDuration(Duration nextDuration);
	virtual Duration nextDuration() const;
	
	virtual void hide();
	virtual void show();
	
	virtual QRectCm boundingRect () const;
	virtual Cm height() const;
	virtual Cm width() const;
	
private:
	typedef std::list<QGraphicsItem*>::iterator iterator;
	typedef std::list<QGraphicsItem*>::const_iterator const_iterator;
	
	void drawFret();
	
	int timeHeight(TabClef clef, uint string);
	
	const static QFont sClassicalFont;
	const TabTime* mTabTime;
	const TrackProperties* trackProperties;
	const QFont font;
	const uint nbStrings;
	const Cm lineSpaces;
	const Cm timeSpaces;
	
	TrackClassicalDurationView* durationView;
	
	Cm heightNote;
	Cm lowNote;
	
	std::list<QGraphicsItem*> itemCollection;
	Duration mNextDuration;
};

#endif
