/*=========================================================================
* 
* CPAModel.hpp : lists of the Editor Objects
* 
*
* Version			1.0
* Creation date		
* Revision date
*
* Shaitan
*=======================================================================*/
#ifdef ACTIVE_EDITOR
 
/****************************************/
#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_MODELS_HPP__
#define __CPA_MODELS_HPP__
 
#include "objdllb.hpp"
#include "Sort3lst.hpp"
 
/*#################################################################################*/
/* Models*/
/*#################################################################################*/
 
 
class CPA_Interface;
 
/*===========================================================================
*		Description:	Class for the Models 
*		Creation date:	
*		Author:			Shaitan
*
*---------------------------------------------------------------------------
*		List corresponding to the type "m_lTypeObject"
*---------------------------------------------------------------------------
*		Revision date:                                                                                          Author:         
*=========================================================================*/
class CPA_EXPORT EDT_Model : public CObject
{
public:
	CPA_ObjectDLLBase	*m_pObjectDLL;
	CString				m_csTypeName;
	CString				m_csName;
	CString				m_csBitmapName;
	int					m_iBitmapPos;
 
/* constructor*/
	EDT_Model (CPA_ObjectDLLBase *p_oDLL, CString csTypeName, CString csName, CString csBitmapName, CPA_Interface *pInterface);
	~EDT_Model (void);
 
/* bitmap*/
	BOOL fn_bChangeBitmap (CPA_Interface *pInterface, CString csNewBitmapName);
};
 
/*===========================================================================
*		Description:	Class for the Model View 
*		Creation date:	
*		Author:			Shaitan
*
*---------------------------------------------------------------------------
*		
*---------------------------------------------------------------------------
*		Revision date:                                                                                          Author:         
*=========================================================================*/
class EDT_ModelView : public C3ListView
{
public:
/* constructeur*/
	EDT_ModelView();
	~EDT_ModelView();
 
protected:
	void OnSelectItem( short wCase );
};
 
/*===========================================================================
*		Description:	Class for the Models By Type 
*		Creation date:	
*		Author:			Shaitan
*
*---------------------------------------------------------------------------
*		List corresponding to the type "m_lTypeObject"
*---------------------------------------------------------------------------
*		Revision date:                                                                                          Author:         
*=========================================================================*/
class CPA_EXPORT EDT_ModelsByType : public CObject
{
protected:
	CPA_ObjectDLLBase	*m_pDLLObject;
	CString				m_csTypeName;
public:
	/* models*/
	CPA_List<EDT_Model> m_stListModels;
	/* view*/
	EDT_ModelView *m_pModelView;
 
	/* constructor*/
	EDT_ModelsByType (CString csTypeName, CPA_ObjectDLLBase *p_oDLL, CWnd *pParentDialog, CBitmapList *pBitmapList);
	~EDT_ModelsByType (void);
 
	/* parameters*/
	BOOL	CanLoadNewModel		(void) { return m_pDLLObject->fn_bCanLoadNewModel(m_csTypeName); }
	BOOL	CanDeleteModel		(void) { return m_pDLLObject->fn_bCanDeleteModel(m_csTypeName); }
	BOOL	CanChangeModelIcon	(void) { return m_pDLLObject->fn_bCanChangeModelIcon(m_csTypeName); }
	BOOL	CanSaveList			(void) { return m_pDLLObject->fn_bCanSaveListModels(m_csTypeName); }
	CString GetTypeName			(void) { return m_csTypeName; }
	/* Model*/
	EDT_Model * GetModelWithName (CString csName);
	/* DLL*/
	CPA_ObjectDLLBase * GetDLL (void) { return m_pDLLObject; }
	/* Reinit*/
	void fn_vReinit (void);
	void fn_vInitModelView (CWnd *pParentDialog, CBitmapList *pBitmapList);
	void fn_vFillModelView (void);
	/* models*/
	void fn_vAddANewModel (EDT_Model *pNewModel);
	void fn_vRemoveAModel (EDT_Model *pOldModel);
};
 
 
#endif /* __CPA_MODELS_HPP__*/
#endif /* ACTIVE_EDITOR*/
