//////////////////////////////////////////////////////////////////////////////
//
//  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 __TESTDETAIL_H
#define __TESTDETAIL_H
class TestDetailSub;


class TestDetailStd : public AcmSymbolStd
{
public:
  ACDB_DECLARE_MEMBERS(TestDetailStd);
  TestDetailStd();
  virtual ~TestDetailStd();

  // Object data
  Adesk::Boolean isLeaderToText() const;
  void setLeaderToText(Adesk::Boolean exist);
  Adesk::Boolean isDotDrawn() const;
  void setDotDrawn(Adesk::Boolean drawIt);

  // AcmSymbolStd interface
  virtual Acm::ErrorStatus getDescription(CString& desc,
                                          CBitmap*& pBmpLoaded,
                                          CBitmap*& pBmpReg,
                                          Adesk::Boolean& enablePref) const;
  virtual Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const;
  virtual Adesk::Boolean isCompatibleTo(const AcmStandard* pStd) const;

  virtual void initToEditOriginal();
  virtual void initToEdit();
  virtual Adesk::Boolean setFactoryDefaults();
  virtual Acm::ErrorStatus checkVisibility(TestDetailSub* pData) const;
  virtual Acm::ErrorStatus initFields(TestDetailSub* pData) const;
  virtual void getSubEnts(const TestDetailSub* pSymb,AcmCAuxEntArray& subents) const;

  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;

private:
  // private data
  Adesk::Boolean mLeaderToText;
  Adesk::Boolean mDotDrawn;
};

inline Adesk::Boolean 
TestDetailStd::isLeaderToText() const
{
  assertReadEnabled();
  return mLeaderToText;
}

inline void 
TestDetailStd::setLeaderToText(Adesk::Boolean exist)
{
  assertWriteEnabled();
  mLeaderToText = exist;
}

inline Adesk::Boolean 
TestDetailStd::isDotDrawn() const
{
  assertReadEnabled();
  return mDotDrawn;
}

inline void 
TestDetailStd::setDotDrawn(Adesk::Boolean drawIt)
{
  assertWriteEnabled();
  mDotDrawn = drawIt;
}

class TestDetail : public AcmSymbol
{
public:
    ACDB_DECLARE_MEMBERS(TestDetail);

    TestDetail();             
    virtual ~TestDetail();             

    virtual Acm::ErrorStatus setSymbolDefaults();
   
    virtual Adesk::Boolean edit(int GSSelectionMarker = -1);             

    virtual TestDetailSub * subSymbol() const;

    virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
    virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;

protected:
  virtual Adesk::Boolean    subWorldDraw(AcGiWorldDraw*        mode);

  virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);

  virtual Acad::ErrorStatus subExplode(AcDbVoidPtrArray& entitySet) const;
    
  virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
                                               const AcGeVector3d& offset);

  virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
                                            AcDbIntArray&     osnapModes,
                                            AcDbIntArray&     geomIds) const;

  virtual Acad::ErrorStatus   subGetGripPoints(AcDbGripDataPtrArray& grips,
														  const double curViewUnitSize, 
														  const int gripSize, 
														  const AcGeVector3d& curViewDir,
														  const int bitflags) const;

private:
    TestDetailSub* mSubSymbol;             
    Acad::ErrorStatus getSubEnts(AcmCAuxEntArray& subents) const;
};    

class TestDetailSub : public AcmCSubSymbol
{
public:
  TestDetailSub();
  virtual ~TestDetailSub();

  virtual AcGePoint3d origin() const;
  virtual void setOrigin(const AcGePoint3d& pt);
  AcGePoint3d textNode() const;
  virtual void setTextNode(const AcGePoint3d& pt);
  double radius() const;
  void setRadius(double r);
  LPCTSTR text() const;
  void setText(LPCTSTR t);

  virtual LPCTSTR value(Acm::Variable var) const;
  virtual Acm::ErrorStatus getValue(Acm::Variable var, CString& value) const;
  virtual Acm::ErrorStatus setValue(Acm::Variable var, LPCTSTR value);

  virtual Acm::Visibility  variableStatus(Acm::Variable var) const;
  virtual Acm::ErrorStatus setVariableStatus(Acm::Variable var, Acm::Visibility status);

  virtual Acm::ErrorStatus getVarDlgInfo(Acm::Variable var,CVarDlgInfo& v) const;
  virtual Acm::ErrorStatus setVarDlgInfo(Acm::Variable var,const CVarDlgInfo& v);

  virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform);
  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer,Adesk::UInt16 ver);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
  virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
  Acad::ErrorStatus varInFields(const AcmVariant* pVar, AcRxObject* pFiler = nullptr) override
  { return Acad::eNotImplemented; }
  Acad::ErrorStatus varOutFields(AcmVariant* pVar, AcRxObject* pFiler = nullptr) const override
  { return Acad::eNotImplemented; }

private:
  AcGePoint3d mOrigin;
  double mRadius;

  // the only dialog variable
  CString mText;
  AcGePoint3d mTextNode;

  CString mLabel;
  CString mToolTip;
  Adesk::UInt32 mHelpIndex;
};

inline 
TestDetailSub::TestDetailSub()
{
}

inline 
TestDetailSub::~TestDetailSub()
{
}

inline AcGePoint3d 
TestDetailSub::origin() const
{
  return mOrigin;
}

inline void 
TestDetailSub::setOrigin(const AcGePoint3d& o)
{
  mOrigin = o;
}

inline AcGePoint3d 
TestDetailSub::textNode() const
{
  return mTextNode;
}

inline void 
TestDetailSub::setTextNode(const AcGePoint3d& o)
{
  mTextNode = o;
}

inline double 
TestDetailSub::radius() const
{
  return mRadius;
}

inline void 
TestDetailSub::setRadius(double r)
{
  mRadius = r;
}

inline LPCTSTR 
TestDetailSub::text() const
{
  return (LPCTSTR)mText;
}

inline void 
TestDetailSub::setText(LPCTSTR t)
{
  mText = t;
}

class TestDetailStdReactor : public AcmStdReactor
{
public:
  // use this call back to populate standard with your implemented symbol
  // standard
	virtual void onNewStandard(AcmStandard *pNewStd);
  virtual void onChanged(const AcmStandard* pStd, Acm::StdVariable var);
  virtual void onChanged(const AcmSymbolStd* pSymStd);
  virtual void onRemoved(const AcmStandard* pStd);

};


#endif