// cpacvwms.hpp : header file
/////////////////////////////////////////////////////////////////////////////
#ifndef _CPACVWMS_HPP_
#define _CPACVWMS_HPP_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "IAD_Res.h"

// For "IncAI.h" !!
#include "ACP_Base.h"
#include "IncAI.h"
// End For "IncAI.h" !!

class IAD_MyDocument;
class CPA_Actor;
class IAD_EditorTreeNode;
class IAD_TreeControl;

/////////////////////////////////////////////////////////////////////////////
// IAD_ResultView form view

#ifndef __AFXEXT_H__
#include <afxext.h>
#endif

class IAD_ResultView : public CFormView/*CPA_Editor_BaseFormView*/
{
// BEGIN ROMTEAM Cristi Petrescu 98-08-
friend class IAD_TreeControl;
// END ROMTEAM Cristi Petrescu 98-08-

public:
	IAD_ResultView();

protected:
	DECLARE_DYNCREATE(IAD_ResultView)

// Attributes
public:

protected:

private:
	IAD_TreeControl *m_pri_pclTreeControl;

	unsigned long m_pri_ulCurrentNode;
	unsigned long m_pri_ulTotalNumberOfNodes;

	//Current element in Trace

	// CG PB DEBUGGER 23/06/98 {
	#ifdef ACTIVE_AIDEBUG
		//Current element in Trace
		AIDebug_tdeSectionType m_pri_tdeSectionType;
	#endif // } CG PB DEBUGGER

	long m_pri_lID;
	tdstGetSetParam m_pri_stGetSetParam;
	tdstNodeInterpret *m_pri_p_stNode;

	BOOL m_pri_bMustStopTreeConstruction;

	//BEGIN ROMTEAM Cristi Petrescu 98-05-
	struct IAD_stInternalActorDescription *m_p_stInternalActor;
	//END ROMTEAM Cristi Petrescu 98-05-

// Form Data
public:
	//{{AFX_DATA(IAD_ResultView)
	enum { IDD = IDD_IAD_RESULT_VIEW };
	long	m_lLevelToExpand;
	BOOL	m_bMustSynchronize;
	BOOL	m_bViewAI;
	BOOL	m_bViewReflex;
	// BEGIN ROMTEAM Cristi Petrescu 98-08-
	// Warning: this has reversed signifiance
	BOOL	m_bShowMarks;
	// END ROMTEAM Cristi Petrescu 98-08-
	BOOL	m_bShowTests;
	//}}AFX_DATA

public:
	void m_pub_fn_vRefreshTree();
	void m_pub_fn_vDeleteAllInTreeControl();

	IAD_MyDocument *m_fn_pclGetDocument();
 
	void m_pub_fn_vSetStatusText(	CString _csNewStatus,
																char _cPercentage = -1);
	void m_pub_fn_vSetFindStatusText(CString _csNewStatus);
	void m_pub_fn_vSetEditedActorName(CString _csName);

	void m_fn_vEnableFindNextButton(BOOL _bEnable = TRUE);
	void m_fn_vEnableFindPrevButton(BOOL _bEnable = TRUE);
	void m_pub_fn_vDisplayTraceForActor(struct IAD_stInternalActorDescription *_p_stInternalActor);

	// BEGIN ROMTEAM Cristi Petrescu 98-06-
	void m_fn_vBuildSubtree (IAD_EditorTreeNode *);//, HTREEITEM);

	IAD_EditorTreeNode * m_fn_pclGetSelectedEditorNode (void);
	// END ROMTEAM Cristi Petrescu 98-06-

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(IAD_ResultView)
	public:
	virtual void OnInitialUpdate();
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~IAD_ResultView();

#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
	//{{AFX_MSG(IAD_ResultView)
	afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnCheckSynchronize();
	afx_msg void OnChangeEditLevels();
	afx_msg void OnButtonFindNextInTree();
	afx_msg void OnButtonFindInTree();
	afx_msg void OnButtonFindPreviousInTree();
	afx_msg void OnCheckViewReflex();
	afx_msg void OnCheckViewAI();
	afx_msg void OnCheckShowTests();
	afx_msg void OnCheckShowMarks();
	afx_msg void OnButtonNextLine();
	//}}AFX_MSG
	
private:
	void m_pri_fn_vComputeEditorTreeFromMotorTrace(struct IAD_stInternalActorDescription *_p_stInternalActor);
	long m_pri_fn_lAddChildNodesToOneNode(IAD_EditorTreeNode *_pclParentNode,
																				struct AI_tdstMind_ *_p_tdstMind,
																				long _lPreviousDepth,
																				struct IAD_stInternalActorDescription *_p_stInternalActor);
	//BEGIN ROMTEAM Cristi Petrescu 98-05-
	void m_fn_vPostProcessEditorTree (IAD_EditorTreeNode *_pclParentNode);

	
	long m_fn_lShowFlags (void);
	//END ROMTEAM Cristi Petrescu 98-05-

	void m_pri_fn_vFillTreeControl(struct IAD_stInternalActorDescription *_p_stInternalActor);
	// BEGIN ROMTEAM Cristi Petrescu 98-06-
	void m_pri_fn_vFillOneLevelOfTree(IAD_EditorTreeNode *_pclParentNode, HTREEITEM _hTreeParentItem, BOOL bSkipChangeComport = FALSE);
	// END ROMTEAM Cristi Petrescu 98-06-

	long m_pri_fn_lLookInChildsToExpand(HTREEITEM _hParentItem, long _lCurrentLevel);


	DECLARE_MESSAGE_MAP()

};

/////////////////////////////////////////////////////////////////////////////
#endif //_CPACVWMS_HPP_

