/*=========================================================================
*
* CPASaveO.hpp		- CPA_SaveObject : definition
*
*
* Version			1.0
* Creation date		07.07.97
* Revision date
*
* MT
*=======================================================================*/
 
#ifdef ACTIVE_EDITOR
 
#ifndef __MODIFIABLE_OBJECT_HPP__
#define __MODIFIABLE_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 <afxtempl.h>
 
#include "CPASaveO.hpp"
 
class CPA_ModifNamesList;
 
/*#################################################################################*/
/* CPA_ModifiableObject*/
/*#################################################################################*/
 
class CPA_EXPORT CPA_ModifiableObject : public CPA_SaveObject
{
private:
    CList<long,long>    m_oListOfModifications;
    CPA_ModifNamesList *m_p_oListOfModifNames;
public:
    CPA_ModifiableObject  (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_ModifiableObject  (CPA_ModifiableObject &r_oSource);
    ~CPA_ModifiableObject  (void);
 
    virtual tdeBaseClass fn_eGetBaseClass   (void)  { return E_bc_ModifiableObject; }
 
    void fn_vUpdateModification (const CString _ocsModificationType, BOOL _bModified, BOOL bInitialState);
    void fn_vSetCurrentState    (const CString _ocsModificationType, BOOL bInitialState);
    void fn_vSetModification    (const CString _ocsModificationType, BOOL _bModified = TRUE, BOOL _bInitialState = TRUE);
 
    BOOL fn_bIsOnInitialState   (const CString _ocsModificationType);
    BOOL fn_bIsModified         (const CString _ocsModificationType);
 
    virtual void fn_vSetOnState         (const CString _ocsModificationType, BOOL _bOnInitialState) {}
    virtual void fn_vValidateState      (const CString _ocsModificationType, BOOL bInitialState);
 
	virtual BOOL fn_bCanBeValidated (void) { return TRUE; }
 
protected:
    POSITION fn_stGetModificationPos    ( const CString _ocsModificationType );
};
 
#endif /* __MODIFIABLE_OBJECT_HPP__*/
 
#endif /* ACTIVE_EDITOR*/
