#ifndef SHSGRAPHIC_H
#define SHSGRAPHIC_H

#include <QWidget>
#include <graphic.h>
#include "shs_widgets_export.h"

QT_BEGIN_NAMESPACE


class SHS_WIDGETS_EXPORT SHSGraphic: public Graphic
{
	Q_OBJECT
	Q_PROPERTY(QStringList variables READ variables WRITE setVariables DESIGNABLE false)
public:
	explicit SHSGraphic(QWidget * parent = 0);
	~SHSGraphic();

	void setVariables(const QStringList & v);
	QStringList variables() const;
	QMap<QString, QString> variablesMap() const;
	QStringList variableNames() const;

	void reset();
	void showProgress();
	void graphicDone(QString vname);
	bool isAllDone() const {return all_done;}

	void buildDebug();
	
private:
	void resizeEvent(QResizeEvent * e);
	void timerEvent(QTimerEvent * e);

	QList<QPair<QString, QString> > vars; // <name, label>
	QSet<QString> done_vars;
	QImage image_progress;
	QRectF prog_rect;
	bool prog_visible, all_done;
	int timer_progress, angle;
	
private slots:
	void canvasPaint(QPainter * p);

public slots:
	
signals:

};

QT_END_NAMESPACE

#endif // SHSGRAPHIC_H
