//////////////////////////////////////////////////////////////////////////////
//
//  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_FCF_SYMBOL_LIBRARY_H
#define __ACM_FCF_SYMBOL_LIBRARY_H

#include "SymbolLib.h"

//////////////////////////////////////////////////////////////////////////
///<summary>This class is a existing class. It is migrated from FCFLibArx.h to FCFSymLib.h, and a 
///wrapper for class AcmFCFLibObjectImp.</summary>
class ACMSYMBB_CRX_DLLSHARE AmdtFCFLibObject : public AmdtSymbolLibObject
{
public:
  ACRX_DECLARE_MEMBERS(AmdtFCFLibObject);
  ///<summary>The constructor initialized the base class data member. The base class is responsible 
  ///to free this data member.</summary>
  AmdtFCFLibObject();
  ///<summary>The class destructor.</summary>
  ~AmdtFCFLibObject();

  virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  ///<summary>Get the GDT symbol type for the first row.</summary>
  Acm::GdtSymbolType symbol() const;
  ///<summary>Get the GDT symbol type for the second row.</summary>
  Acm::GdtSymbolType symbol2() const;
  ///<summary>Get the GDT symbol type for the third row.</summary>
  Acm::GdtSymbolType symbol3() const;
  ///<summary>Get the usage of the all around symbol.</summary>
  Acm::SurfTextAppModifierType appModifierType() const;
  
  bool operator==(const AmdtFCFLibObject& fcfLibObj)const;
protected:
  ///<summary>This overloaded method is used in COM API.</summary>
  virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
};
DBREF_DECLARE(AmdtFCFLibObject)


////////////////////////////////////////////////////////////////
///<summary>This class is existing class derived from AmdtSymbolLibrary. It is migrated from FCFLibArx.h 
///to FCFSymLib.h</summary>
class ACMSYMBB_CRX_DLLSHARE AmdtFCFLibrary : public AmdtSymbolLibrary
{
public:
  ACRX_DECLARE_MEMBERS(AmdtFCFLibrary);
  ///<summary>The class constructor.</summary>
  AmdtFCFLibrary();
  ///<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>
  ///<returns>If successful, returns Acad::eOK.</returns>
  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 there is no error, 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(AmdtFCFLibrary)

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


#endif //