#ifndef __ToolBaseFDA_h
#define __ToolBaseFDA_h

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

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif
#define SUPER_CLASS FCToolBase


enum FTMolipKind;
struct FCMolipRec;
typedef set<FCMolipRec> FTMolipSet;


class FCToolBaseFDA : public SUPER_CLASS
{
protected:
typedef SUPER_CLASS BASE_CLASS;

public:
	FCToolBaseFDA ();

	//----- _xZkqqHx_iDfEiDhFiDeOiDiJiDfIiCmFjEeDiInD_xHqqkZx_ -----
	virtual void	OnLButtonDblClk (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnLButtonDown (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnMouseMove (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnLButtonUp (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnRButtonDown (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnRButtonUp (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnRButtonDblClk (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
//----- 01.11.09 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	virtual void	OnMButtonDown (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnMButtonUp (CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnWindowMessage (CDC* pDC, DWORD dwMessage,
												WPARAM wParam, LPARAM lParam);
//----- 01.11.09 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	virtual void	OnKeyDown (CDC* pDC, UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void	OnKeyUp (CDC* pDC, UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void	OnChar (CDC* pDC, UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void	OnAnyToolCommand (CDC* pDC, UINT dwCommand);
// 01.11.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	OnTimer (CDC* pDC);

// 05.07.28 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	OnPursuerTextNeedInfo ();

	virtual void	OnContextMenu (CDC* pDC, const DBLPoint& mmptMsc);
	virtual void	OnDraw (CDC* pDC);
// 05.07.25 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	OnDraw (CDC* pDC, const DBLRect* pmmrtRgn = NULL, long lRgnSize = 0);
	virtual void	Select (CDC* pDC);
	virtual void	Unselect (CDC* pDC);
	virtual int		GetCurrentState () const;

protected:
	//----- FCToolBaseFDA_xZkqqHx_iMmFjHeM_xHqqkZx_ -----
	virtual HCURSOR	GetDefaultIdleCursor () const;
	virtual void	SetIdleCursor (HCURSOR hCursor);

	virtual void	OnMsEvent (int iEvent, CDC* pDC, const DBLPoint& mmptMsc, UINT nFlags);
	virtual void	OnKyEvent (int iEvent, CDC* pDC, UINT nChar, UINT nRepCnt, UINT nFlags);
	virtual void	OnCmEvent (CDC* pDC, DWORD dwCommand);
// 01.11.11 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	OnTmEvent (CDC* pDC);
	virtual BOOL	IsControl () const;
	virtual BOOL	IsShift () const;
// 05.07.28 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual void	GetObjectHintText (WString& wstrHint, const FCObjDynabase* pObj) const;

	//----- FCToolBaseFDA_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjHhGiCmJiJjOiClGiCmE_xHqqkZx_ -----
//----- 06.12.09 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	virtual void	OnDrawState (CDC* pDC, int iState);
//----- 06.12.09 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	virtual int		TransFDA (int iState, int iEvent);
	virtual void	StateFDA (int iState, CDC* pDC);
// 05.07.04 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	virtual BOOL	CheckHitObject (FCObjDynabase*& pHitObj, WORD wFlag) const;
	virtual void	DrawMark (CDC* pDC, BOOL bErase = FALSE);

	//----- _xZkqqHx_jBeKiInKiPpDjBnEiPiIjHjN_xHqqkZx_ -----
	virtual void	StateIdle (CDC* pDC);				// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
	virtual void	StateExitToolByButton (CDC* pDC);	// _xZkqqHx_iDgDiBfLiDiLiPeJjHlJiBeC_xHqqkZx_
	virtual void	StateCancelTool (CDC* pDC);			// _xZkqqHx_iDgDiBfLiDiLiDeMiDiDiDjDiDfKiDiLiBeC_xHqqkZx_
	virtual void	StateContextMenu (CDC* pDC);		// _xZkqqHx_iJeFiDhLiDfOiDjDiDiBiDgKiDiFiBfLjFfMiOkGiBeC_xHqqkZx_
	virtual void	StateContextMenuLink (CDC* pDC);	// _xZkqqHx_iDiKiDjDiDeOiDiBiDgKiDiFiBfLjFfMiOkGiBeC_xHqqkZx_
	virtual void	StateLinkCommand (CDC* pDC);		// _xZkqqHx_iDiKiDjDiDeOiDfCiDhNiDjDiDgIiBeC_xHqqkZx_

//----- 01.11.10 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	virtual void	StateEnterScrollScreen (CDC* pDC);	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLjDpMiMpLiBeC_xHqqkZx_
	virtual void	StateStartScrollScreen (CDC* pDC);	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiKeKiOgOiBeC_xHqqkZx_
	virtual void	StateScrollingScreen (CDC* pDC);	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLjCiGiBeC_xHqqkZx_
	virtual void	StateStopScrollScreen (CDC* pDC);	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiPeJjHlJiBeC_xHqqkZx_
	virtual void	StateExitScrollScreen (CDC* pDC);	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiPgPiMpLiBeC_xHqqkZx_
	virtual void	StateHandScrollScreen (CDC* pDC);	// _xZkqqHx_iOoIiMfOiDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiBeC_xHqqkZx_
//----- 01.11.10 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
// 05.07.27 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	virtual void	StatePageKeydown (CDC* pDC);		// PageUp,PageDown_xZkqqHx_iDeMiBfLiBeC_xHqqkZx_

	//----- FCToolBaseFDA_xZkqqHx_iCmMiDfEiDhFiDeOiDiJiDfIiCmFjFeLjHhGiCmJiJjOiClGiCmE_xHqqkZx_ -----
	virtual int		GetSubMenuIndex () const;		// OnContextMenu_xZkqqHx_iCmMiDiBiDgKiDiFiBfLiCmFjFfMiOkGiClHiCoJiDiBiDgKiDiFiBfLiCmMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	virtual BOOL	CanLinkToSelection () const;	// Idle_xZkqqHx_iCmF_xHqqkZx_CTRL+MSMOVE_xZkqqHx_iCmFiDiKiDjDiDeOiCkKjCkDiCoKiCoJiCkJiBeI_xHqqkZx_
	virtual void	GetSelectionForLink (FTMolipSet& stMolip) const;
													// _xZkqqHx_iDiKiDjDiDeOiCpAjCkDiCoJiClNiCnPiCmMiDiCiDiKiDhGiPfHiNiHiCpAjFnEiClHiBeC_xHqqkZx_
	virtual void	GetIgnoreForSearchLink (FTMolipSet& stMolip) const;
													// _xZkqqHx_iDiKiDjDiDeOiCpAiMjPiNpFiClHiCoJiCmGiCkLiCmJjGlDiOiLiClHiCoJiDiCiDiKiDhGiPfHiNiHiCpAjFnEiClHiBeC_xHqqkZx_

	virtual void	PopupLinkMenu () const;			// _xZkqqHx_iDiKiDjDiDeOiOoNiCmMiDiBiDgKiDiFiBfLiCpAjFfMiOkGiBeC_xHqqkZx_
	virtual DWORD	CommandToLinkKind (DWORD dwCommand, BOOL bIsCenterMolipFrom);
													// PopupLinkMenu_xZkqqHx_iCmMiDiBiDgKiDiFiBfLiCkJiCoHiDiKiDjDiDeOiOoNiCpAiOoGjDlOiBeC_xHqqkZx_
	virtual DWORD	CommandToLinkKindBoth (DWORD dwCommand, BOOL bIsCenterMolipFrom, BOOL bIsCenterMolipTo);
													// PopupLinkMenu_xZkqqHx_iCmMiDiBiDgKiDiFiBfLiCkJiCoHiDiKiDjDiDeOiOoNiCpAiOoGjDlOiBeC_xHqqkZx_

public:
// _xZkqqHx_iClBiCmMiDeOiDiJiDfIiMmFjHeMiCmMjCoIiLgAiBeC_xHqqkZx_
enum
{
	STATE_NONE = 0,				// _xZkqqHx_iPpDjBnEjGlDiClFiBeC_xHqqkZx_
	STATE_IDLE,					// _xZkqqHx_jBnCiClPiBeC_xHqqkZx_
	STATE_EXIT_TOOL_BY_BUTTON,	// _xZkqqHx_iDhNiDeFiDfIiDhLiDfOiDjDiCmJiCoGiCoIiDgDiBfLiDiLiPeJjHlJiBeC_xHqqkZx_
	STATE_CANCEL_TOOL,			// _xZkqqHx_iDgDiBfLiDiLiDeMiDiDiDjDiDfKiDiLiBeC_xHqqkZx_
	STATE_CONTEXT_MENU,			// _xZkqqHx_iJeFiDhLiDfOiDjDiDiBiDgKiDiFiBfLjFfMiOkGiBeC_xHqqkZx_
	STATE_CONTEXT_MENU_LINK,	// _xZkqqHx_iDiKiDjDiDeOiDiBiDgKiDiFiBfLjFfMiOkGiBeC_xHqqkZx_
	STATE_LINK_COMMAND,			// _xZkqqHx_iDiKiDjDiDeOiDfCiDhNiDjDiDgIiBeC_xHqqkZx_
//----- 01.11.10 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	STATE_ENTER_SCROLL_SCREEN,	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLjDpMiMpLiBeC_xHqqkZx_
	STATE_START_SCROLL_SCREEN,	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiKeKiOgOiBeC_xHqqkZx_
	STATE_SCROLLING_SCREEN,		// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLjCiGiBeC_xHqqkZx_
	STATE_STOP_SCROLL_SCREEN,	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiPeJjHlJiBeC_xHqqkZx_
	STATE_EXIT_SCROLL_SCREEN,	// _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiPgPiMpLiBeC_xHqqkZx_
	STATE_HAND_SCROLL_SCREEN,	// _xZkqqHx_iOoIiMfOiDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLiBeC_xHqqkZx_
//----- 01.11.10 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
// 05.07.27 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	STATE_PAGE_KEYDOWN,			// PageUp,PageDown_xZkqqHx_iDeMiBfLiBeC_xHqqkZx_
	STATE_END,					// _xZkqqHx_iPpDjBnEiPeJjHlJiBeC_xHqqkZx_
};

protected:
	//----- _xZkqqHx_iDhNiDeFiDfIiDeKiBfLiDfMiDiLiKnGiMfH_xHqqkZx_ -----
	HCURSOR		m_hIdleCursor;		// StateIdle_xZkqqHx_iOjOiCmMiDeKiBfLiDfMiDiLiDgOiDjDiDgIiDiLiBeC_xHqqkZx_

	//----- _xZkqqHx_iDeMiBfLjDpMjHmNjFmPiKlHiKnGiMfH_xHqqkZx_ -----
	BOOL		m_bControlInvert;	// _xZkqqHx_iDfCiDjDiDgHiDiNiBfLiDiLiDeMiBfLiCmMiJjPiClFiClNiPpDjBnEiCpAjElNjDfNiClHiCoJiCkJiBeI_xHqqkZx_
	BOOL		m_bShiftInvert;		// _xZkqqHx_iDfGiDhEiDgHiDeMiBfLiCmMiJjPiClFiClNiPpDjBnEiCpAjElNjDfNiClHiCoJiCkJiBeI_xHqqkZx_

	//----- _xZkqqHx_iDhNiDeFiDfIiInKjDkOjAkHiMmAjHhAjFmPjAjE_xHqqkZx_ -----
	DBLPoint		m_mmptFix;
	DBLLineVector	m_mmlnvAry;

	//----- _xZkqqHx_iDgDiBfLiDiLiCmMiPpDjBnEjFmPjAjE_xHqqkZx_ -----
	int			m_iCurState;		// FDA_xZkqqHx_iCmMiMlLiNnNiCmMiPpDjBnEiBeC_xHqqkZx_
	DBLPoint	m_mmptLRButtonDown;	// _xZkqqHx_iNmFiMoDiCmJiDhNiDeFiDfIiCmMiJeFiBeFiNlGiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiOjOiCmMiDhNiDeFiDfIiNmAjFfHiBeC_xHqqkZx_
	DBLPoint	m_mmptMsc;			// _xZkqqHx_iMlLiNnNiCmMiDhNiDeFiDfIiNmAjFfHiBeC_xHqqkZx_
	DBLPoint	m_mmptCnv;			// _xZkqqHx_jFmPiKlHiMoDiDhNiDeFiDfIiNmAjFfHiBeC_xHqqkZx_
	DWORD		m_dwFlags;			// _xZkqqHx_jDkPiOjOiDeMiBfLiCmMiPpDjBnEiBeC_xHqqkZx_
	DWORD		m_dwChar;			// _xZkqqHx_iMlLiNnNiCmMiDeMiBfLiDfCiBfLiDgIiBeC_xHqqkZx_
	DWORD		m_dwRepCnt;			// _xZkqqHx_iDeMiBfLiDfCiBfLiDgIiCmMiDiKiDhDiBfLiDgHiPpDjBnEiBeC_xHqqkZx_
	DWORD		m_dwCommand;		// _xZkqqHx_iMlLiNnNiCmMiDfCiDhNiDjDiDgIiBeC_xHqqkZx_
	DWORD		m_dwWParam;			// WindowMessage_xZkqqHx_iCmM_xHqqkZx_wParam_xZkqqHx_iBeC_xHqqkZx_
	DWORD		m_dwLParam;			// WindowMessage_xZkqqHx_iCmM_xHqqkZx_lParam_xZkqqHx_iBeC_xHqqkZx_

//----- 01.12.13 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_iDhNiDeFiDfIiDeKiBfLiDfMiDiLiCmMiCoEiCoHiCkMjGgIiOhO_xHqqkZx_ ------
	BOOL		m_lShakeBtnDownFlag;		// _xZkqqHx_iNlGiJeFiDhLiDfOiDjDiCmMiPpDjBnEiBeCiDhLiDfOiDjD_xHqqkZx_ON_xZkqqHx_iCmF_xHqqkZx_+1_xZkqqHx_iBeBiDhLiDfOiDjD_xHqqkZx_Off_xZkqqHx_iCmF_xHqqkZx_-1_xZkqqHx_iBeC_xHqqkZx_
	long		m_lShakeBtnDownPixel;		// _xZkqqHx_iDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiPpDjBnEiCmFiCmMiDhNiDeFiDfIiCmMiCoEiCoHiCkMiDhDiDeOiDfKiDiLjAjEiBeC_xHqqkZx_
	DBLPoint	m_mmptShakeBtnDownPoint;	// _xZkqqHx_iNlGiDhLiDfOiDjDiCkKiJjPiClDiCoKiClNiPpDjBnEiCmFiBeBiDhNiDeFiDfIiCkKiCoEiCoHiCkCiCmFiCkCiCmIiCkCiBeC_xHqqkZx_
//----- 01.12.13 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	//----- _xZkqqHx_iDeKiBfLiDfMiDiLiDhNiBfLiDeOjFfMiOkGjHhAjFmPjAjE_xHqqkZx_ -----
	DBLPoint	m_mmptMarkOld;		// _xZkqqHx_iMmDiCkCiDhNiBfLiDeOjFgAiJoGiNmAjFfHiBeC_xHqqkZx_
	DBLPoint	m_mmptMarkNew;		// _xZkqqHx_jAfGiClFiCkCiDhNiBfLiDeOjFgAiJoGiNmAjFfHiBeC_xHqqkZx_
	FTMolipKind	m_iCursorNew;		// _xZkqqHx_iMlLiNnNiCmMiDeKiBfLiDfMiDiLiPoOjFpBiBeC_xHqqkZx_
	FTMolipKind	m_iCursorOld;		// _xZkqqHx_jBePiJpBiCmMiDeKiBfLiDfMiDiLiPoOjFpBiBeC_xHqqkZx_

	//----- _xZkqqHx_iDeBiDeDiDgIiDiLiOjOiCmMiDfIiDgFiBfLiDfOiDfIiDgPiBfLjFfMiOkGjFlGiOjK_xHqqkZx_ -----
	WString		m_strIdleStatus;	// _xZkqqHx_iDeBiDeDiDgIiDiLiOjOiCmMiDfIiDgFiBfLiDfOiDfIiDgPiBfLjFfMiOkGjFlGiOjKiBeC_xHqqkZx_

	//----- _xZkqqHx_iDiCiDiKiDhGiMjPiNpFiMiLiJmK_xHqqkZx_ -----
	FCObjDynabase*	m_pHitMolipObj;		// _xZkqqHx_iDiKiDjDiDeOjFjEjFgJiBeC_xHqqkZx_
	long		m_lHitMolip;		// _xZkqqHx_iDiKiDjDiDeOiDiCiDiKiDhGiBeC_xHqqkZx_

	//----- _xZkqqHx_iDhMiDgCiDhGiDeBiDgCiDhGiDiKiDjDiDeOiDiBiDgKiDiFiBfL_xHqqkZx_ -----
	DWORD		m_dwTopCommand;		// _xZkqqHx_iDhMiDgCiDhGiDeBiDgCiDhGiDiKiDjDiDeOiDiBiDgKiDiFiBfLiCmMjHeEjAoGiDfCiDhNiDjDiDgIiBeC_xHqqkZx_

	//----- _xZkqqHx_iDfIiDeOiDiKiBfLiDjDiDfIiDeOiDiNiBfLiDiLjHhAjFmPjAjE_xHqqkZx_ -----
	DBLPoint	m_mmptScrollBasePos;	// _xZkqqHx_iDhNiDeFiDfIiDeKiBfLiDfMiDiLiKoOiPiAiImKjChFiBeC_xHqqkZx_
	CPoint		m_dvptScrollBaseOrig;	// _xZkqqHx_iDhNiDeFiDfIiDeKiBfLiDfMiDiLiKoOiPiAiImKjChFiBeCiDfIiDeOiDiKiBfLiDjDiNmAjFfHiBeC_xHqqkZx_
	CBitmap		m_bitmapScrollBack;		// _xZkqqHx_iDfIiDeOiDiNiBfLiDiLiKoOiPiAiDhNiBfLiDeOjEhHiMgJiBeC_xHqqkZx_

	static HICON	m_hIconScrollMark;		// _xZkqqHx_iDeBiDeDiDfCiDjDiBeC_xHqqkZx_

}; // class FCToolBaseFDA.

#endif//__ToolBaseFDA_h
