//#################################################################################
//
// BASE DEFINITION CLASS OF DLL interface Modification
//
//#################################################################################
//
//

#ifndef __FAMODIF_HPP__
#define __FAMODIF_HPP__

/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/

class CPA_Family;
class CPA_Action;
class CPA_State;
class TAction_Interface;

typedef enum
{
    C_eNone,
    C_eMode,
    C_eFamily,
    C_eAction,
    C_eActionList,
    C_eState,
    C_eNameList,
    C_eZAList,
    C_eZA
} tde_Change;

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// class Family_DelAllActions

class Family_DelAllActions : public CPA_Modif
{
protected:
    TAction_Interface       *m_p_oParentDLL;
    CPA_Family              *m_p_oFamily;
    CPA_List<CPA_Action>    m_oListOfActionsDeleted;
    CPA_List<CPA_State>     m_oListOfStates;
    CPA_List<CPA_State>     m_oListOfInitialStates;
    CPA_Action              *m_p_oInitialAction;
public:
    Family_DelAllActions(TAction_Interface *_p_oParentDLL, CPA_Family *_p_oFamily);
    ~Family_DelAllActions();
// actions
    BOOL Do();
    BOOL Undo();
};

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// class Family_StateChange

class Family_StateChange : public CPA_Modif
{
protected:
    TAction_Interface   *m_p_oParentDLL;
    long                m_lTypeOfChange;
    void                *m_p_vBefore;
    void                *m_p_vAfter;
    long                m_lBefore;
    long                m_lAfter;
    //statement
public:
    Family_StateChange(TAction_Interface *_p_oParentDLL, long _lTypeOfChange,
                       void *_p_vAfter, void *_p_vBefore,
                       long _lAfter = 0, long _lBefore = 0);
    ~Family_StateChange();
// actions
    BOOL Do();
    BOOL Undo();
protected:
    BOOL mfn_bSomethingToDo(void);
    BOOL mfn_vMakeChange(void *_p_vValue, long _lValue);
};

///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// class Family_ModifInitialAction

class Family_ModifInitialAction : public CPA_Modif
{
protected:
    TAction_Interface   *m_p_oParentDLL;
    CPA_Family          *m_p_oFamily;
    CPA_Action          *m_p_oNewInitialAction;
    CPA_Action          *m_p_oPreviousInitialAction;
    //Actionment
public:
    Family_ModifInitialAction(TAction_Interface *_p_oParentDLL, CPA_Family *_p_oFamily, CPA_Action *_p_oNewInitialAction);
    ~Family_ModifInitialAction();
// actions
    BOOL Do();
    BOOL Undo();
};

#endif // __FAMODIF_HPP__