/////////////////////////////////////////////////////////////////////////////////////////
//
// Please refer to "COPYRIGHT.md" for the relevant copyright statement of this software.
//
/////////////////////////////////////////////////////////////////////////////////////////
//
#ifndef _GCRX_EVENT_H__
#define _GCRX_EVENT_H__

#include "gcarray.h"
#include "rxobject.h"
#include "GdGChar.h"
#include "dbid.h"
#include "GcDbCore2dDefs.h"
#pragma pack(push, 8)

#define GCRX_EVENT_OBJ GCRX_T("GcRxEvent")

class GcDbDatabase;
class GcGeMatrix3d;
class GcDbIdMapping;
class GcGePoint3d;

enum GcXrefSubCommand
{
  kAttach = 0,
  kBind = 1,
  kDetach = 2,
  kOverlay = 3,
  kPath = 4,
  kReload = 5,
  kResolve = 6,
  kUnload = 7,
  kXBind = 8
};

class GCDB_PORT GcRxEventReactor : public GcRxObject
{
public:
  GCRX_DECLARE_MEMBERS(GcRxEventReactor);
  virtual ~GcRxEventReactor();

  GSOFT_DEPRECATED virtual void dwgFileOpened(GcDbDatabase*, GCHAR*) final
  {
  }
  virtual void dwgFileOpened(GcDbDatabase*, const GCHAR*)
  {
  }
  virtual void initialDwgFileOpenComplete(GcDbDatabase*)
  {
  }
  virtual void databaseConstructed(GcDbDatabase*)
  {
  }
  virtual void databaseToBeDestroyed(GcDbDatabase*)
  {
  }

  virtual void beginSave(GcDbDatabase*, const GCHAR*)
  {
  }
  virtual void saveComplete(GcDbDatabase*, const GCHAR*)
  {
  }
  virtual void abortSave(GcDbDatabase*)
  {
  }

  virtual void beginDxfIn(GcDbDatabase*)
  {
  }
  virtual void abortDxfIn(GcDbDatabase*)
  {
  }
  virtual void dxfInComplete(GcDbDatabase*)
  {
  }
  virtual void beginDxfOut(GcDbDatabase*)
  {
  }
  virtual void abortDxfOut(GcDbDatabase*)
  {
  }
  virtual void dxfOutComplete(GcDbDatabase*)
  {
  }

  virtual void beginInsert(GcDbDatabase*, const GCHAR*, GcDbDatabase*)
  {
  }
  virtual void beginInsert(GcDbDatabase*, const GcGeMatrix3d&, GcDbDatabase*)
  {
  }
  virtual void otherInsert(GcDbDatabase*, GcDbIdMapping&, GcDbDatabase*)
  {
  }
  virtual void abortInsert(GcDbDatabase*)
  {
  }
  virtual void endInsert(GcDbDatabase*)
  {
  }

  virtual void wblockNotice(GcDbDatabase*)
  {
  }
  virtual void beginWblock(GcDbDatabase*, GcDbDatabase*, const GcGePoint3d*&)
  {
  }
  virtual void beginWblock(GcDbDatabase*, GcDbDatabase*, GcDbObjectId)
  {
  }
  virtual void beginWblock(GcDbDatabase*, GcDbDatabase*)
  {
  }
  virtual void otherWblock(GcDbDatabase*, GcDbIdMapping&, GcDbDatabase*)
  {
  }
  virtual void abortWblock(GcDbDatabase*)
  {
  }
  virtual void endWblock(GcDbDatabase*)
  {
  }
  virtual void beginWblockObjects(GcDbDatabase*, GcDbIdMapping&)
  {
  }

  virtual void beginDeepClone(GcDbDatabase*, GcDbIdMapping&)
  {
  }
  virtual void beginDeepCloneXlation(GcDbIdMapping&, Gcad::ErrorStatus*)
  {
  }
  virtual void abortDeepClone(GcDbIdMapping&)
  {
  }
  virtual void endDeepClone(GcDbIdMapping&)
  {
  }

  virtual void partialOpenNotice(GcDbDatabase*)
  {
  }

  virtual void beginAttach(GcDbDatabase*, const GCHAR*, GcDbDatabase*)
  {
  }
  virtual void otherAttach(GcDbDatabase*, GcDbDatabase*)
  {
  }
  virtual void abortAttach(GcDbDatabase*)
  {
  }
  virtual void endAttach(GcDbDatabase*)
  {
  }
  virtual void redirected(GcDbObjectId, GcDbObjectId)
  {
  }
  virtual void comandeered(GcDbDatabase*, GcDbObjectId, GcDbDatabase*)
  {
  }
  virtual void beginRestore(GcDbDatabase*, const GCHAR*, GcDbDatabase*)
  {
  }
  virtual void abortRestore(GcDbDatabase*)
  {
  }
  virtual void endRestore(GcDbDatabase*)
  {
  }

  virtual void xrefSubcommandBindItem(GcDbDatabase*, int, GcDbObjectId)
  {
  }
  virtual void xrefSubcommandAttachItem(GcDbDatabase*, int, const GCHAR*)
  {
  }
  virtual void xrefSubcommandOverlayItem(GcDbDatabase*, int, const GCHAR*)
  {
  }
  virtual void xrefSubcommandDetachItem(GcDbDatabase*, int, GcDbObjectId)
  {
  }
  virtual void xrefSubcommandPathItem(int, GcDbObjectId, const GCHAR*)
  {
  }
  virtual void xrefSubcommandReloadItem(GcDbDatabase*, int, GcDbObjectId)
  {
  }
  virtual void xrefSubcommandUnloadItem(GcDbDatabase*, int, GcDbObjectId)
  {
  }
  virtual void xrefSubCommandStart(
    GcDbDatabase*, GcXrefSubCommand, const GcArray<GcDbObjectId>&, const GCHAR* const*, const GCHAR* const*, bool&)
  {
  }
  virtual void xrefSubCommandAborted(
    GcDbDatabase*, GcXrefSubCommand, const GcArray<GcDbObjectId>&, const GCHAR* const*, const GCHAR* const*)
  {
  }
  virtual void xrefSubCommandEnd(
    GcDbDatabase*, GcXrefSubCommand, const GcArray<GcDbObjectId>&, const GCHAR* const*, const GCHAR* const*)
  {
  }

  virtual void preXrefLockFile(GcDbDatabase*, GcDbObjectId)
  {
  }
};

#define gcrxEvent GcRxEvent::cast(gcrxSysRegistry()->at(GCRX_EVENT_OBJ))

class GCDB_PORT GcRxEvent : public GcRxObject
{
public:
  GCRX_DECLARE_MEMBERS(GcRxEvent);
  virtual void addReactor(GcRxEventReactor* newObj) = 0;
  virtual void removeReactor(GcRxEventReactor* delObj) = 0;
};

#pragma pack(pop)
#endif
