#ifndef _COMMON_ICONINFO_HPP_
#define _COMMON_ICONINFO_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif

class IconInfo : private _ICONINFO
{
public:
  enum IconType{TypeIcon=0x0000,TypeCursor=0x0001};
	IconInfo(void);
	IconInfo(const IconInfo &someIconInfo);
	~IconInfo();
  operator _ICONINFO&(void);
	IconInfo &operator=(const IconInfo &someIconInfo);
	WORD operator==(const IconInfo &someIconInfo);
	IconType iconType(void)const;
	DWORD xHotSpot(void)const;
	DWORD yHotSpot(void)const;
	HBITMAP maskBitmap(void)const;
	HBITMAP colorBitmap(void)const;
protected:
	void maskBitmap(HBITMAP hMaskBitmap);
	void colorBitmap(HBITMAP hColorBitmap);
private:
	void iconType(IconType iconType);
	void xHotSpot(DWORD xHotSpot);
	void yHotSpot(DWORD yHotSpot);
};

inline
IconInfo::IconInfo(void)
{
	iconType(TypeIcon);
	xHotSpot(0);
	yHotSpot(0);
	maskBitmap(0);
  colorBitmap(0);
}

inline
IconInfo::IconInfo(const IconInfo &someIconInfo)
{
	*this=someIconInfo;
}

inline
IconInfo::~IconInfo()
{
}

inline
IconInfo::operator _ICONINFO&(void)
{
  return *this;
}

inline
IconInfo &IconInfo::operator=(const IconInfo &someIconInfo)
{
	iconType(someIconInfo.iconType());
	xHotSpot(someIconInfo.xHotSpot());
	yHotSpot(someIconInfo.yHotSpot());
	maskBitmap(someIconInfo.maskBitmap());
	colorBitmap(someIconInfo.colorBitmap());
  return *this;
}

inline
WORD IconInfo::operator==(const IconInfo &someIconInfo)
{
	return (iconType()==someIconInfo.iconType()&&
					xHotSpot()==someIconInfo.xHotSpot()&&
					yHotSpot()==someIconInfo.yHotSpot()&&
					maskBitmap()==someIconInfo.maskBitmap()&&
					colorBitmap()==someIconInfo.colorBitmap());	
}

inline
IconInfo::IconType IconInfo::iconType(void)const
{
	return (IconType)_ICONINFO::fIcon;
}

inline
void IconInfo::iconType(IconType iconType)
{
	_ICONINFO::fIcon=(WORD)iconType;
}

inline
DWORD IconInfo::xHotSpot(void)const
{
	return _ICONINFO::xHotspot;
}

inline
void IconInfo::xHotSpot(DWORD xHotSpot)
{
	_ICONINFO::xHotspot=xHotSpot;
}

inline
DWORD IconInfo::yHotSpot(void)const
{
	return _ICONINFO::yHotspot;
}

inline
void IconInfo::yHotSpot(DWORD yHotSpot)
{
	_ICONINFO::yHotspot=yHotSpot;
}

inline
HBITMAP IconInfo::maskBitmap(void)const
{
	return _ICONINFO::hbmMask;
}

inline
void IconInfo::maskBitmap(HBITMAP hMaskBitmap)
{
	_ICONINFO::hbmMask=hMaskBitmap;
}

inline
HBITMAP IconInfo::colorBitmap(void)const
{
	return _ICONINFO::hbmColor;
}

inline
void IconInfo::colorBitmap(HBITMAP hColorBitmap)
{
	_ICONINFO::hbmColor=hColorBitmap;
}
#endif
