/***************************************************************************
 * trackclassicalclefview.cpp: implementation of TrackClassicalClefView class
 *
 * This file is part of KTabEdit, a KDE tabulature editor
 *
 * copyright (C) 2003-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.
 ***************************************************************************/

#include "trackclassicalclefview.h"

#include <QFontMetrics>

TrackClassicalClefView::TrackClassicalClefView(uint dpi)
: DrawingItem(dpi),
  font("feta26"),
  clefView("")
{
	QChar clef = 182;
	
	//clefView.setFont(font);
	//clefView.setText(clef);
}

TrackClassicalClefView::~TrackClassicalClefView()
{
}

void TrackClassicalClefView::hide()
{
	clefView.hide();
}

void TrackClassicalClefView::show()
{
	clefView.moveBy(position().x(), position().y());
	clefView.show();
}

QRectCm TrackClassicalClefView::boundingRect() const
{
}

Cm TrackClassicalClefView::width() const
{
	QChar clef = 182;
	QFontMetrics fm(font);
	
	Pixel pixelWidth(fm.boundingRect(clef).width(), dpi());
	pixelWidth.fromOtherDpi(75);
	
	return pixelWidth.toCm();
}

Cm TrackClassicalClefView::height() const
{
	QChar clef = 182;
	QFontMetrics fm(font);
	
	Pixel pixelHeight(fm.boundingRect(clef).height(), dpi());
	pixelHeight.fromOtherDpi(75);
	
	return pixelHeight.toCm();
}
