/////////////////////////////////////////////////////////////////////////////
//
// EventsList -  
// ABaseEvent -       
// 
////////////////////////////////////////////////////////////////////////////
#ifndef _ABASEEVENT_H
#define _ABASEEVENT_H

#ifndef __LDEFIN2D_H
#include <ldefin2d.h>
#endif       
   
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/////////////////////////////////////////////////////////////////////////////
//
//       
//
/////////////////////////////////////////////////////////////////////////////
class cBaseEvent : public CCmdTarget
{
protected:
  static CObList&           m_EventList;  //   
  DWORD                     m_dwCookie;   //  
  NotifyConnectionParam     m_params;     //  
	reference                 refDoc;       //       
	
// Operations
public:
	          cBaseEvent( int ifType, reference p = 0, long objType = 0, reference doc = 0 );
	          cBaseEvent( int ifType, LPUNKNOWN iContainer = NULL, long objType = 0, LPUNKNOWN iObj = NULL, reference doc = 0 );
  virtual  ~cBaseEvent();

  bool         Advise();                   //    
  void         Unadvise();                 //    
  void         RemoveThis();               //       
  void         Disconnect();               //    
  virtual void Clear();                    //     

  static void  TerminateEvents( void );    //   
  static void  DestroyList();              //        
         int   GetType() { return m_params.ifType; } //  

  static void        TerminateEvents( long eventType, reference doc = 0, int objType = -1, LPUNKNOWN iObj = NULL );  
  static cBaseEvent* FindEvents(      long eventType, reference doc = 0, int objType = -1, LPUNKNOWN iObj = NULL );  

  virtual LPUNKNOWN  GetUnknown() = 0;
   
};


////////////////////////////////////////////////////////////////////////////////
#endif 
