/*=========================================================================
*
* CPASaveO.hpp		- CPA_SaveObject : definition
*
*
* Version			1.0
* Creation date		20.06.97
* Revision date
*
* Shaitan
*=======================================================================*/
 
#ifdef ACTIVE_EDITOR
 
#ifndef __SAVE_OBJECT_HPP__
#define __SAVE_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 "CPABaseO.hpp"
#include "CPASectO.hpp"
 
/*#################################################################################*/
/* CPA_SaveObject*/
/*#################################################################################*/
 
class CPA_EXPORT CPA_SaveObject :	public CPA_BaseObject,
									public CPA_SectionObject
{
private:
	tdeSaveStatus m_eSaveStatus;
 
public:
    CPA_SaveObject  (CPA_EditorBase *pEditor, const CString csType, tdeSaveStatus eStatus,
                     CPA_BaseObject *pOwner = NULL, BOOL bAvailable = TRUE,
					 char *p_szDataPath = NULL, SCR_tdpfn_Ntfy_Callback pCallBack = NULL);
 
	CPA_SaveObject  (CPA_SaveObject &r_oSource);
 
	~CPA_SaveObject (void);
 
protected:
	void fn_vDoRename (const CString csNewName);
 
public:
	/* access*/
	tdeSaveStatus GetSaveStatus (void) { return m_eSaveStatus; }
	/*CPA2 Stegaru Cristian 98-03*/
	void		  SetSaveStatus (tdeSaveStatus eSaveStatus) { m_eSaveStatus = eSaveStatus;}
	/*End CPA2 Stegaru Cristian 98-03*/
    virtual tdeBaseClass fn_eGetBaseClass   (void)  { return E_bc_SaveObject; }
 
	/* name*/
	CString GetDefaultValidName		(const CString csDefaultBaseName = "");
	void	SetDefaultValidName		(const CString csDefaultBaseName = "");
 
    tdeMissingCriteria fn_eRename	(const CString csNewName);
 
	BOOL fn_bCheckScriptCharacters (const CString csName);
 
	/* references*/
	void fn_vUpdateAllReferences (void);
 
	CString fn_csComputeCompleteSectionName (const CString csNewName);
 
	/* virtual functions*/
	virtual BOOL fn_bCanBeNotified (void);
 
    virtual BOOL fn_bCheckNotification  (const CString csNewName);
 
	virtual tdeMissingCriteria fn_eCheckValidity (const CString csNewName);
 
	virtual void fn_vNotifySave		(void);
	virtual void fn_vNotifyUnSave	(void);
	virtual void fn_vNotifyRestore	(void);
	virtual void fn_vNotifyRename	(void);
 
	virtual void fn_vUpdateReference (CPA_SaveObject *pReferencedObject);
 
	virtual void fn_vUpdateSectionName (void);
 
	virtual CString fn_csComputeReferencedSectionName (const CString csNewName);
 
};
 
#endif /* __SAVE_OBJECT_HPP__*/
 
#endif /* ACTIVE_EDITOR*/
