
//////////////////////////////////////////////////////////////////////////////
//
//  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 __ACM_WELDING_SYMBOL_LIBRARY_H
#define __ACM_WELDING_SYMBOL_LIBRARY_H

#include "SymbolLib.h"

//////////////////////////////////////////////////////////////////////////
///<summary>This class is existing class derived from AmdtSymbolLibObject. It is a wrapper for class
///AcmWeldingLibObjectImp.</summary>
class ACMSYMBB_CRX_DLLSHARE AmdtWeldingLibObject : public AmdtSymbolLibObject
{
public:
  ACRX_DECLARE_MEMBERS(AmdtWeldingLibObject);
  ///<summary>The class constructor. It initialized the base class data member.</summary>
  AmdtWeldingLibObject();
  ///<summary>virtual ~AmdtWeldingLibObject ();</summary>
  ~AmdtWeldingLibObject();
  Acm::ErrorStatus getOtherSideReqValue(Acm::Variable var, ACHAR *& retVal, bool isPrimary=true) const;
  Acm::ErrorStatus getArrowSideReqValue(Acm::Variable var, ACHAR *& retVal, bool isPrimary=true) const;

  virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  ///<summary>Get the type of the other side or not.</summary>
  Acm::SubSymbolType type(bool isArrowSide, bool isPrimary) const;
  ///<summary>Get the usage of the all around symbol.</summary>
  Acm::SubSymbolType areaDescType() const;
  ///<summary>Get the type of weld symbol association.</summary>
  Acm::WeldAssociation associationType() const;
  ///<summary>Get the type of weld symbol side association.</summary>
  Acm::WeldSideAssociation sideAssociationType() const;
  ///<summary>Get whether symbol library object has a field.</summary>
  Adesk::Boolean fieldWeld() const;
  ///<summary>Get the type of identification line.</summary>
  Acm::IdentLineType identificationLine() const;
  ///<summary>Get whether the tail is closed.</summary>
  Adesk::Boolean closedTail() const;
  bool operator==(const AmdtWeldingLibObject& weldLibObj)const;

protected:
  ///<summary>Get the CLSID of the equivalent class in COM API.</summary>
  ///<param name="pClsid">Pointer to a CLSID with the return result.</param>
  virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
};
DBREF_DECLARE(AmdtWeldingLibObject)


////////////////////////////////////////////////////////////////
///<summary>This class is existing class derived from AmdtSymbolLibaray.</summary>
class ACMSYMBB_CRX_DLLSHARE AmdtWeldingLibrary : public AmdtSymbolLibrary
{
public:
  ACRX_DECLARE_MEMBERS(AmdtWeldingLibrary);
  ///<summary>The class constructor.</summary>
  AmdtWeldingLibrary();
  ///<summary>Refer to the AmdtSymbolLibrary.</summary>
  virtual const ACHAR *name() const;

  ///<summary>Refer to the AmdtSymbolLibrary.</summary>
  virtual Acad::ErrorStatus loadItem(const ACHAR *itemName, AcmSymbol *pSym);

  ///<summary>Load the symbol library to the specific reference line in the Welding Symbol.</summary>
  ///<param name="itemName">Name of the existing library object.</param>
  ///<param name="pSym">Pointer to a Symbol with the return result.This symbol provides the information on 
  ///standad and symbol standard.Standard refers to original standard.</param>
  ///<param name="index">Specify the subSymbol of the welding symbol to load this library object.</param>
  ///<returns>If there is no error, returns Acad::eOK.</returns>
  virtual Acad::ErrorStatus loadItem(const ACHAR *itemName, AcmSymbol *pSym, Adesk::UInt16 index);

  ///<summary>Refer to the AmdtSymbolLibrary.</summary>
  virtual Acad::ErrorStatus appendItem(const ACHAR *itemName, const AcmSymbol* pSym, AcDbObjectId &returnId, bool bCheckValidName=true);

  ///<summary>Add the specific subSymbol to the library.</summary>
  ///<param name="itemName">Name of the new library object.</param>
  ///<param name="pSym">Pointer to a Symbol.This symbol provides the information on standad and symbol standard.</param>
  ///<param name="index">Specify the subSymbol of the welding symbol to be added.</param>
  ///<param name="returnId">Object ID of the library object.</param>
  ///<param name="bCheckValidName">Default is true. If true, the name, specify in the library object, is
  ///checked against the existing objects, of the same standard and symbol standard, including legacy objects.</param>
  ///<returns>If there is no error, returns Acad::eOK.</returns>
  virtual Acad::ErrorStatus appendItem(const ACHAR *itemName, const AcmSymbol* pSym, Adesk::UInt16 index, AcDbObjectId &returnId, bool bCheckValidName=true);

  ///<summary>Refer to the AmdtSymbolLibrary.</summary>
  virtual Acad::ErrorStatus appendItem(AmdtSymbolLibObject* pObj, AcDbObjectId& returnId, bool bCheckValidName=true);

  ///<summary>Refer to the AmdtSymbolLibrary.</summary>
  virtual Acad::ErrorStatus modifyItem(const ACHAR *itemName, AcmSymbol *pSym);

  ///<summary>Modify an existing symbol library object based on the symbol. If successful, returns Acad::eOK.</summary>
  ///<param name="itemName">Name of library object to be modified.</param>
  ///<param name="pSym">Pointer to a Symbol with the data used for modification.This symbol provides the 
  ///information on standad and symbol standard.</param>
  ///<param name="index">Specify the subSymbol of the welding symbol to use for modification.</param>
  virtual Acad::ErrorStatus modifyItem(const ACHAR *itemName, AcmSymbol *pSym, Adesk::UInt16 index);

protected:
  ///<summary>Get the CLSID of the equivalent class in COM API.</summary>
  ///<param name="pClsid">Pointer to a CLSID with the return result.</param>
  virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
};
DBREF_DECLARE(AmdtWeldingLibrary)

//////////////////////////////////////////////////////////////////////////
ACMSYMBB_CRX_DLLSHARE bool getAcmWeldingLibrary(AcDbObjectId &libId, AcDbDatabase *pDb=NULL, bool bCreateIfNotExist=true);

#endif //