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

#include "symstd.h"
#include "AcmTitle.h"

class AcAmgTitleStdImp;
///<summary>This class represents the standard element for drawing sheet. It derives from AcmSymbolStd class.</summary>
class AMGTITLE_CRX_DLLSHARE AcAmgTitleStd : public AcmSymbolStd
{
  friend class AcAmgTitleStdImp;
public:

  ACDB_DECLARE_MEMBERS(AcAmgTitleStd);
  ///<summary>the construct function.</summary>
  AcAmgTitleStd();
  ///<summary>the construct function.</summary>
  AcAmgTitleStd(const TCHAR *pBaseStd);
  ///<summary>the destruct function.</summary>
  virtual ~AcAmgTitleStd();
  void getBorderMap(CMapStringToString*& BorderMap);
  void getBorderMap(const CMapStringToString*& BorderMap) const;
  void getTitleMap(const CMapStringToString*& TitleMap) const;
  void getTitleMap(CMapStringToString*& TitleMap);

  void getRevMap(const CMapStringToString*& RevMap);
  void getRevMap(CMapStringToString*& RevMap);

  void getAdditionalMap(CMapStringToString*& AddintionalMap,int iIndex);
  void getAdditionalMap(const CMapStringToString*& AddintionalMap,int iIndex);

  ///<summary>Gets the default Border.</summary>
  const CString& DefBorder() const;
  ///<summary>Gets the default title.</summary>
  const CString& DefTitle() const;
  const CString& DefRev() const;
  const CString& DefAdditional(int iIndex) const;

  ///<summary>This function returns a CString object that point out current standard.</summary>
  const CString& BaseStd() const;
  ///<summary>Sets the Base standard.</summary>
  void setBaseStd(CString&);

  ///<summary>Get if the invert part number block will be inserted in the drawing</summary>
  bool isInsertInvertPart() const;
  ///<summary>Get the height of the invert part number border</summary>
  double invertPartBorderHeight() const;
  ///<summary>Get the width of the invert part number border</summary>
  double invertPartBorderWidth() const;
  ///<summary>Get the text height in the invert part number block</summary>
  double invertPartTextHeight() const;
  ///<summary>Set if the invert part number block will be inserted in the drawing</summary>
  void setIsInsertInvertPart(bool bIsInsert);
  ///<summary>Set the height of the invert part number border</summary>
  void setInvertPartBorderHeight(double height);
  ///<summary>Set the width of the invert part number border</summary>
  void setInvertPartBorderWidth(double width);
  ///<summary>Set the text height in the invert part number block</summary>
  void setInvertPartTextHeight(double textHeight);

  ///<summary>Sets the default border.</summary>
  bool setDefBorder(CString& defBrd);
  ///<summary>Sets the default title.</summary>
  bool setDefTitle(CString& defTit);

  bool setDefRev(CString& defRev);
  bool setDefAdditional(CString& defAddtional,int iIndex);
  void addGBFormats();
  void addDINFormats();
  void addGOSTFormats();
  void initRevMap(const TCHAR *pcBaseStd);

  ///<summary>This member function is implemented for the AcmSymbolStd interface. 
  ///It is necessary to be able to properly edit the standard.</summary>
  virtual Acm::ErrorStatus getDescription(CString& desc,
                                          CBitmap*& pBmpLoaded,
                                          CBitmap*& pBmpReg,
                                          Adesk::Boolean& enablePref) const;

  ///<summary>Gets the information about the standard name and revision.</summary>
  virtual Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const;

  ///<summary>Provides the basic interface for the AcmStandardManager and hence determines 
  ///whether AcmSymbolSTD can be used for a particular standard.</summary>
  virtual Adesk::Boolean isCompatibleTo(const AcmStandard* pStd) const;

  virtual Adesk::Boolean edit(CWnd* parentWindow = NULL);
  virtual void initToEditOriginal();
  virtual void initToEdit();

  ///<summary>Sets the factory default values.</summary>
  virtual Adesk::Boolean setFactoryDefaults();

  Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  Acad::ErrorStatus dxfInFields(AcDbDxfFiler *filer);
  Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;

  const ACHAR* getBaseSymStdClassName() const override;

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

private:
  AcAmgTitleStdImp *m_pImp;
};

#endif // __ACMTITLESTD_H
