/*=============================================================================
 *
 *  Filename:			CPAAction.hpp
 *  Version:            2.0     (VSS5)
 *  Date:				30/12/96
 *  Author:             Marc Trabucato
 *
 *  Description:		description of CPA_Action class
 *
 *===========================================================================*/
 
#ifndef __CPAACTION_HPP__
#define __CPAACTION_HPP__
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif
/******************************************/
 
#ifdef ACTIVE_EDITOR
 
 
class CPA_Family;
 
#define C_szActionSectionName       "CreateNewEDTAction"
 
/*=============================================================================
 * CPA_Action class
 =============================================================================*/
class CPA_Action : public CPA_SaveObject
{
  /* datas*/
  public:
	CPA_List<CPA_State>    m_oListOfStates;
    CPA_State             *m_p_oDefaultState;
    CPA_List<CPA_State>    m_oListOfStatesInterrupted;
  /* methods*/
  public:
    CPA_Action(CPA_EditorBase *p_oDLL, CPA_BaseObject *_p_oOwnerFamily, CString _csActionName);
 
    /*void    *GetEngineStruct        ( void );*/
    long    GetDataType     ( void )        { return 0; }
    void*   GetData         ( void );
 
    tdeMissingCriteria  fn_eCheckUnicity ( const CString _csNewName )       { return fn_eCheckUnicityWithOwner( _csNewName ); }
    void                fn_vNotifyRename ( void );
 
    static SCR_tde_Anl_ReturnValue fn_AddNewAction  ( SCR_tdst_File_Description *_p_stFile, char *_p_szName, char *_ap_szParams[], SCR_tde_Anl_Action _eAction );
    static void mfn_vCallBackSave                   ( SCR_tdst_File_Description *_p_stActionFile, char *_p_szSectionName, void *_p_vData, SCR_tde_Ntfy_Action _eAction);
 
    void        mfn_vAddState           (CPA_State *_p_oState, BOOL _bModifyEngine = TRUE);
    void        mfn_vRemoveState        (CPA_State *_p_oState, BOOL _bModifyEngine = TRUE);
    void        mfn_vSetDefaultState    (CPA_State *_p_oState, BOOL _bInit =FALSE);
    CPA_State  *mfn_p_oGetDefaultState  (void)                  { return m_p_oDefaultState ;}
    CPA_Action *mfn_p_oDuplicateAction  (void);
/*  CPA_Ed_1 Mihaela Tancu begin  */
	void		mfn_vSetListOfStates				();
	void		mfn_vSetListOfTransitionalStates	(CPA_List<CPA_State>* p_oListOfStates, 	CPA_List<CPA_State>* p_oListOfStatesTransitional);
/*  CPA_Ed_1 Mihaela Tancu end */
    void			 mfn_vInterruptState		(CPA_State *_p_oState);
    void			 mfn_vDontInterruptState	(CPA_State *_p_oState);
// Shaitan => state list in the level
  public:
// End Shaitan => state list in the level
	tdxHandleToState mfn_hGetStateFromLinkTable	(char *_szStateName,char *_szFamilyName);
	CPA_State		*mfn_p_oCreateNewState		(char *_szStateName);
};
 
#endif /* ACTIVE_EDITOR*/
#endif /* __CPAACTION_HPP__*/
