#ifndef WIDGETS_GRAPHPLOTTER_AXISITEMS_H
#define WIDGETS_GRAPHPLOTTER_AXISITEMS_H

#include "Common.h"

#include <QGraphicsTextItem>


// -- TDE NAMESPACE ----------------------------------------------------

namespace TDE {

// -- Widgets NAMESPACE ------------------------------------------------

namespace Widgets {

namespace Plot {


class GraphPlotterBaloon;

typedef SHARED_PTR<GraphPlotterBaloon> GraphPlotterBaloonPtr;

// see http://www.dayofthenewdan.com/2012/12/12/Text_Balloon_QGraphicsView.html

class GraphPlotterBaloon : public QGraphicsTextItem
{
	Q_OBJECT

public:
	enum Orientation
	{
		Down = -1,
		Up = 1
	};

	GraphPlotterBaloon(Orientation orientation = Up, QGraphicsItem *parent = 0) :
		QGraphicsTextItem(parent), m_orientation(orientation) {}
	GraphPlotterBaloon(const QString& text, Orientation orientation = Up, QGraphicsItem *parent = 0) :
		QGraphicsTextItem(text, parent), m_orientation(orientation) {}

	virtual QRectF boundingRect() const;

	virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);

private:
	Orientation m_orientation;
};


} /* end of namespace Plot */

} /* end of namespace Widgets */

} /* end of namespace TDE */

#endif /* WIDGETS_GRAPHPLOTTER_AXISITEMS_H */
