/**
** 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"

namespace UIGQtLib
{
	enum UIGQtICDType
	{
		UIG_ICD_ECG = 0,
		UIG_ICD_MARKER,
		UIG_ICD_A,
		UIG_ICD_V,
		UIG_ICD_LV
	};

	class UIGQICDChartImpl;
	class UIGEARSQTLIB_EXPORT UIGQICDChart : public QWidget, public IUIGQWidgetBase
	{
	public:
		UIGQICDChart(QWidget* pParent = nullptr);
		~UIGQICDChart();

		UIG_QT_CTRL_DEF("qtecgchart", UIGQICDChart);

		void addData(float x, float data);
		void addMarker(float x, bool isAp);
		void addMarkerValue(float x, int value1, int value2, int value3);

		int dataSize() const;
		void clearData();
		void popBack();
		void popFront();
		void setLineWeight(float lineweight);
		float getLineWeight();
		void swapData();
		void setLineColor(QColor start, QColor end);
		QPointF getAt(int idx);

		void setICDType(UIGQtICDType type);

	protected:
		void paintEvent(QPaintEvent* pPainterEvent);

	private:
		UIGQICDChartImpl*	_ctrlImpl;

		UIGQT_GET_CONTROLBASE;
	};
}
