//////////////////////////////////////////////////////////////////////////////
//
//  Copyright 2025 by Autodesk, Inc.  All rights reserved.
//
// This computer source code and related instructions and comments 
// are the unpublished confidential and proprietary information of 
// Autodesk, Inc. and are protected under applicable copyright and 
// trade secret law.  They may not be disclosed to, copied or used 
// by any third party without the prior written consent of Autodesk, Inc.
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "SymbolLib.h"

//////////////////////////////////////////////////////////////////////////
///<summary>This class is existing class. It is migrated from EdgeLibArx.h to EdgeSymLib.h, and 
///a wrapper for class AcmEdgeLibObjectImp.</summary>
class ACMSYMBB_CRX_DLLSHARE AmdtEdgeLibObject : public AmdtSymbolLibObject
{
public:
  ACRX_DECLARE_MEMBERS(AmdtEdgeLibObject);
  ///<summary><para>The constructor initialized the base class data member.</para><para>mpImp = new
  ///AcmEdgeLibObjectImp (this);</para><para>The base class is responsible to free this data member.</para></summary>
  AmdtEdgeLibObject();
  ///<summary>The class destructor.</summary>
  ~AmdtEdgeLibObject();
  
  virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  ///<summary>Get the usage of the majority symbol.</summary>
  Adesk::Boolean isMajority() const;
  ///<summary>Get the usage of the all around indication.</summary>
  Adesk::Boolean isAllAround() const;
  ///<summary>Get the usage of the standard label note for the symbol.</summary>
  Adesk::Boolean isStdNum() const;
  ///<summary>Get if the direction of the edge symbol library object's size is defined.</summary>
  Adesk::Boolean isDefinedDirect() const;
  ///<summary>Get the usage of the limited area.</summary>
  Adesk::Boolean isLimitedArea() const;
  ///<summary>Get the usage of the Quantity of edge.</summary>
  Adesk::Boolean isQuantity() const;
  ///<summary>Get the major type of edge apearance.</summary>
  Adesk::UInt16 getEdgeOptions() const;
  ///<summary>Get the position of The Edge indication directions.</summary>
  Adesk::UInt16 getDirectionPosition() const;
  ///<summary>Get the direction for the edge symbol library object's undefined size.</summary>
  Acm::EdgeUndefinedDirection undefinedDirection() const;
  bool operator==(const AmdtEdgeLibObject& edgeLibObj)const;

protected:
  ///<summary>This overloaded method is used in COM API.</summary>
  virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
};
DBREF_DECLARE(AmdtEdgeLibObject)


////////////////////////////////////////////////////////////////
///<summary>This class is existing class derived from AmdtSymbolLibrary. it is migrated from EdgeLibArx.h
///to EdgeSymLib.h</summary>
class ACMSYMBB_CRX_DLLSHARE AmdtEdgeLibrary : public AmdtSymbolLibrary
{
public:
  ACRX_DECLARE_MEMBERS(AmdtEdgeLibrary);
  ///<summary>The class constructor.</summary>
  AmdtEdgeLibrary();
  ///<summary>Get the name of the Symbol Library's Dictionary.</summary>
  virtual const ACHAR *name() const;

  ///<summary>Load a symbol library object to the symbol, pSym.</summary>
  ///<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="itemName">Name of library object.</param>
  virtual Acad::ErrorStatus loadItem(const ACHAR *entryName, AcmSymbol *pSym);

  ///<summary>Add a new symbol library object based on the symbol.</summary>
  ///<param name="pSym">Pointer to a Symbol with the value added to the library.This symbol provides the 
  ///information on standad and symbol standard.Standard refers to original standard.</param>
  ///<param name="bCheckValidName">Default is true. If true, entry name is unique in the library.</param>
  ///<param name="itemName">Name of the new library object.</param>
  ///<param name="newId">Object ID of the new librar object, if successful.</param>
  ///<returns>If successful, returns Acad::eOK.</returns>
  virtual Acad::ErrorStatus appendItem(const ACHAR *entryName, const AcmSymbol* pSym, AcDbObjectId& id, bool bCheckValidName=true);

  ///<summary>Add the symbol library object to the library.</summary>
  ///<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>
  ///<param name="pLibObj">Pointer of symbol library object to be added.This object should not have an 
  ///owner.This object should specify the standard name and symbol standard name.User should not free the 
  ///object if append is successful.</param>
  ///<param name="newId">Object ID of the new library object, if successful.</param>
  ///<returns>If successful, returns Acad::eOK.</returns>
  virtual Acad::ErrorStatus appendItem(AmdtSymbolLibObject* pObj, AcDbObjectId& id, bool bCheckValidName=true);

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

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