/**
** This file is owned by VisualGear Technology Co., Ltd.
** Unauthorized copying of this file, via any medium is strictly prohibited
** Otherwise VisualGear Technology Co., Ltd. will have the right to pursue
** maximum responsibilities within scope of legal.
**
** Copyright 2018-2020 VisualGear All rights reserved.
**/

#pragma once

#include <QtWidgets/QLabel>
#include "UIGearsQtLib.h"
#include "UIGQWidgetBase.h"

namespace UIGQtLib
{
	class UIGQECGChartImpl;
	class UIGEARSQTLIB_EXPORT UIGQECGChart : public QWidget, public IUIGQWidgetBase
	{
	public:
		UIGQECGChart(QWidget* pParent = nullptr);
		~UIGQECGChart();

		UIG_QT_CTRL_DEF("qtecgchart", UIGQECGChart);

		void addData(float x, float data);
		int dataSize() const;
		void clearData();
		void popBack();
		void popFront();
		void setLineWeight(float lineweight);
		float getLineWeight();
		void swapData();
		void setLineColor(QColor start, QColor end);
		void enableFillColor(bool bEnableBelow, bool bEnableAbove);
		void setBelowFillColor(QColor start, QColor end);
		void setAboveFillColor(QColor start, QColor end);
		QPointF getAt(int idx);

	protected:
		void paintEvent(QPaintEvent* pPainterEvent);

	private:
		UIGQECGChartImpl* _ctrlImpl;

		UIGQT_GET_CONTROLBASE;
	};
}
