/*=========================================================================*/
/* CPADLLb.hpp :       base of all DLL*/
/* This is a part of the CPA project.*/
/**/
/* Version                      1.0*/
/* Creation date        10/06/96*/
/* Revision date*/
/**/
/* (c) Ubi Studio 1996*/
/**/
/* DO NOT MODIFY THAT FILE. IF SOMETHING NEEDS TO BE CHANGE, PLEASE CONTACT*/
/* VINCENT GRECO OR CHRISTOPHE BEAUDET.*/
/*=========================================================================*/
 
#ifndef __CPADLLB_HPP__
#define __CPADLLB_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
/****************************************/
 
 
#ifdef ACTIVE_EDITOR
#include "CPAEditB.hpp"
/*#include "EDTParam.hpp"*/
 
class EDT_SaveParents;
class EDT_SavePos;
class EDT_SaveGlobalPos;
 
 
/*##########################################################################*/
/* typedef for messages*/
 
typedef enum
{
	C_AsCurrentEditor,
	C_AsConcernedDLL,
	C_AsChildOwner,
	C_AsToolDLL
}
tdeStatus;
 
typedef enum
{
	C_Accept,
	C_Refuse,
	C_WantNext
}
tdeTypeAnswer;
 
 
 
/*##########################################################################*/
/* Definition of all DLL types*/
typedef enum {OBJECT_DLL = 1, ALL_OBJECTS_DLL, TOOL_DLL, ALL_TOOLS_DLL, HIERARCHY_DLL} tdeDLLType;
 
 
class CPA_ObjectDLLBase;
 
/*##########################################################################*/
/* DLL Identity*/
class CPA_DLLBase;
typedef struct
{
	tdeDLLType							eType;		/* type of the DLL*/
	CString								csName;	/* name of the DLL (unique)*/
    HMODULE								hModule;
	CList<CPA_DLLBase*,CPA_DLLBase*>	*p_oListOfInstances;
} tdstDLLIdentity;
 
 
/*##########################################################################*/
/* base Definition of a DLL*/
typedef struct tdstDLLBaseDef_
{
	BOOL	bCanOutputIn3DView;
	BOOL	bCanBeRefreshedByEngine;
	unsigned short uwReference;				/* private value that references this instance*/
} tdstDLLBaseDef;
 
 
/*##########################################################################*/
/* DLL Base Class*/
/*##########################################################################*/
 
 
class CPA_EXPORT CPA_DLLBase : public CPA_EditorBase
{
protected:
 
/* parameters*/
	tdstDLLBaseDef	m_stBaseDLLDefinition;
	tdstDLLIdentity	*m_p_stDLLIdentity;
 
public:
 
/*===========================================================================
	Contructor
=========================================================================*/
    CPA_DLLBase();
    virtual ~CPA_DLLBase();
 
/*===========================================================================
	Get functions
=========================================================================*/
    tdstDLLBaseDef	* GetBaseDefinition	(void)	{ return &m_stBaseDLLDefinition; }
	tdstDLLIdentity * GetDLLIdentity	(void)	{ return m_p_stDLLIdentity; }
    CString			  GetName			(void)	{ return m_p_stDLLIdentity->csName; }
	unsigned short	  GetReference		(void)	{ return m_stBaseDLLDefinition.uwReference; }
 
/*===========================================================================
	Set functions
=========================================================================*/
	void SetReference	(unsigned short uwRef)		{ m_stBaseDLLDefinition.uwReference = uwRef; }
 
/*===========================================================================
	Virtual Functions
=========================================================================*/
public:
 
    /* To pre translate all messages*/
    virtual BOOL fn_bPreTranslateMessage(MSG * /*p_stMsg*/) { return FALSE; };
    /* Called just after editor has been inserted in list of all editors*/
    virtual void fn_vJustAfterRegistered(void) {};
    /* Called just before windows main loop processing*/
    virtual void fn_vConstruct(void) {};
    /* Called to refresh datas of DLL if "fn_vCanBeRefresh" returns TRUE*/
    virtual void fn_vRefreshDatas(void) {};
	/* Called when engine level has changed, before editor level changes*/
	virtual void fn_vLevelChanges (void) {};
	/* Called when editor level has changed*/
	virtual void fn_vLevelHasChanged (void) {};
 
 
public:
 
/*===========================================================================
	Messages from Interface
=========================================================================*/
 
/* Editor Modifs*/
	virtual void fn_vOnModifDelete	(CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
	virtual void fn_vOnModifParent	(CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
	virtual void fn_vOnModifCopy	(CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus) { }
	virtual void fn_vOnModifName	(CPA_SuperObject *pEdObj, CString csInitalName, CString csFinalName, tdeTypeModif eType, tdeStatus eStatus) { }
	virtual void fn_vOnSelect		(CPA_SuperObject *pEdObj, tdeTypeModif eType, tdeStatus eStatus) { }
/*ANNECY Shaitan SPOFlags 18/02/98*/
	virtual void fn_vOnModifFlag	(CPA_SuperObject *pEdObj, unsigned long ulOldFlag, unsigned long ulNewFlag) { }
/*ENDANNECY Shaitan SPOFlags*/
 
/*ANNECY Shaitan Transparency (26/03/98) {*/
	virtual void fn_vOnModifTransparency (CPA_SuperObject *pEdObj, float fNewLevel) { }
/*ENDANNECY Shaitan Transparency }*/
 
	virtual void fn_vOnModifInsert	(CPA_SuperObject *pEdObj, CPA_SuperObject *pParent,
									 tdstPosition *p_stPosition, tdeTypeModif eType, tdeStatus eStatus) { }
 
/* Moves*/
	virtual void fn_vOnModifMove (CPA_List<EDT_SavePos> *pListObjects, CPA_List<EDT_SaveGlobalPos> *pListConcerned, tdeTypeModif eType, tdeStatus eStatus)	 { }
	virtual void fn_vOnBeginMove (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus) { }
	virtual void fn_vOnMoving	 (CPA_List<CPA_SuperObject> *pListObjects, CPA_List<CPA_SuperObject> *pListConcerned, tdeStatus eStatus) { }
 
/* permission*/
/* Begin Silviu Simen 18 August 1998 Cut/Paste Mechanism*/
	virtual BOOL fn_bAcceptModifCut		(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)  { return TRUE; };
/* End Silviu Simen 18 August 1998 Cut/Paste Mechanism*/
	virtual BOOL fn_bAcceptModifDelete		(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)  { return TRUE; }
	virtual BOOL fn_bAcceptModifParent		(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)  { return TRUE; }
	virtual BOOL fn_bAcceptModifCopy		(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)  { return TRUE; }
	virtual BOOL fn_bAcceptModifTranslate	(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)  { return TRUE; }
	virtual BOOL fn_bAcceptModifRotate		(CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus)  { return TRUE; }
	virtual BOOL fn_bAcceptModifInsert		(CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdeStatus eStatus) { return TRUE; }
	virtual BOOL fn_bAcceptModifScale		(CPA_SuperObject *pEdObj, tdeStatus eStatus) { return TRUE; }
	virtual BOOL fn_bAcceptModifName		(CPA_SuperObject *pEdObj, tdeStatus eStatus) { return TRUE; }
	virtual BOOL fn_bAcceptMultiSelect		(void)	{ return TRUE; }
/*ANNECY Shaitan SPOFlags 18/02/98*/
	virtual BOOL fn_bAcceptModifFlag		(CPA_SuperObject *pEdObj, unsigned long ulFlag) { return TRUE; }
/*ENDANNECY Shaitan SPOFlags*/
 
/* to precise selection*/
	virtual tdeTypeAnswer fn_bAcceptSelect	(CPA_SuperObject *pEdObj, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking, tdeStatus eStatus) { return C_Accept; }
 
/* orient*/
	virtual BOOL fn_bAcceptOrientInstance	(CPA_SuperObject *pEdObj)									{ return TRUE; }
	virtual BOOL fn_bOnClickOrientPosition	(CPA_SuperObject *pEdObj, tdstPosition *pOrientPosition)	{ return FALSE; }
	virtual BOOL fn_bOnOrientingObject		(CPA_SuperObject *pEdObj, tdstPosition *pOrientPosition)	{ return FALSE; }
	virtual BOOL fn_bOnEndOrientObject		(CPA_SuperObject *pEdObj, tdstPosition *pOrientPosition)	{ return FALSE; }
 
 
/*===========================================================================
	Dialog List
=========================================================================*/
 
	virtual BOOL fn_bSetCustomTest		(CPA_DialogList *pDialog) { return FALSE; }
	virtual BOOL fn_bCustomTestFunction (CString csCurrentType, CString csTestName, CPA_BaseObject *pEdObj) { return TRUE; }
/* Begin Silviu Simen Select by sector*/
	virtual void fn_vSelectBySectorAndType(void)  { return; };
/* End Silviu Simen Select by sector*/
};
 
 
#endif /* ACTIVE_EDITOR*/
#endif /* __CPADLLB_HPP__*/
