#if !defined(AFX_HISTVIEWDOC_H__47A52CC2_E202_11D2_ACBD_00C0F6B0E2D0__INCLUDED_)
#define AFX_HISTVIEWDOC_H__47A52CC2_E202_11D2_ACBD_00C0F6B0E2D0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// HistViewDoc.h : _xZkqqHx_iDhHiDgCiDfPiBfL_xHqqkZx_ _xZkqqHx_iDhEiDeAiDeDiDiL_xHqqkZx_
//

//#include "../HistoricProject/HPHistoricProject.h"	// For WString.
#include "FoundDoc.h"			// Superclass.
#include "HistDocumentTmpl.h"	// For FCHistManager.

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif
#define SUPER_CLASS CFCHistDocumentTmpl<CFCFoundDoc>

class FCDbReadLock;
class FCDbWriteLock;
class FCTimeLabel;
class FCWorkDir;
class FCTimeIndexFile;

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	FCDsmRec
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	DSM_xZkqqHx_jHjKjHpAiDiMiDfCiBfLiDgIiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	DSM_xZkqqHx_iCmGiCmNiBeBjHjKjHpAjFlGiPjBiBeBjHjKjHpAiImKjChFiBeBiDfGiBfLiDgHiBeBiNmAjFfHiBeBjBeJjBpAiPpDjBnEiCpAiLeMjIfOiClFiBeB_xHqqkZx_
 *			_xZkqqHx_iDhJiBfLiDfHiCpAjBjHiCoJiCoGiCkEiCmJjCeIiCoJiOgEjBgHiCnNiBeC_xHqqkZx_
 *			----- m_vTextSelection -----
 *			_xZkqqHx_jFjEjFgJjCiGiCmMiDgFiDeMiDfIiDgHiCmMjBeJjBpAiCpAiLeMjIfOiClHiCoJiBeC_xHqqkZx_
 *			m_stObjectId_xZkqqHx_iCkKiDgHiDgCiDhGjFjEjFgJiCpAiLeMjIfOiClHiCoJiCmMiCmJjBmOiClFiCmEiBeB_xHqqkZx_m_vTextSelection_xZkqqHx_iCmN_xHqqkZx_
 *			_xZkqqHx_jClMiJlKiCmJiDgFiDeMiDfIiDgHiCpAiOjNiCmCjFjEjFgJiCpAiLeMjIfOiClHiCoJiBeC_xHqqkZx_
 *			_xZkqqHx_iClLiCmMiNfMjBkCiCmNiBeB_xHqqkZx_[_xZkqqHx_jFjEjFgJjBeJjBpAiLeMjIfO_xHqqkZx_],DWORD(-1),[_xZkqqHx_jFjEjFgJjBeJjBpAiLeMjIfO_xHqqkZx_],DWORD(-1),[_xZkqqHx_jFjEjFgJjBeJjBpAiLeMjIfO_xHqqkZx_],_xZkqqHx_iBeFiBeFiBeF_xHqqkZx_[_xZkqqHx_jFjEjFgJjBeJjBpAiLeMjIfO_xHqqkZx_]
 *			[_xZkqqHx_jFjEjFgJjBeJjBpAiLeMjIfO_xHqqkZx_] _xZkqqHx_iCmNiBeBjFjEjFgJ_xHqqkZx_ID,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_,_xZkqqHx_iBeFiBeFiBeF_xHqqkZx_,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_
 *			_xZkqqHx_iCmCiCnMiCoIiImIiJlKiCmMiNfMjBkCiCpAiOjNiCmCiBeC_xHqqkZx_
 *			_xZkqqHx_jFjEjFgJ_xHqqkZx_1ID,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_1,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_1,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_2,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_2_xZkqqHx_iBeFiBeFiBeF_xHqqkZx_,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_n,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_n,DWORD(-1),
 *			_xZkqqHx_jFjEjFgJ_xHqqkZx_2ID,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_1,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_1,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_2,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_2_xZkqqHx_iBeFiBeFiBeF_xHqqkZx_,_xZkqqHx_jBeJjBpAiKeKiOgO_xHqqkZx_n,_xZkqqHx_jBeJjBpAiPeJjHlJ_xHqqkZx_n,_xZkqqHx_iBeFiBeFiBeF_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	06.03.01 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
struct FCDsmRec
{
	FCDsmRec (	const wchar_t* wcpProjectFilePath,
				long lDocumentId,
				flint fliSessionIndex,
				const DWORDSet& stObjectId,
				const DWORDVector& vTextSelection,
				const DBLPoint& mmptCenter,
				SheetID stid,
				long lZoom256,
				const wchar_t* wcpProjectTitle,
				const wchar_t* wcpDocumentTitle,
				const wchar_t* wcpDocumentVersion) :
		m_hstrProjectFilePath(HString(wcpProjectFilePath)),
		m_lDocumentId(lDocumentId),
		m_fliSessionIndex(fliSessionIndex),
		m_stObjectId(stObjectId),
		m_vTextSelection(vTextSelection),
		m_mmptCenter(mmptCenter),
		m_stid(stid),
		m_lZoom256(lZoom256),
		m_hstrProjectTitle(HString(wcpProjectTitle)),
		m_hstrDocumentTitle(HString(wcpDocumentTitle)),
		m_hstrDocumentVersion(HString(wcpDocumentVersion))
 {}
	BOOL		operator != (const FCDsmRec& dsmRec) const;
	BOOL		operator == (const FCDsmRec& dsmRec) const;

	HString		m_hstrProjectFilePath;	// _xZkqqHx_iDhGiDiNiDfHiDeGiDeOiDgHiDhEiDeAiDeDiDiLiDhAiDfIiBeC_xHqqkZx_
	long		m_lDocumentId;			// _xZkqqHx_jFlGiPjB_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	flint		m_fliSessionIndex;		// _xZkqqHx_iDfKiDgCiDfGiDiHiDjDiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	DWORDSet	m_stObjectId;			// _xZkqqHx_jBeJjBpAjFjEjFgJ_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	DWORDVector	m_vTextSelection;		// _xZkqqHx_iDgFiDeMiDfIiDgHjBeJjBpAiBeC_xHqqkZx_
	DBLPoint	m_mmptCenter;			// _xZkqqHx_jCiGjAfDiNmAjFfHiBeC_xHqqkZx_
	SheetID		m_stid;					// _xZkqqHx_iDfGiBfLiDgH_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	long		m_lZoom256;				// _xZkqqHx_iDfJiBfLiDiAjCgMiBeC_xHqqkZx_
	HString		m_hstrProjectTitle;		// _xZkqqHx_iDhGiDiNiDfHiDeGiDeOiDgHiDfOiDeDiDgHiDiLiBeC_xHqqkZx_
	HString		m_hstrDocumentTitle;	// _xZkqqHx_jHjKjHpAjFlGiPjBiDfOiDeDiDgHiDiLiBeC_xHqqkZx_
	HString		m_hstrDocumentVersion;	// _xZkqqHx_jHjKjHpAjFlGiPjBiDgPiBfLiDfHiDiHiDjDiBeC_xHqqkZx_
}; // struct FCDsmRec.

typedef map<long, FCTimeLabel*> FTIdToTimeLabelMap;

//----- 06.03.13 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
///*************************************************************************
// * <_xZkqqHx_iDeOiDiJiDfI_xHqqkZx_>	FCCanvasStatEx
// *
// * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfIiDgHiDiKiBfLiDiAjHhAiDeMiDiDiDjDiDgPiDfIiCmMiDfJiBfLiDiAiCoCiImKjChFiPoOjFpBiBeC_xHqqkZx_
// *
// * <_xZkqqHx_iJpAjAoA_xHqqkZx_>	FCCanvasStatEx _xZkqqHx_iCmNiBeB_xHqqkZx_FCCanvasStat _xZkqqHx_iCmJjBmOiClFiCmEiBeBiDfIiDeOiDiNiBfLiDiLiImKjChF_xHqqkZx_
// *			(g_->lgOffsetX, g_->lgOffsetY) _xZkqqHx_iCpA_xHqqkZx_ UpdateData <-> UpdateCanvas
// *			_xZkqqHx_iCmFjAlDiKgNiCmJiLeMjIfOiBeFiNmEiMlLiCmFiCkLiCoJiCoGiCkEiCmJiClFiCmEiCkAiCoJiBeC_xHqqkZx_
// *			HistoryViewer_xZkqqHx_iCmFiCmNiBeBjHjKjHpAiInKjDkOiCmJjElKiCmBiCmE_xHqqkZx_ _xZkqqHx_iDeMiDiDiDjDiDgPiDfIiPoOjFpBiCpAjAlDiKgNiCmJ_xHqqkZx_
// *			_xZkqqHx_iNmEiMlLiClHiCoJjFeLjHhGiCkKiCkAiCoJiCkKiBeB_xHqqkZx_FCCanvasStat _xZkqqHx_iCpAiOgHiCkEiCmGiBeBjHjKjHpAiCmM_xHqqkZx_
// *			_xZkqqHx_iPoDiImKiBeFiJlKiImKiCmMiInKjDkOiCmF_xHqqkZx_ _xZkqqHx_jEpHjGkNiCmJiImKjChFiCkKiClIiCoKiCmEiClFiCnMiCkEiPoKiNiHiCkKiCkAiCoJiClNiCnPiBeC_xHqqkZx_
// *
// * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	05.10.03 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
// *************************************************************************/
//class FCCanvasStatEx : public FCCanvasStat
//{
//protected:
//typedef FCCanvasStat BASE_CLASS;
//
//public:
//	long	m_lgOffsetX;
//	long	m_lgOffsetY;
//
//	FCCanvasStatEx ();
//	virtual void	UpdateCanvas ();
//	virtual void	UpdateData ();
//}; // class FCCanvasStatEx.
//----- 06.03.13 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

/////////////////////////////////////////////////////////////////////////////
// CFCHistViewDoc _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgH_xHqqkZx_

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

protected:
	CFCHistViewDoc();           // _xZkqqHx_jDkOjDeJjAlGjAkMiCmJiOgHjHhAiClDiCoKiCoJiDhGiDiNiDgFiDeOiDgH_xHqqkZx_ _xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
	DECLARE_DYNCREATE(CFCHistViewDoc)

// _xZkqqHx_iDiGiBfLiDfFiKnGjAjEiBeC_xHqqkZx_
public:
	//----- CFCFoundDoc _xZkqqHx_iDeJiBfLiDgPiBfLiDiJiDeDiDgI_xHqqkZx_ -----
	virtual void	OnActivateDocument (BOOL bActive);
// 05.09.14 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	virtual void	OnPursuerTextNeedInfo ();
// 06.05.22 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	virtual void	GetAndClearErrFontInfo (vector<FCErrFontInfo>& vFontInfo);

	//----- _xZkqqHx_iDhGiDiNiDfHiDeGiDeOiDgHiKnGjIeBiKnGjAjE_xHqqkZx_ -----

	//----- _xZkqqHx_iDiJiDhIiDiLiKnGjIeBiKnGjAjE_xHqqkZx_ -----

	//----- _xZkqqHx_iDgIiDeMiDiFiDiBiDjDiDgHiPoOjFpB_xHqqkZx_ -----

	//----- _xZkqqHx_iClLiCmMjBlM_xHqqkZx_ -----
	virtual DWORD	GetStdTool () const;
	virtual BOOL	IsReadOnly () const;

	virtual BOOL	CanHtreeMoveBefore ();
	virtual BOOL	CanHtreeMoveAfter ();
	virtual BOOL	CanHtreeMoveHigher () const;
	virtual BOOL	CanHtreeMoveLower ();

//----- 05.08.29 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	//----- _xZkqqHx_jFgAiJoG_xHqqkZx_ -----
	virtual void	OnDrawFrontView (CDC* pDC);
//----- 05.08.29 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 05.08.30 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	virtual void	GetSelectedTimeLabelId (longSet& stId) const;
	virtual void	GetAllTimeLabelId (longSet& stId) const;
	virtual long	GetTimeLabelCount () const;
	virtual BOOL	IsSelectedTimeLabel (long lId) const;
	virtual void	SelectTimeLabel (long lId);
	virtual void	UnselectAllTimeLabel ();
	virtual void	UnselectTimeLabel (long lId);
	virtual const FCTimeLabel*	GetTimeLabel (long lId) const;
//----- 05.08.30 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 06.03.07 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	virtual const FCDsmRec*	GetDsmRec (long lIndex) const;
	virtual long	GetDsmSize () const;
	virtual void	EraseDsm (long lIndex);
//----- 06.03.08 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	virtual long	GetCurrentDsmPosition () const;
//	virtual void	SetCurrentDsmPosition (long lIndex);
//----- 06.03.08 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.03.07 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

protected:
//----- 06.02.02 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
////----- 05.11.22 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_jFnLjBlGiClFiCmEiDeBiDhGiDiKiDfAiBfLiDfGiDiHiDjDiCpAiPeJjHlJiBeC_xHqqkZx_
//	virtual	FTDocReqResult	OnReqSaveAndExit (FCReqBase& ret, FCReqLock& reqLock);
////----- 05.11.22 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 06.02.02 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iDhGiDiNiDfHiDeGiDeOiDgHiCpAiKeKiCkNiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqOpenProject (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.04.10 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	 // _xZkqqHx_iDhGiDiNiDfHiDeGiDeOiDgHiCpAjFmCiClGiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqCloseProject (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.04.10 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	//---------------------------------------- _xZkqqHx_jHjKjHpAjFlGiPjBiCpAiKeKiCkN_xHqqkZx_ ------------
	virtual FTDocReqResult	OnReqOpenHidocument (FCReqBase& ret, FCReqLock& reqLock);
	//---------------------------------------- _xZkqqHx_jHjKjHpAjFlGiPjBiCpAjFmCiClGiCoJ_xHqqkZx_ ------------
	virtual	FTDocReqResult	OnReqCloseHidocument (FCReqBase& ret, FCReqLock& reqLock);
	//---------------------------------------- _xZkqqHx_jHjKjHpAiDfCiDhNiDjDiDgIjClHiCpAiNfIjAfGiClHiCoJ_xHqqkZx_ ------------
	virtual	FTDocReqResult	OnReqUpdateCmdTerminate (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.04.01 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	//---------------------------------------- _xZkqqHx_jHjKjHpAjFlGiPjBiNoNiPjMiCmMiDfPiDeDiDeBiDiNiDePiCpAjFfMiOkGiClHiCoJ_xHqqkZx_ ------------
//	virtual FTDocReqResult	OnReqDlgDeleteHidocument (FCReqBase& ret, FCReqLock& reqLock);
//	//---------------------------------------- _xZkqqHx_jHjKjHpAjFlGiPjBiCpAiNoNiPjMiClHiCoJ_xHqqkZx_ ------------
//	virtual FTDocReqResult	OnReqDeleteHidocument (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.04.01 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

//----- 06.02.02 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// DELETE_HIDOCUMENT_xZkqqHx_iCmMiDfEiDhF_xHqqkZx_
//	virtual	FTDocReqResult	OnReqDeleteHidocumentSub (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.02.02 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----

	//---------------------------------------- _xZkqqHx_jHjKjHpAiCpAiDhNiBfLiDeOiCnMiCmFjGnPiClH_xHqqkZx_ ------------
	virtual FTDocReqResult	OnReqMoveHistoryBackwardUntilOperate (FCReqBase& ret, FCReqLock& reqLock);
	//---------------------------------------- _xZkqqHx_jHjKjHpAiCpAiDhNiBfLiDeOiCnMiCmFjAgJiCnPiCoJ_xHqqkZx_ ------------
	virtual FTDocReqResult	OnReqMoveHistoryForwardUntilOperate (FCReqBase& ret, FCReqLock& reqLock);
	//---------------------------------------- _xZkqqHx_jHjKjHpAiCpAiOhHjCoIjAjEiDfKiDgCiDfGiDiHiDjDiInKjDkOiClHiCoJ_xHqqkZx_ ------------
	virtual FTDocReqResult	OnReqMoveHistorySessionCount (FCReqBase& ret, FCReqLock& reqLock);
	//---------------------------------------- _xZkqqHx_jHjKjHpAiCpAiOhHjCoIiCmMiDfKiDgCiDfGiDiHiDjDiCnMiCmFiInKjDkOiClHiCoJ_xHqqkZx_------------
	virtual FTDocReqResult	OnReqMoveHistoryUntilSession (FCReqBase& ret, FCReqLock& reqLock);
	//---------------------------------------- _xZkqqHx_iPoDiImKiCnGiInKjDkO_xHqqkZx_ --------------
	virtual FTDocReqResult	OnReqMoveHistoryToHigherTree (FCReqBase& ret, FCReqLock& reqLock);
	//---------------------------------------- _xZkqqHx_iJlKiImKiCnGiInKjDkO_xHqqkZx_ --------------
	virtual FTDocReqResult	OnReqMoveHistoryToLowerTree (FCReqBase& ret, FCReqLock& reqLock);
	// _xZkqqHx_iMlLiNnNiCmMjHjKjHpAiImKjChFiCpAiLeMjIfOiClHiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqPushCurrentToDsm (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.01.23 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_iDfIiDhMiDgCiDgHiDgFiBfLiDhFiDiLiCpAjFnLjBlGiClHiCoJiBeC_xHqqkZx_
//	virtual	FTDocReqResult	OnReqSaveSpotFile (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.01.23 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 05.10.25 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_iDhGiDiNiDfHiDeGiDeOiDgHiOfBiJmBiCmMjFeLjHhGjAkLiCpAiDgAiDeGiDgCiDeOiClFiBeBjFeLjHhGiCmIiCoHiOfBiJmBiOoIjBlBiCkLiCpAjAgJiCnPiCoJ_xHqqkZx_
//	virtual	FTDocReqResult	OnReqCheckJoinProjectUser (FCReqBase& ret, FCReqLock& reqLock);
//----- 05.10.25 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	FTDocReqResult	myLockAllLower (FCDbLockBank& lockBank,
									const wchar_t* wcpProjectPath,
									long lDocId,
									flint fliSessionIndexX,
									BOOL bIsLockForkOnX);
	// _xZkqqHx_jHjKjHpAiOhNiCpAiPoDjHkMiCmMiKlCiCmJjFmPiNfIiClHiCoJ_xHqqkZx_
	virtual	FTDocReqResult	OnReqChangeBranchIntoTrunk (FCReqBase& ret, FCReqLock& reqLock);
	// _xZkqqHx_iClBiClBiCoGiCoIiJlKiCmMjHjKjHpAiCpAiJlKjHkMiCmMiOhNiCmJjFmPiNfIiClHiCoJ_xHqqkZx_
	virtual	FTDocReqResult	OnReqChangeTrunkIntoBranch (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.02.06 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_jHjKjHpA_xHqqkZx_1_xZkqqHx_iCmMiImKjChF_xHqqkZx_X_xZkqqHx_iCoGiCoIiJlKiCpAjHjKjHpA_xHqqkZx_3_xZkqqHx_iCmJjFmPiNfIiClFiBeBjHjKjHpA_xHqqkZx_2_xZkqqHx_iCpAjHjKjHpA_xHqqkZx_1_xZkqqHx_iCmJjFmPiNfI_xHqqkZx_
//	virtual	FTDocReqResult	OnReqChangeBranch1To3X2To1 (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.02.06 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_jHjKjHpAiOhNiCpAiDhGiDiNiDfHiDeGiDeOiDgHjClMiJlKiCmJjFmPiNfIiClHiCoJ_xHqqkZx_
	virtual	FTDocReqResult	OnReqChangeBranchIntoTop (FCReqBase& ret, FCReqLock& reqLock);
//----- 05.08.25 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
//----- 06.01.26 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_iJlMjAnNiOjOiKnEiDiJiDhIiDiLiCpAjDgPjIfOiClHiCoJiBeC_xHqqkZx_
//	virtual FTDocReqResult	OnReqRegisterTempTimeLabel (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.01.26 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_jHjKjHpAjFkKiKpCiDfOiDePjAnNjCoIiCmMiDfPiDeDiDeBiDiNiDePiCpAjFfMiOkGiClHiCoJiBeC_xHqqkZx_
	virtual FTDocReqResult	OnReqDlgPutTimeLabel (FCReqBase& ret, FCReqLock& reqLock);
	// _xZkqqHx_jHjKjHpAjFkKiKpCiDfOiDePiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
	virtual FTDocReqResult	OnReqPutTimeLabel (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.01.26 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	// _xZkqqHx_iJlMjAnNiOjOiKnEiDiJiDhIiDiLiCpAiNoNiPjMiClHiCoJiBeC_xHqqkZx_
//	virtual FTDocReqResult	OnReqDeleteTempTimeLabel (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.01.26 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	// _xZkqqHx_iOjOiKnEiDiJiDhIiDiLiCpAiInKjDkOiClHiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqMoveTimeLabels (FCReqBase& ret, FCReqLock& reqLock);


//----- 05.09.30 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iOhHjCoIiCmMiDiJiDhIiDiLiCkKjCiGjAfDiNmAjFfHiCmJiCkNiCoJiCoGiCkEiCmJiDfIiDeOiDiNiBfLiDiLiClHiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqScrollToLabel (FCReqBase& ret,	FCReqLock& reqLock);
	// _xZkqqHx_iOhHjCoIiCmMiOjOiKnEiDiJiDhIiDiLiCkKjCiGjAfDiNmAjFfHiCmJiCkNiCoJiCoGiCkEiCmJiDfIiDeOiDiNiBfLiDiLiClHiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqScrollToTimeLabel (FCReqBase& ret,	FCReqLock& reqLock);
//----- 05.09.30 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 05.10.08 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jHjKjHpAiCpAiDeDiDjDiDfOiBfLiDgPiDiLiCnMiCmFjGnPiClHiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqMoveHistoryBackwardUntilInterval (FCReqBase& ret, FCReqLock& reqLock);
//----- 05.10.08 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.10.05 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jHjKjHpAiCpAiDeDiDjDiDfOiBfLiDgPiDiLiCnMiCmFjAgJiCnPiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqMoveHistoryForwardUntilInterval (FCReqBase& ret, FCReqLock& reqLock);
//----- 05.10.05 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.10.08 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jHjKjHpAiCpAiOhHjCoIiCmMiOjOiKnEiCkKiMgPiJnPiClHiCoJiCnMiCmFjGnPiClHiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqMoveHistoryBackwardTimePassed (FCReqBase& ret,	FCReqLock& reqLock);
	// _xZkqqHx_jHjKjHpAiCpAiOhHjCoIiCmMiOjOiKnEiCkKiMgPiJnPiClHiCoJiCnMiCmFjAgJiCnPiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqMoveHistoryForwardTimePassed (FCReqBase& ret, FCReqLock& reqLock);
//----- 05.10.08 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.10.17 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jHjKjHpAjFlGiPjBiCpAjFnLjBlGiClHiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqSaveHidocument	(FCReqBase&	ret, FCReqLock&	reqLock);
//----- 05.10.17 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 05.11.06 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_jBiAiNoMiImKjChFiCnGiDfIiDeOiDiNiBfLiDiLiClHiCoJiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqScrollToSpot (FCReqBase& ret, FCReqLock& reqLock);
//----- 05.11.06 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
//----- 06.04.10 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	// _xZkqqHx_iOjOiKnEiDeDiDjDiDgGiDgCiDeOiDfIiCmMiNoMjAkMiBeC_xHqqkZx_
	virtual	FTDocReqResult	OnReqCreateTimeIndex (FCReqBase& ret, FCReqLock& reqLock);
//----- 06.04.10 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

//----- 05.08.25 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----
	virtual BOOL	ExecDocRequest () const;
//----- 05.08.30 Fukushiro M. _xZkqqHx_jCmHiJmBiOgO_xHqqkZx_ ()-----
	virtual BOOL	UpdateTimeLabel (	FCHiProject& project,
										FCHiForkTable& forkFile,
										const FCDbReadLock& autoLockProjectRead,
										const FCDbReadLock& autoLockForkRead);
	virtual void	ClearTimeLabel ();
//----- 05.08.30 Fukushiro M. _xZkqqHx_jCmHiJmBiPeJ_xHqqkZx_ ()-----

	virtual long	BranchAToC (FCHiProject& project,
								long lDocIdA,
								flint fliNextSessionIndexX,
								FCDbLockBank& lockBank,
								const BYTE* pSpotStreamX,
								size_t szSpotStreamX,
								BOOL bIsTerminateAToX,
								BOOL bIsMoveForkOnX,
								BOOL bIsMoveTimeLabelOnX);

	virtual BOOL	GetIsUseTimeIndex () const;
	virtual void	SetIsUseTimeIndex (BOOL bIsUseTimeIndex);
	virtual BOOL	SyncTimeIndexToCurrent ();
	virtual BOOL	SeekTimeIndexSession (flint fliSessionCount);
	virtual BOOL	SeekTimeIndexIntervalBefore (FDSECTIME fdstInterval);
	virtual BOOL	SeekTimeIndexIntervalAfter (FDSECTIME fdstInterval);
	virtual BOOL	SeekTimeIndexPassedBefore (FDSECTIME fdstPass);
	virtual BOOL	SeekTimeIndexPassedAfter (FDSECTIME fdstPass);

	static long		GetNextSameLevelBranch (long lDocId, long lDocIdSub, flint fliSessionIndex);

	static BOOL		MoveBranch (FCHiProject& project,
								long lDocIdA,
								long lDocIdC,
								flint fliNextSessionIndexX,
								FCDbLockBank& lockBank,
								BOOL bIsTerminateAToX,
								BOOL bIsMoveForkOnX,
								BOOL bIsMoveTimeLabelOnX);
	static BOOL		CopyBranch (FCHiProject& project,
								long lDocIdA,
								long lDocIdC,
								flint fliNextSessionIndexX,
								FCDbLockBank& lockBank,
								BOOL bIsCopyForkOnX,
								BOOL bIsCopyTimeLabelOnX);
	static BOOL		ShortenBranch (	FCHiProject& project,
									long lDocId,
									flint fliNextSessionIndexX,
									FCDbLockBank& lockBank,
									BOOL bIsTerminateToX,
									BOOL bIsDeleteForkOnX,
									BOOL bIsDeleteTimeLabelOnX);

// _xZkqqHx_iDiGiBfLiDfFjFmPjAjEiBeC_xHqqkZx_
protected:
	vector< auto_ptr<FCDsmRec> >	m_vDsmHistory;	// DSM_xZkqqHx_jHjKjHpAiBeC_xHqqkZx_
	FTIdToTimeLabelMap	m_mpIdToTimeLabel;		// _xZkqqHx_iOjOiKnEiDiJiDhIiDiL_xHqqkZx_ID->_xZkqqHx_iOjOiKnEiDiJiDhIiDiLiDeJiDhFiDfHiDeGiDeOiDgHiBeC_xHqqkZx_
	longSet				m_stSelectTimeLabel;	// _xZkqqHx_jBeJjBpAiClDiCoKiCmEiCkCiCoJiOjOiKnEiDiJiDhIiDiLiCmM_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	FCWorkDir*			m_pWorkDir;				// _xZkqqHx_iDiPiBfLiDeOjHhAiDgGiDeCiDiMiDeOiDgHiDiKiBeC_xHqqkZx_
	FCTimeIndexFile*	m_pFileTimeIndex;		// _xZkqqHx_jFnCiPfHiOjOiKnEiDeDiDjDiDgGiDgCiDeOiDfIiDhEiDeAiDeDiDiLiBeC_xHqqkZx_
	BOOL				m_bIsUseTimeIndex;		// _xZkqqHx_jFnCiPfHiOjOiKnEiDeDiDjDiDgGiDgCiDeOiDfIiCpAiOgHiCkEiCkJiBeI_xHqqkZx_

// 06.05.22 Fukushiro M. 1_xZkqqHx_iNhDjCmHiJmB_xHqqkZx_ ()
	set< pair<BYTE, WString> >	m_stReportedErrorFont;	// _xZkqqHx_iDiGiBfLiDfFiBfLiCmJjFpBiNjAiNmPiCnNiCmMiDeHiDiJiBfLiDhEiDeIiDjDiDgHiPoOjFpBiBeC_xHqqkZx_

// _xZkqqHx_iDeBiDgHiDiKiDhCiDiFiBfLiDgH_xHqqkZx_
public:

// _xZkqqHx_iDeJiDhJiDiMiBfLiDfGiDiHiDjD_xHqqkZx_
public:

// _xZkqqHx_iDiGiBfLiDfFiDeJiBfLiDgPiBfLiDiJiDeDiDgIiBeC_xHqqkZx_
public:
	virtual void	SetModifiedFlag (BOOL bModified = TRUE);

// _xZkqqHx_iDeJiBfLiDgPiBfLiDiJiDeDiDgI_xHqqkZx_
	// ClassWizard _xZkqqHx_iCmNiJlMjBhKiKnGjAjEiCmMiDeJiBfLiDgPiBfLiDiJiDeDiDgIiCpAjAlGjAkMiClFiCnMiClHiBeC_xHqqkZx_
	//{{AFX_VIRTUAL(CFCHistViewDoc)
	public:
	virtual void DeleteContents ();
	protected:
	virtual BOOL SaveModified();
	//}}AFX_VIRTUAL

// _xZkqqHx_iDeDiDjDiDhGiDiKiDiBiDjDiDgFiBfLiDfGiDiHiDjD_xHqqkZx_
public:
	virtual ~CFCHistViewDoc();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// _xZkqqHx_iDiBiDgCiDfKiBfLiDfH_xHqqkZx_ _xZkqqHx_iDhNiDgCiDhGiKnGjAjEiCmMjAlGjAkM_xHqqkZx_
protected:
	//{{AFX_MSG(CFCHistViewDoc)
	afx_msg void OnFileExecHistdrawTarget();
	afx_msg void OnUpdateFileExecHistdrawTarget(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveAfter();
	afx_msg void OnUpdateHtreeMoveAfter(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveBefore();
	afx_msg void OnUpdateHtreeMoveBefore(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveHigher();
	afx_msg void OnUpdateHtreeMoveHigher(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveLower();
	afx_msg void OnUpdateHtreeMoveLower(CCmdUI* pCmdUI);
	afx_msg void OnFileDeleteHistory();
	afx_msg void OnUpdateFileDeleteHistory(CCmdUI* pCmdUI);
	afx_msg void OnTestTestTest2();
	afx_msg void OnUpdateTestTestTest2(CCmdUI* pCmdUI);
	afx_msg void OnViewTimeLabelShowMode();
	afx_msg void OnUpdateViewTimeLabelShowMode(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveOperationBefore();
	afx_msg void OnUpdateHtreeMoveOperationBefore(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveOperationAfter();
	afx_msg void OnUpdateHtreeMoveOperationAfter(CCmdUI* pCmdUI);
	afx_msg void OnOptionUserRegistration();
	afx_msg void OnUpdateOptionUserRegistration(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveSelectionBefore();
	afx_msg void OnUpdateHtreeMoveSelectionBefore(CCmdUI* pCmdUI);
	afx_msg void OnHtreeMoveSelectionAfter();
	afx_msg void OnUpdateHtreeMoveSelectionAfter(CCmdUI* pCmdUI);
	afx_msg void OnFileProjectClose();
	afx_msg void OnUpdateFileProjectClose(CCmdUI* pCmdUI);
	afx_msg void OnHtreeCreateTimeIndex();
	afx_msg void OnUpdateHtreeCreateTimeIndex(CCmdUI* pCmdUI);
	afx_msg void OnHtreeUseTimeIndex();
	afx_msg void OnUpdateHtreeUseTimeIndex(CCmdUI* pCmdUI);
	//}}AFX_MSG
// 04.10.08 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//	afx_msg void OnFileRecent(UINT nCmdID);
//----- 03.09.24 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	afx_msg void OnFileSaveAsMolipdraw();
//	afx_msg void OnUpdateFileSaveAsMolipdraw(CCmdUI* pCmdUI);
//----- 03.09.24 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 05.08.24 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	afx_msg void OnOptionSyncOtherDoc();
//	afx_msg void OnUpdateOptionSyncOtherDoc(CCmdUI* pCmdUI);
//----- 05.08.24 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.02.26 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	afx_msg void OnViewPastePosition();
//	afx_msg void OnUpdateViewPastePosition(CCmdUI* pCmdUI);
//----- 06.02.26 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.02.27 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	afx_msg void OnViewCopyPosition();
//	afx_msg void OnUpdateViewCopyPosition(CCmdUI* pCmdUI);
//----- 06.02.27 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
//----- 06.03.08 Fukushiro M. _xZkqqHx_iNoNiPjMiOgO_xHqqkZx_ ()-----
//	afx_msg void OnViewPrevDsm();
//	afx_msg void OnUpdateViewPrevDsm(CCmdUI* pCmdUI);
//	afx_msg void OnViewNextDsm();
//	afx_msg void OnUpdateViewNextDsm(CCmdUI* pCmdUI);
//----- 06.03.08 Fukushiro M. _xZkqqHx_iNoNiPjMiPeJ_xHqqkZx_ ()-----
	DECLARE_MESSAGE_MAP()
}; // class CFCHistViewDoc.

extern BOOL FFCreateFirstDocument (	FCDbLockBank& lockBank,
									FCHiProject& project,
									long lDocId,
									const BYTE* pSpotStream,
									size_t szSpotStream,
									long lDocIdFrom,
									flint fliSessionIdxFrom,
									FDSECTIME fdstDateFrom,
									const GUID& guidPrevUser);

// _xZkqqHx_jHjKjHpAiDhCiDiFiBfLiDeBiDgIiDeMiDiFiDiBiDjDiDgHjFmPjAjEiBeC_xHqqkZx_
inline CFCHistViewDoc* FFHistViewDoc ()
{
	if (g_pDoc->IsKindOf(RUNTIME_CLASS(CFCHistViewDoc)))
		return (CFCHistViewDoc*)g_pDoc;
	else
		return NULL;
} // FFHistViewDoc.

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ _xZkqqHx_iCmNjBePiNhDiCmMjClMjBePiCmJjCmHiJmBiCmMjAoJiMlOiCpAjBhNjDpMiClFiCnMiClHiBeC_xHqqkZx_

#endif // !defined(AFX_HISTVIEWDOC_H__47A52CC2_E202_11D2_ACBD_00C0F6B0E2D0__INCLUDED_)
