/*=========================================================================
*
* CPAFileO.hpp		- CPA_FileObject : definition
*
*
* Version			1.0
* Creation date		20.06.97
* Revision date
*
* Shaitan
*=======================================================================*/
 
#ifdef ACTIVE_EDITOR
 
#ifndef __FILE_OBJECT_HPP__
#define __FILE_OBJECT_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
/****************************************/
 
#include "Lst.hpp"
 
#include "itf\CPABaseO.hpp"
#include "itf\CPAHieEd.hpp"
 
class CPA_EditorBase;
 
#define C_szFileTypeName "FileObject"
 
typedef struct _tdstKeyName
{
	CString m_csKey;
	CString m_csName;
	CString m_csCompletionName;
}
tdstKeyName;
 
typedef struct _tdstDllKeyList
{
	CPA_EditorBase						*m_pEditor;
	CList<tdstKeyName*, tdstKeyName*>	m_oKeyList;
}
tdstDllKeyList;
 
/*===========================================================================
*		Description:	Class CPA_FileObject
*		Creation date:
*		Author:			Shaitan
*
*---------------------------------------------------------------------------
*		Revision date:                        Author:
*=========================================================================*/
class CPA_EXPORT CPA_FileObject : public CPA_BaseObject
{
/*only this function may call the constructor of a file object...*/
friend CPA_FileObject *CPA_HierarchyEditor::GetFileObject(CString csFileName);
 
private:
	CList<tdstDllKeyList*,tdstDllKeyList*> m_oDllKeyList;
	/*constructor is private to make sure the only way to get one is though the hierarchy*/
	CPA_FileObject (CPA_EditorBase *pEditor, const CString csFileName);
	
public:
	~CPA_FileObject (void);
 
	long	GetDataType (void) { return 0; }
	void *	GetData		(void) { return NULL; }
 
	CString GetReferencedName	(CPA_EditorBase *pEditor, const CString csKey);
	char *GetCompletionPath(CPA_EditorBase *pEditor, const CString csKey);
	CString GetCompleteName		(void);
    CString GetNameToDraw       (void)      { return GetCompleteName(); }
 
	BOOL fn_bSetReferencedName	(CPA_EditorBase *pEditor, const CString csKey, const CString csName);
	static void sm_vUniformizeSlashes(CString &r_csPath);
 
protected:
	tdstDllKeyList * GetDllKeyList	(CPA_EditorBase *pEditor);
	tdstKeyName *	 GetKeyName		(tdstDllKeyList *p_stList, const CString csKey);
};
 
 
#endif /* __FILE_OBJECT_HPP__*/
 
#endif /* ACTIVE_EDITOR*/
