#ifndef __ANNOTATIONVIEW_H
#define __ANNOTATIONVIEW_H

#ifndef __ACMDEF_H
	#error include 'acmdef.h' before including this file
#endif
#ifndef __SYMSTD_H
	#error include 'symStd.h' before including this file
#endif
/////////////////////////////////////////////////////////////////////
// (C) Copyright 1993-2007 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 AcmSymbol;
class AcmSymbolStd;
class AmdtAnViewStdImp;

class DllImpExp AmdtAnViewStd : public AcmSymbolStd
{
  friend class AcmSymbbInternals;

public:
  ACRX_DECLARE_MEMBERS(AmdtAnViewStd);
  virtual ~AmdtAnViewStd();
  
  // returns standard's default Label position
  virtual Acm::AnnotLabelPositionType defaultLabelPosition() const;
  virtual CString defaultLabelPattern()const;
  virtual void labelPatternVariables (CStringArray &patternVars) const;
  virtual Adesk::Boolean setFactoryDefaults();
  virtual double defaultMargin()const;
  // Set default text and leader settings
  virtual void setDefaultTextLeader();


  // set/get label position
  Acm::AnnotLabelPositionType getLabelPosition()const;
  Adesk::Boolean setLabelPosition(Acm::AnnotLabelPositionType value);

  // get margin
  double getMargin() const;

  // set/get lable text
  const ACHAR* getLabelPattern() const;
  Adesk::Boolean setLabelPattern(const ACHAR* value);

  //set/get text style
  AcDbObjectId textStyleId() const;
  void setTextStyleId(const AcDbObjectId& id);

  bool textStyleByStandard() const;
  void setTextStyleByStandard(bool byStandard);

  virtual void setTextHeightByStandard(bool byStandard);
  virtual void setTextColorByStandard(bool byStandard);

  virtual double byStdTextHeight() const;
  virtual const AcCmColor & byStdTextTrueColor() const;

  // standard overrides
  virtual Acm::ErrorStatus getDescription(CString& desc,
                                          CBitmap*& pBmpLoaded,
                                          CBitmap*& pBmpReg,
                                          Adesk::Boolean& enablePref) const;
  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
    
  virtual void getMTextProperties(AcDbMText& text) const;

  virtual bool isHeightSizedUp() const;

protected:
  AmdtAnViewStd();

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

private:
  AmdtAnViewStdImp* mpImp;
};
MAKE_ACDBOPENOBJECT_FUNCTION(AmdtAnViewStd);
DBREF_DECLARE(AmdtAnViewStd)

class AmdtCAnnotationLabelImp;

class AmdtCAnnotationLabel : public AcmCSubSymbol {
public:
  virtual void getSubEntsText(AcmCAuxEntArray& subents) const = 0;  

  virtual void setLabelOffset(const AcGeVector3d& offset) = 0;
  virtual AcGeVector3d getLabelOffest() const = 0;
};


class DllImpExp AmdtAnnotationLabel : public AcmSymbol {
  friend class AcmNoteTranslate;     
public:
  ACRX_DECLARE_MEMBERS(AmdtAnnotationLabel);
  AmdtAnnotationLabel();
  virtual ~AmdtAnnotationLabel();

  AmdtCAnnotationLabel* subSymbol() const;

  bool setLabelPattern(const ACHAR* value);
  const ACHAR* getLabelPattern() const;

  const ACHAR* getLabelText() const;

  void setOrigin(const AcGePoint3d &origin);

  bool set2dStructureView(const AcDbObjectId& viewId);
  void get2dStructureView(AcDbObjectId& viewId) const;

  // AcmSymbol interface
  virtual Acm::ErrorStatus setSymbolDefaults(AcDbDatabase *pDb = NULL);
  virtual Acm::ErrorStatus resetServer(const AcDbObjectId& symbolStdId);

  // AcDbEntity interface
  using AcmSymbol::transformBy;
  virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform, double symbolScale);

  virtual void              regen();

  // AcDbObject Interface
  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler*);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler*) const;
  virtual Acad::ErrorStatus subErase(Adesk::Boolean erasing);

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

  virtual Acad::ErrorStatus subGetGeomExtents(AcDbExtents&) const;
  virtual Acad::ErrorStatus subExplode(AcDbVoidPtrArray& entitySet) const;
  virtual void              subList() const;

  virtual Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode     osnapMode,
                                           INT_PTR             gsSelectionMark,
                                           const AcGePoint3d&  pickPoint,
                                           const AcGePoint3d&  lastPoint,
                                           const AcGeMatrix3d& viewXform,
                                           AcGePoint3dArray&   snapPoints,
                                           AcDbIntArray&       geomIds) const;

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

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

  virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray&, const AcGeVector3d&);

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

private:
  AmdtCAnnotationLabelImp *mpSubSymbol;
};
//MAKE_ACDBOPENOBJECT_FUNCTION(AmdtAnnotationLabel);
DBREF_DECLARE(AmdtAnnotationLabel)

#endif // __ANNOTATIONVIEW_H

