#ifndef __EDITEXT_H
#define __EDITEXT_H

/////////////////////////////////////////////////////////////////////
//
// (C) Copyright 1993-2005 by Autodesk, Inc.
//
// The information contained herein is confidential, proprietary
// to Autodesk,  Inc.,  and considered a trade secret as defined
// in section 499C of the penal code of the State of California.
// Use of  this information  by  anyone  other  than  authorized
// employees of Autodesk, Inc.  is granted  only under a written
// non-disclosure agreement,  expressly  prescribing  the  scope
// and manner of such use.
//
// editExt.h
//
// Created:     Jirka Stejskal                 6/9/98
// Modified:
//
// Description: This is the definition for edit extension to
// split UI and entity implementation.
//
/////////////////////////////////////////////////////////////////////
#ifndef __ACM_H
	#error include 'acm.h' before including 'editExt.h' file
#endif

typedef void (*AcadTaskFCN)(void*);

class AcmCLeader;

class DllImpExp CPlstFltrDlg : public CDialog
{
public:
  CPlstFltrDlg(const AcDbObjectId& filterId);
  ~CPlstFltrDlg();
  virtual void OnEraseFilter();
  virtual bool OnUpdateFilter(bool enable, CString& msg, CWnd*& pFocus);
  AcDbObjectId filterId() const;
  virtual void OnUpdateDialog();
protected:
  //useful for deriving from this class
  bool callAcadTaskFcn(AcadTaskFCN func, void* data);
  void updatePartListDlg() const;

  AcDbObjectId mFilterId;
  // Generated message map functions
  // {{AFX_MSG(CPlstFltrDlg)
  afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);

  virtual void PostNcDestroy();
  // }}AFX_MSG
  DECLARE_MESSAGE_MAP()

};

inline CPlstFltrDlg::CPlstFltrDlg(const AcDbObjectId& filterId)
:CDialog(), mFilterId(filterId)
{
}

inline CPlstFltrDlg::~CPlstFltrDlg()
{
}

inline void 
CPlstFltrDlg::PostNcDestroy()
{
  delete this;
}

inline bool
CPlstFltrDlg::OnUpdateFilter(bool enable, CString& msg, CWnd*& pFocus)
{ assert(0);
  return false;
}

inline void 
CPlstFltrDlg::OnUpdateDialog()
{
}

inline AcDbObjectId 
CPlstFltrDlg::filterId() const
{
  return mFilterId;
}

class DllImpExp AcmCEditExt : public AcRxObject
{
public:
  ACRX_DECLARE_MEMBERS(AcmCEditExt);
  // for AcDbEntity based classes (symbols)
  virtual bool edit(AcDbObject* rObj, INT_PTR GsMarker) const = 0;
  // for AcDbObject based classes (standards, bom tables, ...)
  virtual bool edit(const AcDbObject* rObj, CWnd* pParentWnd = NULL) const = 0;
  // for symbols
  virtual void addLeaderTo(AcDbObject* pObj) const = 0;
  virtual bool delLeaderFrom(AcDbObject* pObj, bool silent = false, INT_PTR gsMarker = -1, const AcGePoint3d& pck = (*(const AcGePoint3d*)NULL) ) const = 0;
  // test of validity to enable add/delete leader
  // (for conditions detectable before action)
  virtual bool addLeaderEnabled(AcDbObject* pObj) const = 0;
  virtual bool delLeaderEnabled(AcDbObject* pObj) const = 0;
  // test of validity to enable delete leader
  // (for conditions detectable as far as during action)
  virtual bool abortRemovingLeader(AcDbObject* pObj) const = 0;
  // this method specifies if the extension is valid and can be used for
  // editing. The default implementation for AcDbObject and AcDbEntity return false;
  virtual bool isValid() const = 0;
  // For filter
  virtual CPlstFltrDlg* fltrPropertiesDlg(AcDbObject* pObj,CWnd* pParentWnd) const = 0;
  virtual bool placeAndPost(AcDbObject* pObj,AcDbObjectId& newSymId) const = 0;

  //this function should not be in API!!
  virtual AcmCLeader* newLeader(AcDbObject* pSym) const = 0;
};

void initEditExt();
void releaseEditExt();

#endif // __ENTGEOM_H
