/* Header for the definition of a Array Data characteristic */
/*/////////////////////////////////////////////////////////*/
#ifndef _CTL_ARRAY_DATA_
#define _CTL_ARRAY_DATA_
 
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000*/
 
/*#include <afxtempl.h>*/
 
#include "CTL_Dat.hpp"
 
/*class CTL_Editor_MaskDescriptor;*/
 
class CPA_EXPORT CTL_Editor_ArrayData : public CTL_Editor_Data
{
public:
	/*Constructors*/
	CTL_Editor_ArrayData(  /* something...*/
							CString,
							CTL_Editor_DataList *_pclParentList,
							CTL_Editor_Data *pclCurrentBaseData = NULL);
 
	/* Destructor*/
	~CTL_Editor_ArrayData();
 
/*Attributes*/
public:
	tdstArray m_stCurrentValue;
	tdstArray m_stOldValue;
 
	tdstArray m_stKeepedValueForUndo;
protected:
 
private:
	/*CTL_Editor_MaskDescriptor *m_pri_pclMaskdescriptor;*/
 
/*Member functions*/
public:
	/*Function called to get a string representing the value of the data*/
	CStringList *m_fn_pcslFormatDataValueString();
 	/*Function called to set the value of the data acoording to a string representing it*/
	void m_fn_vSetValueWithString(CStringList *);
 
	/*Function called to Init the data*/
	void m_fn_vInitData();
 
	/*Function called to read associated motor's data*/
	void m_fn_vGetMotorData();
	
	/*Function called to update associated motor's data*/
	void m_fn_vUpdateMotorData(CTL_tdeUpdateReason eReason = CTL_UPDATE_REASON__NO_REASON_GIVEN,
														 long _lUserDefinedReason = 0);
 
	/*Function called to update data with another one*/
	void m_fn_vUpdateData(CTL_Editor_Data *pclSourceData,
	 						CTL_tdeUpdateReason eReason = CTL_UPDATE_REASON__NO_REASON_GIVEN,
							long _lUserDefinedReason = 0);
 
	/*Function called to look if data has been modified (by motor for example)*/
	void m_fn_vLookIfDataHasBeenModified();
 
	/*Undo*/
	/*Function called to save the current Value (for Undo)*/
	void m_fn_vKeepCurrentValue();
 
	/*Function called to validate Undo for the current change*/
	void m_fn_vRegisterUndoAction();
	
	virtual BOOL mfn_bEqualsModifiedDataOldValue (CTL_Editor_Data *pModifiedData);
 
	/* this is not quite good ;-)*/
	/* TODO*/
	tdstArray * mfn_pstSetCurrentValue (tdstArray * pstValue)
	{
		if (& m_stCurrentValue != pstValue)
		{
			m_stOldValue = m_stCurrentValue;
			m_stCurrentValue = * pstValue;
		}
		return & m_stOldValue;
	}
 
	tdstArray *mfn_pstGetCurrentValue () { return & m_stCurrentValue;}
	
	/*CTL_Editor_MaskDescriptor *m_pub_fn_pclGetMaskdescriptor();*/
 
protected:
 
private:
 
};											   
 
#endif /*_CTL_ARRAY_DATA_*/
