#pragma once

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

namespace UIGQtLib
{
	class UIGQSplitterImpl;
	class UIGEARSQTLIB_EXPORT UIGQSplitter : public QWidget, public IUIGQWidgetBase
	{
        Q_OBJECT

	public:
		UIGQSplitter(QWidget* pParent = nullptr);
		~UIGQSplitter();

		UIG_QT_CTRL_DEF("qtsplitter", UIGQSplitter);

		void setUpLeftWidget(QWidget* pWidget);
		void setDownRightWidget(QWidget* pWidget);

		const QWidget* getUpLeftWidget();
		const QWidget* getDownRightWidget();

		void setUpLeftLimit(int nLimit);
		void setDownRightLimit(int nLimit);

		int getUpLeftLimit();
		int getDownRightLimit();

		void setBackground(const FillStyle& style);
		const FillStyle getBackground();

		void setIsHor(bool isHor);
		bool getIsHor();

	protected:
		void paintEvent(QPaintEvent * evt);
		void mouseMoveEvent(QMouseEvent *event);
		void mousePressEvent(QMouseEvent *event);
		void mouseReleaseEvent(QMouseEvent *event);

	private:
		UIGQSplitterImpl* _ctrlImpl;

		UIGQT_GET_CONTROLBASE;
	};
}
