/* Header for the definition of a array characteristic */
/*/////////////////////////////////////////////////////////*/
#ifndef _CTL_ARRAY_CONTROL_
#define _CTL_ARRAY_CONTROL_
 
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000*/
 
#include "scr.h"
#include "ai/aibase/gsparam.h"
#include "ai/aibase/array.h"
 
#include "CTL\Controls\CTL_Ctl.hpp"
 
class CTL_Editor_Button;
class CTL_Editor_ControlList;
 
class CPA_EXPORT CTL_Editor_ArrayControl : public CTL_Editor_Control
{
/*Constructor / Destructor*/
public:
	CTL_Editor_ArrayControl(	CTL_tdeEditorDataType tdeType,
								BOOL bReadOnly,
								CTL_tdeControlSpacingType tdeSpacingType,
								BOOL bUserCanChangeAspect,
								CTL_Editor_ControlList *_pclParentList,
								CString _csControlName,
								BOOL _bAcceptNameFromData, /*ANNECY BBB*/
/*Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								unsigned char ucInitialCurrentPair
/*End Stefan Dumitrean 20-07-98 ( OAC buttons )*/
 
														);
	
	~CTL_Editor_ArrayControl();
 
/*Attributes*/
public:
 
protected:
 
private:  
	CTL_Editor_Button *m_pclEditButton;
 
/*Member functions*/
public:
	/*Function called to create controls (must be called only once)*/
	BOOL m_fn_bCreateControl(CWnd *pclParentWnd);
 
	/*Function called to display the associated control of the char.*/
	void m_fn_vDisplay();
	
	/*Function called to update the associated control of the char.*/
	void m_fn_vUpdate(CTL_tdeUpdateReason _eReason = CTL_UPDATE_REASON__NO_REASON_GIVEN,
										long _lUserDefinedReason = 0);
 
	/*Function called to update parent window in case of values changes.*/
	void m_fn_vUpdateParent(CTL_tdeUpdateReason eReason = CTL_UPDATE_REASON__NO_REASON_GIVEN,
													long _lUserDefinedReason = 0);
 
	/*Function called to make control Read Only*/
	void m_fn_vMakeReadOnly();
 
	/*Function called to make control Read-Write*/
	void m_fn_vMakeReadWrite();
 
	/* Not sure on parameters, do it later*/
	void m_fn_vSetCurrentValue(tdstArray *_pstNewValue);
 
	/*Called when button is pressed*/
	void m_fn_vEditData();
 
	/* define them in each array flavour class*/
	virtual CTL_Editor_Control *m_fn_pctrlCreateElementControl (CTL_Editor_ControlList *) = 0;
	virtual CTL_Editor_Data *m_fn_pdataCreateElementData (CTL_Editor_DataList *, CTL_Editor_Control *) = 0;
 
protected:
 
private:
 
};											   
 
/***************************************************************************************/
/* the array flavours*/
/***************************************************************************************/
/***************************************************************************************/
/* Arrray Enum*/
/***************************************************************************************/
class CPA_EXPORT CTL_Editor_ArrayEnumControl : public CTL_Editor_ArrayControl
{
private:
	CTL_td_p_fn_vBuildEnumDescriptor m_td_pri_fn_vBuildEnumDesciptor_CallBack;
 
public:
	CTL_Editor_ArrayEnumControl (BOOL bReadOnly,
								 CTL_tdeControlSpacingType tdeSpacingType,
								 BOOL bUserCanChangeAspect,
								 CTL_Editor_ControlList *_pclParentList,
								 CString _csControlName,
								 BOOL _bAcceptNameFromData, /*ANNECY BBB*/
/*Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								 unsigned char ucInitialCurrentPair
/*End Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								);
 
	void m_pub_fn_vSetBuildEnumDesciptor_CallBack(CTL_td_p_fn_vBuildEnumDescriptor _p_fn_vCallBack);
	/*CTL_td_p_fn_vBuildEnumDescriptor m_fn_pfn_vGetConstructList (void) {return m_td_pri_fn_vBuildEnumDesciptor_CallBack;};*/
 
	CTL_Editor_Control *m_fn_pctrlCreateElementControl (CTL_Editor_ControlList *);
	CTL_Editor_Data *m_fn_pdataCreateElementData (CTL_Editor_DataList *, CTL_Editor_Control *);
};
 
/***************************************************************************************/
/* Arrray Vector*/
/***************************************************************************************/
class CPA_EXPORT CTL_Editor_ArrayVectorControl : public CTL_Editor_ArrayControl
{
public:
	CTL_Editor_ArrayVectorControl (BOOL bReadOnly,
								   CTL_tdeControlSpacingType tdeSpacingType,
								   BOOL bUserCanChangeAspect,
								   CTL_Editor_ControlList *_pclParentList,
								   CString _csControlName,
								   BOOL _bAcceptNameFromData, /*ANNECY BBB*/
/*Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								   unsigned char ucInitialCurrentPair
/*End Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								);
 
	CTL_Editor_Control *m_fn_pctrlCreateElementControl (CTL_Editor_ControlList *);
	CTL_Editor_Data *m_fn_pdataCreateElementData (CTL_Editor_DataList *, CTL_Editor_Control *);
};
 
/***************************************************************************************/
/* Arrray Float*/
/***************************************************************************************/
class CPA_EXPORT CTL_Editor_ArrayFloatControl : public CTL_Editor_ArrayControl
{
public:
	CTL_Editor_ArrayFloatControl (BOOL bReadOnly,
								   CTL_tdeControlSpacingType tdeSpacingType,
								   BOOL bUserCanChangeAspect,
								   CTL_Editor_ControlList *_pclParentList,
								   CString _csControlName,
								   BOOL _bAcceptNameFromData, /*ANNECY BBB*/
/*Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								   unsigned char ucInitialCurrentPair
/*End Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								);
 
	CTL_Editor_Control *m_fn_pctrlCreateElementControl (CTL_Editor_ControlList *);
	CTL_Editor_Data *m_fn_pdataCreateElementData (CTL_Editor_DataList *, CTL_Editor_Control *);
};
 
/***************************************************************************************/
/* Arrray Integer*/
/***************************************************************************************/
class CPA_EXPORT CTL_Editor_ArrayIntegerControl : public CTL_Editor_ArrayControl
{
public:
	CTL_Editor_ArrayIntegerControl (BOOL bReadOnly,
								   CTL_tdeControlSpacingType tdeSpacingType,
								   BOOL bUserCanChangeAspect,
								   CTL_Editor_ControlList *_pclParentList,
								   CString _csControlName,
								   BOOL _bAcceptNameFromData, /*ANNECY BBB*/
/*Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								   unsigned char ucInitialCurrentPair
/*End Stefan Dumitrean 20-07-98 ( OAC buttons )*/
								);
 
	CTL_Editor_Control *m_fn_pctrlCreateElementControl (CTL_Editor_ControlList *);
	CTL_Editor_Data *m_fn_pdataCreateElementData (CTL_Editor_DataList *, CTL_Editor_Control *);
};
 
#endif /*_CTL_ARRAY_CONTROL_*/
