#ifndef __TESTDETAIL_H
#define __TESTDETAIL_H
/////////////////////////////////////////////////////////////////////
// (C) Copyright 1993-1998 by Autodesk, Inc. 
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
//
/////////////////////////////////////////////////////////////////////
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;
};

MAKE_ACDBOPENOBJECT_FUNCTION(TestDetailStd);

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;

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