/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/include/sgx/gui/guiskin.hpp

*/

#ifndef SGX_CORE_GUI_GUISKIN_HPP
#define SGX_CORE_GUI_GUISKIN_HPP	1

class CSGXTexture;
class sgxGUIStaticImageParams;
class sgxGUIDynamicImageParams;


class sgxGUISkinnedWidget {
public:
	sgxGUISkinnedWidget();

	virtual void	update(const tREAL32 telaps);
	virtual void	draw(CSGXDrawSurface *pSurface) const;

	sgxPoint2i		topleft;
	sgxPoint2i		bottomright;
	tBOOL			enabled;
	tBOOL			cursorOver;
};

class sgxGUISkinnedImageButton : public sgxGUISkinnedWidget {
public:
	typedef enum {
		eLeft,
		eRight,
		eUp,
		eDown,
		eCustom,
	} tButtonType;
	
	tBOOL				selected;
	tBOOL				focused;

	tButtonType			m_Type;
	// type is custom, we can use these:
	const CSGXTexture *	m_pTexture;
	tUINT32				m_iRegion;

};

class sgxGUISkinnedButton : public sgxGUISkinnedWidget {
public:
	tBOOL			selected;
	tBOOL			focused;
	sgxString		text;
};

class sgxGUISkinnedCheckBox : public sgxGUISkinnedWidget {
public:
	tBOOL			selected;
};

class sgxGUISkinnedRadioButton : public sgxGUISkinnedWidget {
public:
	tBOOL			selected;
};

class sgxGUISkinnedStaticImage : public sgxGUISkinnedWidget {
public:
	sgxGUISkinnedStaticImage(const sgxGUIStaticImageParams &params);

	virtual void	draw(CSGXDrawSurface *pSurface) const;
protected:
	const sgxGUIStaticImageParams &	m_Params;
};

class sgxGUISkinnedDynamicImage : public sgxGUISkinnedWidget {
public:
	sgxGUISkinnedDynamicImage(const sgxGUIDynamicImageParams &params);

	virtual void	draw(CSGXDrawSurface *pSurface) const;

	tUINT32		m_iCurrentRegion;

protected:
	const sgxGUIDynamicImageParams &	m_Params;
};

class sgxGUISkinnedStaticText : public sgxGUISkinnedWidget {
public:
	virtual void	draw(CSGXDrawSurface *pSurface) const;
};


class sgxGUISkinnedHotSpot : public sgxGUISkinnedWidget {

};

class sgxGUISkinSettings {
public:
	tBOOL	m_bUseTiledButtons;
	tBOOL	m_bSupportHover;

	sgxGUISkinSettings(tBOOL useTiles=FALSE, tBOOL supportHover=FALSE) :
		m_bUseTiledButtons(useTiles),
		m_bSupportHover(supportHover) {
	}
};

class CSGXGUISkin {
public:
	CSGXGUISkin();
	CSGXGUISkin(const sgxGUISkinSettings &settings);

	virtual CSGXTexture *  			 	getStandardTexture();
	virtual CSGXTexture *  			 	getStandardPointerTexture();
	virtual tUINT32 					getStandardPointerRegionIn() const;
	virtual tUINT32 					getStandardPointerRegionOut() const;

	virtual sgxGUISkinnedButton *		getSkinnedButton() const;
	virtual sgxGUISkinnedImageButton *	getSkinnedImageButton() const;
	virtual sgxGUISkinnedCheckBox *		getSkinnedCheckBox() const;
	virtual sgxGUISkinnedRadioButton *	getSkinnedRadioButton() const;
	virtual sgxGUISkinnedHotSpot *		getSkinnedHotSpot() const;
	virtual sgxGUISkinnedStaticImage *	getSkinnedStaticImage(const sgxGUIStaticImageParams &params) const;
	virtual sgxGUISkinnedDynamicImage *	getSkinnedDynamicImage(const sgxGUIDynamicImageParams &params) const;
	virtual sgxGUISkinnedStaticText *	getSkinnedStaticText() const;

	virtual tUINT32						getDefaultButtonWidth() const;
	virtual tUINT32						getDefaultButtonHeight() const;
	virtual tUINT32						getDefaultImageButtonWidth() const;
	virtual tUINT32						getDefaultImageButtonHeight() const;
	virtual tUINT32						getDefaultCheckBoxWidth() const;
	virtual tUINT32						getDefaultCheckBoxHeight() const;
	virtual tUINT32						getDefaultRadioButtonWidth() const;
	virtual tUINT32						getDefaultRadioButtonHeight() const;

	sgxGUISkinSettings	m_BaseSettings;

protected:
	CSGXTexture *m_pTexture;
};


#endif /* SGX_CORE_GUI_GUISKIN_HPP */
