//////////////////////////////////////////////////////////////////////////////
//
//  Copyright 2025 Autodesk, Inc.  All rights reserved.
//
//  Use of this software is subject to the terms of the Autodesk license 
//  agreement provided at the time of installation or download, or which 
//  otherwise accompanies this software in either electronic or hard copy form.   
//
//////////////////////////////////////////////////////////////////////////////

#ifndef __BOMREACTOR__H
#define __BOMREACTOR__H
///<summary>This class is used to monitor all important changes made to items, BOM tables, and other objects associated with the BOM.</summary>
class AcmBomReactor
{
public:
  AcmBomReactor() {}
    ///<summary>This function is called when a new BOM table is being created.</summary>
	virtual void onNewBOMTable(const AcDbObjectId &newTableId, const AcDbObjectId &compId) {}
    ///<summary>This function is called when the BOM table name is being changed.</summary>
	virtual void onRenameBOMTable(const AcDbObjectId &tableId, const LPCTSTR newName) {}
    ///<summary>This function is called when the BOM table name is being removed.</summary>
	virtual void onEraseBOMTable(const AcDbObjectId &tableId, const AcDbObjectId &compId) {}
    ///<summary>This function is called when a new parts list is being created.</summary>
	virtual void onNewPartList(const AcDbObjectId &partList, const AcDbObjectId &bomId) {}
    ///<summary>This function is called when changing the title of a parts list.</summary>
	virtual void onRenamePartList(const AcDbObjectId &partListId,const LPCTSTR &newname) {}
    ///<summary>This function is called when erasing a parts list.</summary>
	virtual void onErasePartList(const AcDbObjectId &partListId, const AcDbObjectId &bomId) {}

	///////////////////////////////////////////////////////////////////////////
	//	MRP Management methods:
	///////////////////////////////////////////////////////////////////////////
  ///<summary>This function is called when a parts list is reevaluating its items using filters.</summary>
  virtual void aboutToUpdatePartList(const AcDbObjectId& partListId) {}
  ///<summary>This function is called when BOM data entry is being created, 
  ///for example when the new AMPARTREF entity is added to database, or when new MDT part is being created. 
  ///During this callback it is allowed to read the contents of the entry.</summary>
  virtual void entryCreated(const AcDbObjectId& entryId) {}
  ///<summary>Immediately before entry data is changed, the aboutToModifyEntry notification is sent. 
  ///Whenever an entry is changed, the entryModified notification is sent.</summary>
  virtual void entryModified(const AcDbObjectId& entryid) {}
  ///<summary>Immediately before entry data is changed, the aboutToModifyEntry notification is sent. 
  ///Whenever an entry is changed, the entryModified notification is sent.</summary>
  virtual void aboutToModifyEntry(const AcDbObjectId& entryId,LPCTSTR tag,LPCTSTR value) {}
  ///<summary>If the reactor wants to display its own editing dialog for the entry's data, you must overload this function.</summary>
  virtual void entryEdit(const AcDbObjectId& entryId,CMapStringToString& dataMapList) {}
  ///<summary>If the reactor wants to display its own editing dialog for the entry's data, you must overload this function. 
  ///It must return true.</summary>
  virtual bool isEntryEditImplemented() { return false;}
  ///<summary>This function is called when an item is being created.</summary>
  virtual void itemCreated(const AcDbObjectId& itemId) {}
  ///<summary>Encapsulates the modification of the item data, including the item number.</summary>
  virtual void itemModified(const AcDbObjectId& itemId) {}
  ///<summary>Encapsulates the modification of the item data, including the item number.</summary>
  virtual void aboutToModifyItem(const AcDbObjectId& itemId,LPCTSTR tag,LPCTSTR value) {}
  ///<summary>This function is called according to the starting and finishing of the AMPARTREF dialog.</summary>
  virtual void onPartDlgStarted(const AcDbObjectId& entryId) {}
  ///<summary>This function is called according to the starting and finishing of the AMPARTREF dialog.</summary>
  virtual void onPartDlgCanceled(const AcDbObjectId& entryId) {}
  ///<summary>This function is called according to the starting and finishing of the AMPARTREF dialog.</summary>
  virtual void onPartDlgFinished(const AcDbObjectId& entryId) {}
  ///<summary>This function is called according to the starting and finishing of the AMBALLOON dialog.</summary>
  virtual void onBomDlgStarted(const AcDbObjectId& bomId) {}
  ///<summary>This function is called according to the starting and finishing of the AMBALLOON dialog.</summary>
  virtual void onBomDlgCanceled(const AcDbObjectId& bomId) {}
  ///<summary>This function is called according to the starting and finishing of the AMBALLOON dialog.</summary>
  virtual void onBomDlgFinished(const AcDbObjectId& bomId) {}
  ///<summary>This function is called according to the starting and finishing of the AMBOM dialog.</summary>
  virtual void onBomDlgBomIdChanged(const AcDbObjectId& newBomId) {}
  ///<summary>This function is called according to the starting and finishing of the AMPARTLIST dialog.</summary>
  virtual void onPartListDlgStarted(const AcDbObjectId& partListId) {}
  ///<summary>This function is called according to the starting and finishing of the AMPARTLIST dialog.</summary>
  virtual void onPartListDlgCanceled(const AcDbObjectId& partListId) {}
  ///<summary>This function is called according to the starting and finishing of the AMPARTLIST dialog.</summary>
  virtual void onPartListDlgFinished(const AcDbObjectId& partListId) {}
  ///<summary>This function is called according to the starting and finishing of the AMBOM dialog.</summary>
  virtual void onBalloonDlgStarted(const AcDbObjectId& balloonId) {}
  ///<summary>This function is called according to the starting and finishing of the AMBOM dialog.</summary>
  virtual void onBalloonDlgCanceled(const AcDbObjectId& balloonId) {}
  ///<summary>This function is called according to the starting and finishing of the AMBOM dialog.</summary>
  virtual void onBalloonDlgFinished(const AcDbObjectId& balloonId) {}
};

#endif