//////////////////////////////////////////////////////////////////////////////
//
//  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.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef __ACM_SURFACE_TEXTURE_SYMBOL_LIBRARY_H
#define __ACM_SURFACE_TEXTURE_SYMBOL_LIBRARY_H

#include "SymbolLib.h"

//////////////////////////////////////////////////////////////////////////
///<summary>This class is derived from AmdtSymbolLibObject.</summary>
class ACMSYMBB_CRX_DLLSHARE AmdtSurfTextLibObject : public AmdtSymbolLibObject
{
public:
  ACRX_DECLARE_MEMBERS(AmdtSurfTextLibObject);
  ///<summary>The class constructor. It initialized the base class data member.</summary>
  AmdtSurfTextLibObject();
  ///<summary>The class destructor.</summary>
  ~AmdtSurfTextLibObject();

  Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler) override;
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const override;
  ///<summary>Get the usage of the all around symbol.</summary>
  Acm::SurfTextAppModifierType appModifierType(Adesk::UInt16 idx) const;
  ///<summary>Get whether the surface texture symbol library object has a forced tail.</summary>
  Adesk::Boolean isForcedTail(Adesk::UInt16 idx) const;
  ///<summary>Get the usage of the majority.</summary>
  Adesk::Boolean isMajority() const;
  ///<summary>Get the usage of the majority with deviations.</summary>
  Adesk::Boolean hasDeviations() const;
  ///<summary>Get the general type of symbol library object it will express.</summary>
  Acm::SurfTextType subType(Adesk::UInt16 idx) const;
  ///<summary>Update the symbol library object.</summary>
  ///<param name="pCSubSymList">AcmCSubSymbolsList contains data used in updating current library object.</param>
  ///<param name="itemName">Name of the new library object.</param>
  ///<param name="stdName">Original standard name.</param>
  ///<param name="className">Symbol standard class name.</param>
  ///<returns>Return Acad::eOk, if successful.</returns>
  Acm::ErrorStatus set(const AcmCSubSymbolsList* pCSubSymList, const ACHAR* itemName, const ACHAR* stdName, const ACHAR* className) override;
  ///<summary>Get the specific value of the symbol library object.</summary>
  ///<param name="idx">Refer to Adesk::UInt16 for the define idex of sub-symbol in the array of sub-symbol list.</param>
  ///<param name="var">Refer to Acm::Variable for the specific symbol.</param>
  ///<param name="Value">Formatted result.</param>
  ///<returns>If returns Acad::eOK, the caller is responsible for deleting the string returned in value.</returns>
  Acm::ErrorStatus getRequirementValue(Adesk::UInt16 idx, Acm::Variable var, ACHAR*& retVal)const override;

  bool operator==(const AmdtSurfTextLibObject& surflibObj)const;

  //obsolete methods - do not use them!
  void getObject(AcmCSubSymbol* pCSubSym) const override;
  void setObject(const AcmCSubSymbol* pCSubSym) override;
  Acm::ErrorStatus getRequirementValue(Acm::Variable var, ACHAR*& retVal) const override;
  Acm::ErrorStatus set(const AcmCSubSymbol* pCSubSym, const ACHAR* itemName, const ACHAR* stdName, const ACHAR* className) override;

protected:
  ///<summary>This overloaded method is used 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(AmdtSurfTextLibObject)


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

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

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

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

protected:
  virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
};
DBREF_DECLARE(AmdtSurfTextLibrary)

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


#endif //
