/*=========================================================================
* 
* CPALists.hpp : lists of the Editor Objects
* 
*
* Version			1.0
* Creation date		
* Revision date
*
* Shaitan
*=======================================================================*/
#ifdef ACTIVE_EDITOR
 
#include "objdllb.hpp"
#include "Sort3lst.hpp"
 
/****************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/****************************************/
 
#ifndef __CPA_LISTS_HPP__
#define __CPA_LISTS_HPP__
 
/* define*/
typedef enum tdeListUpdateMode_
{
	E_lum_Insert,
	E_lum_ReInsert,
	E_lum_Delete,
}
tdeListUpdateMode;
 
class EDT_ListByDLL;
 
/*#################################################################################*/
/* Instances */
/*#################################################################################*/
 
/*===========================================================================
*		Description:	Class for the Lists By Type 
*		Creation date:	
*		Author:			Shaitan
*
*---------------------------------------------------------------------------
*		List corresponding to the type "m_lTypeObject"
*---------------------------------------------------------------------------
*		Revision date:       Author:         
*=========================================================================*/
class CPA_EXPORT EDT_ListByType : public CObject
{
protected:
	CPA_ObjectDLLBase	*m_pObjectDLL;
	CString				m_csTypeName;
 
	EDT_ListByType ();
	void SetObjectDLL (CPA_ObjectDLLBase *p_oDLL) { m_pObjectDLL = p_oDLL; }
	void SetTypeName  (CString csTypeName);
 
 
public:
 
	/* list of instances*/
	CPA_List<CPA_SuperObject> m_stListObjects;
	/* list Sorted*/
	CPA_BaseObjectList		  m_stSortedList;
 
	EDT_ListByType (CPA_ObjectDLLBase *p_oDLL, CString csTypeName);
	~EDT_ListByType ();
 
	/* Type*/
	CString GetTypeName (void)	{ return m_csTypeName; }
	/* DLL*/
	CPA_ObjectDLLBase * GetDLL (void) { return m_pObjectDLL; }
	/* Instances*/
	CPA_SuperObject * GetObjectWithName (CString csName);
	/* Reinit*/
	void fn_vReinit (void);
 
	friend class EDT_ListByDLL;
 
};
 
/*===========================================================================
*		Description:	Class for the Lists By DLL 
*		Creation date:	
*		Author:			Shaitan
*
*---------------------------------------------------------------------------
*		List corresponding to the type "m_lTypeObject"
*---------------------------------------------------------------------------
*		Revision date:                                                                                          Author:         
*=========================================================================*/
class CPA_EXPORT EDT_ListByDLL : public CObject
{
protected:
	/* for identification*/
	CPA_ObjectDLLBase *m_pDLLObject;
 
public:
	/* list of instances*/
	EDT_ListByType m_stListAllTypes;
	/* list of selected objects*/
	CPA_List<CPA_SuperObject> m_stListSelected;
	/* list of concerned objects*/
	CPA_List<CPA_SuperObject> m_stListConcerned;
 
	/* list of protected childs selected*/
	CPA_List<CPA_SuperObject> m_stListProtectSelected;
	/* list of protected childs concerned*/
	CPA_List<CPA_SuperObject> m_stListProtectConcerned;
 
	/* lists by type*/
	CPA_List<EDT_ListByType> m_stListOfListByType;
 
	/* constructor*/
	EDT_ListByDLL (CPA_ObjectDLLBase *p_oDLL = NULL);
	~EDT_ListByDLL (void);
 
	/* Lists*/
	EDT_ListByType * GetListByType (CString csTypeName);
	/* Instance*/
	CPA_SuperObject * GetObject (char *szTypeName, char *szName);
	/* DLL*/
	CPA_ObjectDLLBase * GetDLL (void) { return m_pDLLObject; }
	/* Update*/
	void fn_vReinit (void);
	void fn_vUpdateSortedList  (void);
	void fn_vUpdateListObject  (CPA_SuperObject *pEdObj, tdeListUpdateMode eType);
	void fn_vUpdateListSelect  (CPA_SuperObject *pEdObj, tdeListUpdateMode eType, BOOL bIsSelected);
	void fn_vUpdateListProtect (CPA_SuperObject *pEdObj, tdeListUpdateMode eType, BOOL bIsSelected);
};
 
#endif /* __CPA_LISTS_HPP__*/
#endif /* ACTIVE_EDITOR*/
