#ifndef __ToolRoundRectEdit_h
#define __ToolRoundRectEdit_h

#include "ToolBaseEdit.h"	// Super class.

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif
#define SUPER_CLASS FCToolBaseEdit


class FCObjRoundRect;

/*************************************************************************
 * <_xZkqqHx_iDeOiDiJiDfI_xHqqkZx_>	FCToolBaseEdit
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKnLiKhAiLoJiMgA_xHqqkZx_(FCObjRoundRect)_xZkqqHx_iCmMiKhAiCmMiKnLiClDiCpAiPeDjAlDiClHiCoJiDgDiBfLiDiLiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.13 Fukushiro M. FDA_xZkqqHx_iMgAiOkOiCmJjFmPiNfIiBeC_xHqqkZx_
 *************************************************************************/
class FCToolRoundRectEdit : public SUPER_CLASS
{
protected:
typedef SUPER_CLASS BASE_CLASS;

public:
	//----- _xZkqqHx_iDfEiDhFiDeOiDiJiDfIiCmFjEeDiInD_xHqqkZx_ -----
	virtual void	Select (CDC* pDC);
	virtual void	DrawSelectMark (CDC* pDC, FCObjDynabase* pObj);

	virtual BOOL	CanHandle (const FCObjDynabase* pObj) const;

protected:
	//----- _xZkqqHx_iClBiCmMiDeOiDiJiDfIiMmFjHeM_xHqqkZx_ -----
	virtual void	Calc8Points (DBLPoint mmpt[], const FCObjRoundRect* pRRect,
								 const DBLPoint& mmptRound) const;
	virtual void	BackConvert (DBLPoint& mmpt, const FCObjRoundRect* pRRect) const;
	virtual BOOL	CheckHitLine ();
	virtual void	CalcPolygon ();
	virtual void	DrawEditLine (CDC* pDC, const FCObjRoundRect* pRRect,
									const DBLPoint& mmptRound) const;

	//----- FCToolBaseFDA_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjHhGiCmJiJjOiClGiCmE_xHqqkZx_ -----
	virtual int			TransFDA (int iState, int iEvent);
	virtual void		StateFDA (int iState, CDC* pDC);

	//----- _xZkqqHx_jBeKiInKiPpDjBnEiPiIjHjNiBgJiDeJiBfLiDgPiBfLiDiJiDeDiDgIiBgK_xHqqkZx_ -----
	virtual void	StateIdle (CDC* pDC);
	//----- _xZkqqHx_jBeKiInKiPpDjBnEiPiIjHjN_xHqqkZx_ -----
	virtual void	StateEnterEditRound (CDC* pDC);
	virtual void	StateStartEditRound (CDC* pDC);
	virtual void	StateEditingRound (CDC* pDC);
	virtual void	StateStopEditRound (CDC* pDC);
	virtual void	StateExitEditRound (CDC* pDC);

	//----- FCToolBaseEdit_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjAhL_xHqqkZx_ -----
	virtual void	ResetEditHandleList ();

protected:
// _xZkqqHx_iClBiCmMiDeOiDiJiDfIiMmFjHeMiCmMjCoIiLgAiBeC_xHqqkZx_
enum
{
	STATE_BEGIN = BASE_CLASS::STATE_END,	// _xZkqqHx_iPpDjBnEiKeKiOgOiBeC_xHqqkZx_
	STATE_ENTER_EDIT_ROUND,	// _xZkqqHx_jCfLjDfPiInKjDkOjDpMiMpLiBeC_xHqqkZx_
	STATE_START_EDIT_ROUND,	// _xZkqqHx_iKnLiKhAjFnCiPfHiKeKiOgOiBeC_xHqqkZx_
	STATE_EDITING_ROUND,	// _xZkqqHx_iKnLiKhAjFnCiPfHjCiGiBeC_xHqqkZx_
	STATE_STOP_EDIT_ROUND,	// _xZkqqHx_iKnLiKhAjFnCiPfHiPeJjHlJiBeC_xHqqkZx_
	STATE_EXIT_EDIT_ROUND,	// _xZkqqHx_iKnLiKhAjFnCiPfHiPgPiMpLiBeC_xHqqkZx_
	STATE_END,				// _xZkqqHx_iPpDjBnEiPeJjHlJiBeC_xHqqkZx_
};

enum
{
	FDRE_HIT_NONE = 0,
	FDRE_HIT_VERT_LEFT	= 0x01 << 0,
	FDRE_HIT_VERT_RIGHT	= 0x01 << 1,
	FDRE_HIT_HORZ_TOP	= 0x01 << 2,
	FDRE_HIT_HORZ_BOTTOM= 0x01 << 3,
};

protected:
	FCObjRoundRect*	m_pHitObj;		// _xZkqqHx_iMjPiNpFiDhBiDgCiDgHiClFiClNjFjEjFgJiBeC_xHqqkZx_
	int				m_iHitLine;		// _xZkqqHx_iMjPiNpFiDhBiDgCiDgHiClFiClNiPeDjAlDjApMiBeC_xHqqkZx_
	DBLPoint		m_mmptRound;	// _xZkqqHx_iMlLiNnNiCmMiKhAiCmMiKnLiClDiCpAiLeMjIfOiBeC_xHqqkZx_
	CPointVector	m_vlgptPoly;	// _xZkqqHx_iJlMjApMiCmMiDhMiDiKiDfDiDjDjEhKjHpBiBeC_xHqqkZx_
}; // class FCToolRoundRectEdit.

// 02.12.05 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//extern FCToolRoundRectEdit	g_toolRoundRectEdit;

#endif//__ToolRoundRectEdit_h
