// Used for Data and Controls customization
//
// YB
//
/////////////////////////////////////////////////////
#ifndef _OAC_DATA_AND_CONTROLS_CUSTOMIZATION_
#define _OAC_DATA_AND_CONTROLS_CUSTOMIZATION_

//External Modules
#include "CTL.h"
#include "WAW.h"
//End of External Modules

//#########################################################
typedef enum OAC_eEditorDataType
{
	OAC_DATA_TYPE__OBJECT_LIST = 1,
	OAC_DATA_TYPE__STATE,

} OAC_tdeEditorDataType;

//#########################################################
typedef enum OAC_eUpdateReason
{
	OAC_E_ur_NoReasonGiven = 0,
	OAC_E_ur_InstanceChangedObjectList,
	OAC_E_ur_ModelChangedNameList,
	OAC_E_ur_InstanceChangedAlternateList,
	OAC_E_ur_InstanceRenamedObjectList,
	OAC_E_ur_ModelEditedNameList,
	OAC_E_ur_ComboSelChanged,
	OAC_E_ur_ButtonClicked,
	OAC_E_ur_InstanciatedFromModel,

	OAC_E_ur_ModelDataChanged,

} OAC_tdeUpdateReason;

//#########################################################
typedef enum OAC_eDataLinkMode
{
	OAC_LINK_MODE__NOT_LINKED = 0,
	OAC_LINK_MODE__LINKED,
	//Those modes are for data whose link mode cannot be changed by the user
	OAC_LINK_MODE__ALWAYS_LINKED,
	OAC_LINK_MODE__NEVER_LINKED,

} OAC_tdeDataLinkMode;

OAC_tdeDataLinkMode eNot(OAC_tdeDataLinkMode _eMode);

//#########################################################
typedef enum OAC_eDataLevel
{
	OAC_DATA_LEVEL_1 = 1,
	OAC_DATA_LEVEL_2 = 2,
	OAC_DATA_LEVEL_3 = 3,

} OAC_tdeDataLevel;

//BEGIN ROMTEAM Cristi Petrescu 98-06-
typedef enum OAC_eDataQualifier
{
	OAC_DATA_PUBLIC,
	OAC_DATA_PRIVATE,

} OAC_tdeDataQualifier;
//END ROMTEAM Cristi Petrescu 98-06-

//#########################################################
typedef enum OAC_eStaticType
{
	OAC_STATIC_TYPE__INSTANCE_NAME = 1,
	OAC_STATIC_TYPE__MODEL_NAME,
	OAC_STATIC_TYPE__FAMILY_NAME,

} OAC_tdeStaticType;

//#########################################################
typedef enum OAC_eCheckBoxType
{
	OAC_CHECK_BOX_TYPE__LINK = 1,

} OAC_tdeCheckBoxType;

//#########################################################
typedef enum OAC_eButtonType
{
	OAC_BUTTON_TYPE__OBJECTS_LIST_BUTTON = 1,

} OAC_tdeButtonType;

//#########################################################
typedef enum OAC_eButtonReturnCodeValue
{
	OAC_BUTTON_RETURN_CODE_VALUE__OBJECTS_LIST_EDIT = 1,
	OAC_BUTTON_RETURN_CODE_VALUE__OBJECTS_LIST_RENAME,

} OAC_tdeButtonReturnCodeValue;

//#########################################################
typedef enum OAC_eComboBoxType
{
	OAC_COMBO_BOX_TYPE__OBJECTS_LIST_COMBO_BOX = 1,

} OAC_tdeComboBoxType;

//#########################################################
typedef enum OAC_eComboBoxReturnCodeValue
{
	OAC_COMBO_BOX_RETURN_CODE_VALUE__OBJECTS_LIST_NAMES = 1,
	OAC_COMBO_BOX_RETURN_CODE_VALUE__OBJECTS_LIST_ALTERNATE_NAMES,

} OAC_tdeComboBoxReturnCodeValue;

//#########################################################
typedef enum OAC_eControlVisibility
{
	EDCAR_DATA_VISI_ONLY_INSTANCES = 0,
	EDCAR_DATA_VISI_ONLY_MODELS,
	EDCAR_DATA_VISI_DUAL,

} OAC_tdeControlVisibility;

class EdActors_EditorActor;
class EdActors_ActorMiniStructure;

///////////////////////////////////////////////////////////////////////////////////////////////
//Owner Data Functions
/////////////////////
//Data
///////////
void OAC_AddOwnerDataToData(CTL_Editor_Data *_pclData,
														EdActors_EditorActor *_pclParentActor,
														EdActors_ActorMiniStructure *_pclParentAMS);

EdActors_EditorActor *OAC_fn_pclGetParentActorOfData(CTL_Editor_Data *_pclData);

EdActors_ActorMiniStructure *OAC_fn_pclGetParentAMSOfData(CTL_Editor_Data *_pclData);

OAC_eDataLinkMode OAC_fn_tdeGetLink(CTL_Editor_Data *_pclData);
//Returns the previous Link status
OAC_eDataLinkMode OAC_fn_tdeSetLink(CTL_Editor_Data *_pclData,
																		OAC_eDataLinkMode _tdeNewLink);
BOOL OAC_fn_bIsLinked(CTL_Editor_Data *_pclData);
//CPA2 Stegaru Cristian 98/06/24
BOOL OAC_fn_bLinkAllowPropagation (CTL_Editor_Data *pclData);
//End CPA2 Stegaru Cristian 98/06/24

BOOL OAC_fn_bDataIsInWatch(CTL_Editor_Data *_pclData);
WAW_Data *OAC_fn_pclGetAssociatedWatchData(CTL_Editor_Data *_pclData);
void OAC_fn_vSetDataInWatch(CTL_Editor_Data *_pclData,
														WAW_Data *_p_clDataInWatch);

//Controls
///////////
void OAC_AddOwnerDataToControl(CTL_Editor_Control *_pclControl,
															 OAC_tdeDataLevel _eLevel,
															 OAC_tdeControlVisibility _eVisibility,
															 DWORD dwHelpID);

OAC_tdeControlVisibility OAC_tdeGetVisibilityOfControl(CTL_Editor_Control *_pclControl);

OAC_eDataLevel OAC_fn_tdeGetLevelOfControl(CTL_Editor_Control *_pclControl);

DWORD OAC_fn_tdeGetHelpIDOfControl(CTL_Editor_Control *_pclControl);

void OAC_fn_vCustomizeControl(CTL_Editor_Control *_pclControl,
															CWnd *_pclParentWnd);

BOOL OAC_fn_bControlCanBeDisplayed(class CTL_Editor_Control *_pclSenderControl);

///////////////////////////////////////////////////////////////////////////////////////////////
//CallBack functions
/////////////////////
//Data
///////////
void OAC_fn_vDataHasBeenChanged(class CTL_Editor_Data *_pclChangedData,
																enum CTL_eUpdateReason _eReason,
																long _lUserDefinedReason = 0);

BOOL OAC_fn_bVectorDataMustBeRead(CTL_Editor_Data *_pclData);
BOOL OAC_fn_bVectorDataMustBeWritten(CTL_Editor_Data *_pclData);

//Controls
///////////


//Windows Controls
////////////////////
void OAC_fn_vFieldNameStaticHasBeenClicked_CallBack(class CTL_Editor_Static *_pclSenderStatic,
																										enum CTL_eClickType _tdeClickType);
void OAC_fn_vInstanceNameStaticHasBeenClicked_CallBack(class CTL_Editor_Static *_pclSenderStatic,
																											 enum CTL_eClickType _tdeClickType);
void OAC_fn_vModelNameStaticHasBeenClicked_CallBack(class CTL_Editor_Static *_pclSenderStatic,
									  																enum CTL_eClickType _tdeClickType);
void OAC_fn_ColRefGetStaticColor_CallBack(class CTL_Editor_Static *_pclSenderStatic,
									  											COLORREF &r_ColRefBackGround,
																					COLORREF &r_ColRefText);
void OAC_fn_vCheckBoxHasBeenClicked_CallBack(class CTL_Editor_CheckBox *_pclSenderCheckBox,
																						 class CTL_Editor_Control *_pclParentControl,
																						 enum CTL_eCarCheckBoxType _tdeType,
																						 long _lUserDefinedType,
																						 long _lUserDefinedCode);

BOOL OAC_fn_bLinkCheckBoxCanBeDisplayed_CallBack(class CTL_Editor_BaseControl *_pclSenderBaseControl);
BOOL OAC_fn_bLinkCheckBoxMustBeEnabled_CallBack(class CTL_Editor_BaseControl *_pclSenderBaseControl);


///////////////////////////////////////////////////////////////////////////////////////////////
// Global
////////////
CTL_Editor_Data *OAC_fn_pclAddStateData(CTL_Editor_DataList *_pclDataList,
																				CString _csDataName,
																				CTL_Editor_Data *_pclCurrentAssociatedData = NULL);
CTL_Editor_Data *OAC_fn_pclAddObjectListData(CTL_Editor_DataList *_pclDataList,
																						 CString _csDataName,
																						 CTL_Editor_Data *_pclCurrentAssociatedData = NULL);

BOOL OAC_fn_bBelongsToAnInstance(CTL_Editor_Data *_pclData);
BOOL OAC_fn_bIsEditingAnInstance(CTL_Editor_Control *_pclControl);


#endif //_OAC_DATA_AND_CONTROLS_CUSTOMIZATION_
