 
#ifndef __CPA_CAMSLOTS_HPP__
#define __CPA_CAMSLOTS_HPP__
 
#include <afxtempl.h>
 
#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
/****************************************/
 
 
typedef enum {MakeACopy = 0,DontMakeACopy} tdeMakeCopy;
 
/*Stefan Dumitrean 1-07-98 ( slots )*/
typedef struct
{
	CString csEditorBaseName;
	CString csSelectedInstanceName;
}tdstExtraSlotInfo;
/*End Stefan Dumitrean 1-07-98 ( slots )*/
 
class CPA_BaseObject;
class CPA_CameraDLLBase;
 
class CPA_EXPORT CPA_CameraSlots
{
private:
 
typedef struct
{
	CPA_BaseObject		*p_oCamera;
	CString				csName;
	BOOL				bReserved;
	BOOL				bActive;
/*Stefan Dumitrean 1-07-98 ( slots )*/
	tdstExtraSlotInfo	stExtraInfo; 
/*End Stefan Dumitrean 1-07-98 ( slots )*/
} tdstSlot;
 
	CArray<tdstSlot,tdstSlot>		m_oCameraSlots;
	CPA_CameraDLLBase				*m_p_oInterface;
	long							m_lPrevCamSlotNum;
/*Stefan Dumitrean 22-06-98 ( slots )*/
	long							m_lCurrentSlot;
	long							m_lSpecialSlotForModeChange;
/*End Stefan Dumitrean 22-06-98 ( slots )*/
 
public:
	
    CPA_CameraSlots(void);
    ~CPA_CameraSlots(void);
 
/*Stefan Dumitrean 24-06-98 ( slots )*/
	long			 SaveCameraInSlot(long lNum,CString csName,CPA_BaseObject *p_oCamera,tdeMakeCopy eCopy = MakeACopy);
/*End Stefan Dumitrean 24-06-98 ( slots )*/
	CPA_BaseObject	*GetCameraFromSlot(long lNum,tdeMakeCopy eCopy = MakeACopy);
	
/*CPA2 Corneliu Babiuc 05-05-98*/
	/*function to get the number of alocated slots*/
	long        GetTotalSlotsNumber () {return m_oCameraSlots.GetSize();}
	/*function to get slot number from name of the slot*/
	long        GetSlotNumber(CString csSlotName);
	/*function to get slot name from its number*/
	CString     GetSlotName(long lSlotNum) {ASSERT(lSlotNum<m_oCameraSlots.GetSize());
	                                        return m_oCameraSlots[lSlotNum].csName;}
/*END CPA2 Corneliu Babiuc 05-05-98*/
 
/*Stefan Dumitrean 2-07-98 ( slots )*/
	void		SetCurrentSlot( CString csSlotName );
	void		SetCurrentSlot( long lSlotNum );
	long		GetCurrentSlot( );
	BOOL		IsSlotReserved( CString csSlotName );
	BOOL		IsSlotReserved( long lSlotNum );
	long		FindFirstEmptySlot( );
	long		SetSpecialSlotNr( long lSlotNum ) { m_lSpecialSlotForModeChange = lSlotNum; return lSlotNum; }
	BOOL		IsSpecialSlot( long lSlotNum ) { return ( m_lSpecialSlotForModeChange == lSlotNum ); }
	long		GetSpecialSlotNr( ) { return m_lSpecialSlotForModeChange; }
 
	CString		GetCurrentEditorName(); 
	CString		GetCurrentSelectionName();
	void		SetCurrentEditorForSlotNr( long lSlotNum );
	void		SetCurrentSelectionForSlotNr( long lSlotNum );
 
	CString		GetEditorNameForSlotNr( long lSlotNum );
	CString		GetSelectionNameForSlotNr( long lSlotNum );
	void		SetEditorNameForSlotNr( long lSlotNum, CString csName );
	void		SetSelectionNameForSlotNr( long lSlotNum, CString csName );
/*End Stefan Dumitrean 2-07-98 ( slots )*/
 
	void		SetInterface(CPA_CameraDLLBase *p_oInterface) { m_p_oInterface = p_oInterface;};
 
/*Stefan Dumitrean 22-06-98 ( slots )*/
	CPA_BaseObject	*GetCameraFromPopUpMenu( long &lSlotNum, CWnd *p_oParent, tdeMakeCopy eCopy = MakeACopy );
/*End Stefan Dumitrean 22-06-98 ( slots )*/
	long		GetSlotFromPopUpMenu(CWnd *p_oParent);
 
	long		ActivatePrevCamTip();
	BOOL		IsPrevCamTipActive() { return (m_lPrevCamSlotNum != -1);};
	long		GetPrevCamSlot() { return m_lPrevCamSlotNum; };	
 
	long		ReserveASlot(CString csName);
 
	BOOL		IsEmpty(long lSlotNum);
};
 
#endif /*ACTIVE_EDITOR*/
#endif /* __CPA_CAMSLOTS_HPP__*/
