#pragma once

#include "UIGQWidgetBase.h"

namespace QtCharts
{
	class QChartView;
	class QChart;
	class QValueAxis;
	class QBarSeries;
	class QBarCategoryAxis;
	class QPieSeries;
}

namespace UIGQtLib
{
	class UIGQPieChartImpl;
	class UIGQPieChart : public QWidget, public IUIGQWidgetBase
	{
	public:
		UIGQPieChart(QWidget* pParent = nullptr);
		~UIGQPieChart();

		UIG_QT_CTRL_DEF("qtpiechart", UIGQPieChart);

		void setBackgroundStyle(const FillStyle& fillStyle);
		const FillStyle& getBackgroundStyle();

		void initDemoData();

		QtCharts::QChartView*		getChartView() { return	_chartView; }
		QtCharts::QChart*			getChart() { return	_chart; }
		QtCharts::QPieSeries*		getPieSeries() { return _pieSeries; }

	protected:
		void paintEvent(QPaintEvent * evt);
		void resizeEvent(QResizeEvent * event);

	private:
		UIGQPieChartImpl* _ctrlImpl;

		QtCharts::QChartView*			_chartView;
		QtCharts::QChart*				_chart;
		QtCharts::QPieSeries*			_pieSeries;

		UIGQT_GET_CONTROLBASE;
	};
}
