#ifndef _CGUI_HPP_
#define _CGUI_HPP_

/*** SDL Header Files ***/
#include <SDL.h>

/*** Custom Header Files ***/
#include "../TextTypeEngine/cFont.hpp"
#include "../MathEngine/iVector/iVector4.hpp"

#include "cWindow.hpp"
//#include "cPanel.hpp"

/*** DLL Header File ***/
#include "dllExport.h"

/*** Custom Header Files ***/
#include "../UtilityEngine/cString.hpp"
#include "../MathEngine/iVector/iVector2.hpp"

using UtilityEngine::cString;

namespace GUIEngine {
	/* Singleton */
	class EXPORT_FROM_MYDLL cGUI
	{
	private:
		cGUI();
		~cGUI();

	public:
		enum EXPORT_FROM_MYDLL eGUIEventType: unsigned int
		{
			MouseButton1 = 0,
			MouseButton2,
			MouseButton3,
			Keyboard
		};
		///Functions
		static cGUI& Inst();
		static void Delete();

		const bool Initialize( const cString& filename, const cString& dir = "", const unsigned long int size = 16 );

		void Event( const MathEngine::iVector2& location, const eGUIEventType& type );
		const MathEngine::iVector2 DisplayArea() const;

		void AddObject( GUIEngine::cWindow* obj );

		std::vector<GUIEngine::cWindow*>& GetObjects();

		void Display();

		///Sets
		void setDebugLevel( const unsigned long int debugLevel );

		void setFont( TextTypeEngine::cFont* font );
		void setFont( const cString& filename, const cString& dir = "", const unsigned long int size = 16 );

		void setTextColour( const GUIHelpers::RGBA& colour );
		void setTextColour( const unsigned long int red = 0, const unsigned long int green = 0, const unsigned long int blue = 0 );

		void setPadding( const GUIHelpers::Padding& padding );
		void setPadding( const unsigned int top = 5, const unsigned int right = 5, const unsigned int bottom = 5, const unsigned int left = 5 );

		void setAlign( const GUIHelpers::eAlign& align = GUIHelpers::eAlign::CENTER );

		///Gets
		const unsigned long int getDebugLevel() const;

		TextTypeEngine::cFont* getFont();

		const GUIHelpers::RGBA& getTextColour() const;
		void getTextColour( unsigned long int& red, unsigned long int& green, unsigned long int& blue ) const;

		const GUIHelpers::Padding& getPadding() const;
		void getPadding( unsigned int& top, unsigned int& right, unsigned int& bottom, unsigned int& left ) const;

		const GUIHelpers::eAlign& getAlign() const;

		const bool IsInit() const;

	private:
		static cGUI* sp_inst;// = nullptr

		unsigned long int m_debugLevel;// = 0

		bool m_inited;// = false

		/* default GUI font */
		TextTypeEngine::cFont* mp_font;// = nullptr

		/* default GUI text colour black*/
		//GUIHelpers::RBGA m_textColour;// = { 0, 0, 0 }

		/* default GUI padding */
		//GUIHelpers::Padding m_padding;// = { 5, 5, 5, 5 }

		/* default GUI align */
		//GUIHelpers::eAlign m_align;// = GUIHelpers::eAlign::CENTER

		std::vector<GUIEngine::cWindow*> m_children;
	};/// END CLASS DEFINITION cGUI
}/// END NAMESPACE DEFINITION GUIEngine
#endif/// END IFNDEF _CGUI_HPP_
