#ifndef __ToolBaseCreate_h
#define __ToolBaseCreate_h

#include "ToolBaseFDA.h"	// Super class.
// 06.12.01 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
#include "ToolSelectObjTmpl.h"	// For Superclass.

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif
// 06.12.01 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//#define SUPER_CLASS FCToolBaseFDA
#define SUPER_CLASS FCToolSelectObjTmpl<FCToolBaseFDA, FCToolBaseCreateId>

//----- 06.12.01 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
// FCToolSelectTmpl _xZkqqHx_iCmMiDgFiDjDiDhGiDiMiBfLiDgH_xHqqkZx_ID_xZkqqHx_iCpAjCoIiLgAiBeC_xHqqkZx_
typedef struct FCToolBaseCreateId {} *XXX_CreateObjDynabase;
#define XXX_CREATE_OBJ_BASE		XXX_CreateObjDynabase(NULL)
//----- 06.12.01 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

#define FD_MAX_LASTOBJ_MEMORY	10

class FCObjDynabase;

/*************************************************************************
 * <_xZkqqHx_iDeOiDiJiDfI_xHqqkZx_>	FCToolBaseFDA
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMjBoFiCkLiClDiCpAiOhHjCoIiClFiCmEiNoMjAkMiClHiCoJiNoMjAkMiDgDiBfLiDiLiCmMiKoOjGhLiDeOiDiJiDfIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	00.01.18 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
class FCToolBaseCreate : public SUPER_CLASS
{
protected:
typedef SUPER_CLASS BASE_CLASS;

public:
enum FTWhichTmpl
{
	FDBC_REFO_INSIDE_OBJ = 0,	// _xZkqqHx_jDoAjFjEjFjEjFgJiCpAiMlDiCmJiClHiCoJiBeC_xHqqkZx_
	FDBC_REFO_LAST_OBJ,			// _xZkqqHx_iNmFiMoDiCmJiNoMjAkMiClDiCoKiClNjFjEjFgJiCpAiMlDiCmJiClHiCoJiBeC_xHqqkZx_
	FDBC_REFO_CHIP_OBJ,			// _xZkqqHx_iDgAiDgCiDhGjFjEjFgJiCpAiMlDiCmJiClHiCoJiBeC_xHqqkZx_
	FDBC_REFO_SELECT_OBJ,		// _xZkqqHx_jBeJjBpAjCiGiCmMjFjEjFgJiCpAiMlDiCmJiClHiCoJiBeC_xHqqkZx_
};

public:
	FCToolBaseCreate ();
	virtual void	OnViewCreate ();
	virtual void	OnViewDestroy ();
	virtual FCObjDynabase*	GetInsideObject () const;
	virtual FCObjDynabase*	CreateInsideObject ();

	//----- _xZkqqHx_iDfEiDhFiDeOiDiJiDfIiCmFjEeDiInD_xHqqkZx_ -----
	virtual void	OutStream (FCUndoArchive& ar, BOOL bIsOutObjectInfo);
	virtual void	InStream (FCUndoArchive& ar);
	virtual void	InitContents ();
	virtual BOOL	CanToolselfProperty () const;

// 05.04.24 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	virtual void	Select (CDC* pDC);
	virtual BOOL	CanSelectTool () const;

// 06.11.26 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	virtual BOOL	CanLockStatus () const;

	//----- _xZkqqHx_iClBiCmMiDeOiDiJiDfIiMmFjHeMiCmMjCoIiLgA_xHqqkZx_ -----

	virtual const shortVector& GetReferenceOrder () const;
	virtual void	SetReferenceOrder (const shortVector& vOrder);

	static const wchar_t* GetReferenceString (FTWhichTmpl iTmpl);

protected:
	//----- _xZkqqHx_iDfEiDhFiDeOiDiJiDfIiCmFjEeDiInD_xHqqkZx_ -----
	virtual void	CreatePropertyPage (CPropertyPageVector& vPropPage);

	//----- ToolBaseCreate_xZkqqHx_iDfEiDhFiDeOiDiJiDfIiCmFjEeDiInD_xHqqkZx_ -----
	virtual const FCObjDynabase*	GetReferenceObject ();
	virtual BOOL	IsValidReference (const FCObjDynabase* pObj) const;
	virtual void	SetLastCreateObj (const FCObjDynabase* pObj);
// 06.10.11 Fukushiro M. 1_xZkqqHx_iNhDjFmPiNfI_xHqqkZx_ ()
//	virtual const FCObjDynabase* GetLastCreateObj ();
	virtual const FCObjDynabase* GetLastCreateObj (const FCObjDynabase* pPrevObj = NULL);

// 06.11.26 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	virtual void	InitInsideObject (FCObjDynabase* pObj);

protected:
// _xZkqqHx_iClBiCmMiDeOiDiJiDfIiMmFjHeMiCmMjCoIiLgAiBeC_xHqqkZx_
enum
{
	STATE_BEGIN = BASE_CLASS::STATE_END,	// _xZkqqHx_iPpDjBnEiKeKiOgOiBeC_xHqqkZx_
	STATE_END,	// _xZkqqHx_iPpDjBnEiPeJjHlJiBeC_xHqqkZx_
};

struct FCObjMemRec
{
	FCObjMemRec () {}
	FCObjMemRec (FTObjectType a, DWORD b) : objType(a), dwObjID(b) {}
	FTObjectType	objType;
	DWORD			dwObjID;
};

typedef vector<FCObjMemRec>	FCObjMemRecVector;

protected:
	shortVector			m_vReferenceOrder;	// _xZkqqHx_iNoMjAkMiMlDiDiKiDhEiDeAiDiMiDjDiDfIjFjEjFgJiCmMiMjPiNpFiPiHiBeC_xHqqkZx_
	FCObjMemRecVector	m_vLastObj;			// _xZkqqHx_iNmFiMoDiCmJiNoMiCoHiCoKiClNjFjEjFgJiCmMiLeMjIfOiBeC_xHqqkZx_
	FCObjDynabase*			m_pInsideObject;	// _xZkqqHx_jDoAjFjEjFjEjFgJiBeC_xHqqkZx_
}; // class FCToolBaseCreate.

#endif//__ToolBaseCreate_h
