//
#ifndef __BOMSTD_H
#define __BOMSTD_H
/////////////////////////////////////////////////////////////////////
// (C) Copyright 1993-2008 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 AcmCColumnDef;
class AcmCBalloonStd;
class AcmCBalloonStdImp;
class AcmCPartList;
class AcmCPartListImp;
class AcmCPartListStd;
class AcmCPartListStdImp;
class AmdtItemFilter;
class AcmBalloon;
class AcmBOMStdImp;
class AcmPartList;
class CGridHolder;

#include <vector>
class DllImpExp AcmBOMStd : public AcmSymbolStd
{
  friend class AcmSymbbInternals;
public:
  ACRX_DECLARE_MEMBERS(AcmBOMStd);
  virtual ~AcmBOMStd();

  Acm::ErrorStatus appendColumn(AcmCColumnDef*& pColumn,Acm::ColType type, 
                           Acm::DataType dataType,LPCTSTR colName,LPCTSTR caption = NULL);
  Acm::ErrorStatus insertColumn(int pos, AcmCColumnDef*& pCol,Acm::ColType type, 
                           Acm::DataType dataType,LPCTSTR colName,LPCTSTR caption = NULL);
  Acm::ErrorStatus deleteColumn(int pos);
  Adesk::Boolean   moveColumn(int oldPos, int newPos);
  Adesk::UInt16    columnLength() const;

  AcmCColumnDef*       column(int pos);
  const AcmCColumnDef* column(int pos) const;

  AcmCColumnDef*       column(LPCTSTR name, LPCTSTR caption=NULL);
  const AcmCColumnDef* column(LPCTSTR name, LPCTSTR caption=NULL) const;

  AcmCColumnDef*       columnByIdx(Adesk::Int16 index);
  const AcmCColumnDef* columnByIdx(Adesk::Int16 index) const;

  AcmCColumnDef*       columnByType(Acm::ColType type);
  const AcmCColumnDef* columnByType(Acm::ColType type) const;

  Acad::ErrorStatus getPrnLines(Acm::LineTypes& border,  Acm::LineTypes&  title,
                               Acm::LineTypes& heading, Acm::LineTypes&  item,
                               Acm::LineTypes& vertical) const;                              
  
  Acad::ErrorStatus setPrnLines(Acm::LineTypes border,  Acm::LineTypes  title,
                               Acm::LineTypes heading, Acm::LineTypes  item,
                               Acm::LineTypes vertical);                              
  
  Acad::ErrorStatus getPrnPageProp(Adesk::Boolean& titleUsed,
                                   CString& titleText,
                                   Adesk::Boolean& centered) const;

  Acad::ErrorStatus setPrnPageProp(Adesk::Boolean titleUsed,
                                   LPCTSTR titleText,
                                   Adesk::Boolean centered);

  Adesk::Boolean isPrnHeaderUsed() const;
  void setPrnIsHeaderUsed(Adesk::Boolean isUsed);
  
  Acad::ErrorStatus getPrnHeights(Adesk::Int16& title,
                                  Adesk::Int16& heading,
                                  Adesk::Int16& item) const;

  Acad::ErrorStatus setPrnHeights(Adesk::Int16 title,
                                  Adesk::Int16 heading,
                                  Adesk::Int16 item);

  Acad::ErrorStatus getPrnTitleFont(CString& fntName,
                                    Adesk::Int16& height,
                                    Adesk::Boolean& isBold,
                                    Adesk::Boolean& isItalic) const;

  Acad::ErrorStatus setPrnTitleFont(LPCTSTR fntName,
                                    Adesk::Int16 height,
                                    Adesk::Boolean isBold,
                                    Adesk::Boolean isItalic);

  Acad::ErrorStatus getPrnHeadingFont(CString& fntName,
                                      Adesk::Int16& height,
                                      Adesk::Boolean& isBold,
                                      Adesk::Boolean& isItalic) const;

  Acad::ErrorStatus setPrnHeadingFont(LPCTSTR fntName,
                                      Adesk::Int16 height,
                                      Adesk::Boolean isBold,
                                      Adesk::Boolean isItalic);

  Acad::ErrorStatus getPrnItemFont(CString& fntName,
                                   Adesk::Int16& height,
                                   Adesk::Boolean& isBold,
                                   Adesk::Boolean& isItalic) const;

  Acad::ErrorStatus setPrnItemFont(LPCTSTR fntName,
                                   Adesk::Int16 height,
                                   Adesk::Boolean isBold,
                                   Adesk::Boolean isItalic);

  Acad::ErrorStatus getPrnMargins(Adesk::Int32& bottom,
                                  Adesk::Int32& left,
                                  Adesk::Int32& right,
                                  Adesk::Int32& top) const;

  Acad::ErrorStatus setPrnMargins(Adesk::Int32 bottom,
                                  Adesk::Int32 left,
                                  Adesk::Int32 right,
                                  Adesk::Int32 top);

  virtual Adesk::Boolean setPrnFactoryDefaults();

  // don't remove, is needed by COM API !!
  virtual Adesk::Boolean isBomEquivalents(const CMapStringToString& equiMap,
                                          CMapStringToString& attMap) const;

  AcmCPartListStd* partListServer() const;
  AcmCBalloonStd*  balloonServer() const;

  virtual Acm::ErrorStatus cInit();
  virtual Adesk::Boolean setFactoryDefaults();
  virtual Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const;

  virtual Adesk::Boolean getTreeItems(AcmCObjPtrArray<CSymStdTreeItemDesc>& descArray) const;

  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 Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
  virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;

  //PRID 400298
  void setCurrentBomName(CString& bomName);
  void getCurrentBomName(CString& bomName);

  // get translated language
  CString getTrnLanguage() const;

  // get the available UOM
  virtual void getUOMName(Acm::UOMType type, CString& uom) const;

  // get/set the default BOM representation
  virtual void getDefaultBOMView(Acm::BOMType& type, CString& separator, bool& useAssyPath) const;
  virtual void setDefaultBOMView(const Acm::BOMType& type, LPCTSTR separator, bool useAssyPath);

  // get/set component properties list
  virtual void setPropColumnList(const AcDbIntArray& list);
  virtual void getPropColumnList(AcDbIntArray& list) const;

protected:
  AcmBOMStd();
  virtual Acm::ErrorStatus onChangeUnits(Adesk::Boolean isMetric);

  void setPartListServer(AcmCPartListStd* pStd);
  void setBalloonServer(AcmCBalloonStd* pStd);

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

private:
  AcmBOMStdImp* mpImp;
};                      
MAKE_ACDBOPENOBJECT_FUNCTION(AcmBOMStd);
DBREF_DECLARE(AcmBOMStd);

class DllImpExp AcmCColumnDef
{
public:
  enum DataSource {
    kAll = 0,
    kBOM,
    kPartList
  };

public:
  virtual ~AcmCColumnDef();

  virtual LPCTSTR name() const = 0;
  virtual CString localName() const = 0;
  virtual void  setName(LPCTSTR str) = 0;

  virtual LPCTSTR caption() const = 0;
  virtual void setCaption(LPCTSTR caption) = 0;
  virtual void createCaption(LPCTSTR translCaption) = 0;

  virtual Acm::ColType type() const = 0;
  virtual void setType(Acm::ColType type) = 0;


  virtual Acm::AlignmentType captionAlign(AcmCColumnDef::DataSource enSrc = AcmCColumnDef::kBOM) const = 0;
  virtual void setCaptionAlign(Acm::AlignmentType type, AcmCColumnDef::DataSource enSrc = AcmCColumnDef::kAll) = 0;  

  virtual Acm::AlignmentType dataAlign(AcmCColumnDef::DataSource enSrc = AcmCColumnDef::kBOM) const = 0;
  virtual void  setDataAlign(Acm::AlignmentType type, AcmCColumnDef::DataSource enSrc = AcmCColumnDef::kAll) = 0;

  virtual Adesk::Int16 index() const = 0;

  virtual Acm::DataType dataType() const = 0;
  virtual void  setDataType(Acm::DataType type) = 0; 

  virtual Adesk::Int16 precision() const = 0;
  virtual void setPrecision(Adesk::Int16 val) = 0;

  virtual Adesk::Int16 size() const = 0;
  virtual void setSize(Adesk::Int16 size) = 0;

  virtual double width() const = 0;
  virtual void setWidth(double width) = 0;

  // don't remove, is needed by COM API !!
  virtual Acad::ErrorStatus getEquivalents(CStringList& list) const = 0;
  virtual void setEquivalents(const CStringList& list) = 0;

  virtual bool isVisible() const = 0;
  virtual void setVisible(bool visible) = 0;

  virtual bool isSummed() const = 0;
  virtual void setIsSummed(bool isSummed) = 0;

  virtual LPCTSTR data() const = 0;
  virtual void setData(LPCTSTR data) = 0;

  virtual bool isLocked() const = 0;
  virtual void setIsLocked(bool isLocked) = 0;

  virtual void applyFormatting(CString &value) const {};  // added by DPT 8/14/02 for bug 408793

  virtual Adesk::Int16 leadingZeros() const = 0;       //for bug 402395  

  virtual LPCTSTR displayPrompt() const = 0;
  virtual void setDisplayPrompt(LPCTSTR prompt) = 0;

  virtual bool isPredDefList () const = 0;

  virtual bool isValidPreDefinedListValue(const ACHAR *value) const = 0;

  virtual void getPreDefinedList(
    std::vector< std::pair<const ACHAR *,const ACHAR * >> &preDefList,
    ACHAR * &default) const = 0;

  virtual Acm::ErrorStatus setPreDefinedList(
    const std::vector< std::pair<const ACHAR *,const ACHAR * >> &preDefList,
    const ACHAR * default = NULL) = 0;

  virtual void removePreDefinedList() = 0;

};

inline 
AcmCColumnDef::~AcmCColumnDef()
{}

class DllImpExp AcmCBalloon : public AcmCSubSymbol
{
public:
  virtual AcDbObjectIdArray rowIds() const = 0;
  virtual void getRowIds(AcDbObjectIdArray& rowIds) const = 0;
  virtual void setRowIds(const AcDbObjectIdArray& rowIds) = 0;

  virtual Acm::BalloonType type() const = 0;
  virtual void setType(const Acm::BalloonType type) = 0;

  virtual Acm::BalloonCollectionType collectionType() const = 0;
  virtual void setCollectionType(const Acm::BalloonCollectionType bct) = 0;

  virtual Acm::Direction leaderDirection() const = 0;

  //Custom Block interface
  virtual bool setUserType(LPCTSTR blkName) = 0;
  virtual bool setUserTypeId(const AcDbObjectId& btrId) = 0;
  virtual LPCTSTR userType() const = 0;
  virtual AcDbObjectId userTypeId() const = 0;

  virtual Acm::BalloonAttachType attachType() const = 0;
  virtual void setAttachType(Acm::BalloonAttachType type) = 0;
};

class DllImpExp AcmCBalloonService
{
public:
  virtual ~AcmCBalloonService();

  virtual void setColumnList(const AcDbIntArray& lst) = 0;
  virtual void getColumnList(AcDbIntArray& lst) const = 0;
  virtual Adesk::Boolean removeColumnByIdx(Adesk::Int16 idx) = 0;

  virtual Acm::BalloonType type() const = 0;
  virtual Adesk::Int16 maxNumber() const = 0;
  virtual void getDesc(AcmCSymbolDesc& pHan, bool useSmallBitmap = false) const = 0;
  virtual double radius(AcmBalloon* , const AcGeVector3d& direction) const = 0;
  virtual void recalcPoint(const AcmCBalloon* pSubSym,
                           const AcGePoint3d& ptLea,
                           AcGePoint3d& ptEnd) const = 0;
  virtual void getSubEnts(const AcmCBalloon* pData,
                          AcmCAuxEntArray& subEnts) const;
  virtual void getSubEntsSingle(const AcmCBalloon* pData,
                                AcmCAuxEntArray& subEnts, 
                                int index = 0) const = 0;
  virtual Adesk::Boolean setFactoryDefaults() = 0;

  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer, Adesk::UInt16 ver) = 0;
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const = 0;
  virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer) = 0;
  virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const = 0;

  // horizontal distance
  virtual double horizDistance() const = 0;
  virtual void setHorizDistance(double horDist) = 0;
  // vertical distance
  virtual double vertDistance() const = 0;
  virtual void setVertDistance(double verDist) = 0;

  virtual LPCTSTR pattern() const = 0;
  virtual void setPattern(LPCTSTR pattern) = 0;
};

inline 
AcmCBalloonService::~AcmCBalloonService()
{}

class DllImpExp AcmCBalloonStd
{
  friend class AcmSymbbInternals;
public:
  AcmCBalloonStd(AcmBOMStd *std);
  virtual ~AcmCBalloonStd();

  AcmBOMStd* getBOMStandard() const;

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

  virtual Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const;
  virtual Acm::ErrorStatus cInit();
  virtual Adesk::Boolean setFactoryDefaults();
  virtual Adesk::Boolean getDesc(AcmCObjArray<AcmCSymbolDesc>& list, bool useSmallBitmap = false) const;
  virtual Adesk::Boolean getBalloonArrowDesc(AcmCObjArray<AcmCArrowDesc>& list,
                                               Adesk::Boolean allSrv=Adesk::kFalse) const;
  Acm::ArrowType arrow() const;
  void setArrow(Acm::ArrowType type);

  bool arrowByStandard() const;
  void setArrowByStandard(bool byStandard);
  
  Acm::ArrowType auxArrow() const;
  void setAuxArrow(Acm::ArrowType type);

  bool auxArrowByStandard() const;
  void setAuxArrowByStandard(bool byStandard);

  void setAuxUsing(bool use);
  bool isAuxUsed() const;

  Acm::BalloonType defaultBalloonType() const;
  void setDefaultBalloonType(Acm::BalloonType type);

  Adesk::UInt16 color() const;
  void setColor(Adesk::UInt16 color);
  
  const AcCmColor & trueColor() const;
  void setTrueColor(const AcCmColor & color);

  bool colorByStandard() const;
  void setColorByStandard(bool byStandard);
  const AcCmColor & byStdTextTrueColor() const;

  double textHeight() const;
  void setTextHeight(double height);

  bool textHeightByStandard() const;
  void setTextHeightByStandard(bool byStandard);
  double byStdTextHeight() const;

  // size factor
  double sizeFactor() const;
  void setSizeFactor(double sizeFactor);
  // horizontal distance
  double horizDistance() const;
  void setHorizDistance(double horDist);
  // vertical distance
  double vertDistance() const;
  void setVertDistance(double verDist);

  double arrowInset() const;
  void setArrowInset(double inset);

  LPCTSTR pattern() const;
  void setPattern(LPCTSTR pattern);
  LPCTSTR pattern2() const;
  void setPattern2(LPCTSTR pattern);

  Adesk::Boolean registerService(AcmCBalloonService* pNewServ);
  AcmCBalloonService* getService(Acm::BalloonType type) const;

  AcmCBalloonService* serviceAt(Adesk::UInt32 at) const;
  Adesk::UInt32 numOfServices() const;

  Adesk::Boolean removeService(Acm::BalloonType type);
  Adesk::Boolean removeServiceAt(Adesk::UInt32 at);

  virtual void getSubEnts(const AcmCBalloon* pSymb,
                          AcmCAuxEntArray& subents) const;

  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;

  //Custom Block interface
  virtual bool setUserType(LPCTSTR blkName);
  virtual bool setUserTypeId(const AcDbObjectId& btrId);
  virtual LPCTSTR userType() const;
  virtual AcDbObjectId userTypeId() const;

  virtual Acm::BalloonAttachType attachType() const;
  virtual void setAttachType(Acm::BalloonAttachType type);
	
  virtual Acm::BalloonCollectionType collectionType() const; 

protected:

  virtual Acm::ErrorStatus onChangeUnits(Adesk::Boolean isMetric);

private:
  AcmBOMStd* mpOwner;
  AcmCBalloonStdImp *mpImp;
};

class DllImpExp AcmCPartListStd
{
  friend class AcmSymbbInternals;
public:

  enum AttachmentPoint {
    kTopLeft = 0,
    kBottomLeft,
    kBottomRight,
    kTopRight
  };

  enum TextType {
    kAll = 0,
    kHeading,
    kData
  };

  enum MarginType {
    kTop = 0,
    kLeft,
    kBottom,
    kRight
  };

  enum ColumnSplitWrap {
    kSplitLeft = 0,
    kSplitRight
  };

  enum ColumnSplitStyle {
    kSplitRows = 0,
    kSplitSections
  };

  enum TextControl {
    kNone = 0,
    kFit,
    kWrap
  };

  AcmCPartListStd(AcmBOMStd *std, bool bCreateImpl = true);
  virtual ~AcmCPartListStd();

  AcmBOMStd* getBOMStandard() const;

  virtual void getSubEnts(const AcmCPartList* pSymb,
                          AcmCAuxEntArray& subents) const;
  virtual void initToEdit();
  virtual void initToEditOriginal();
  virtual Adesk::Boolean edit(CWnd* parentWindow = NULL, bool bSettingsOnly = false);

  virtual Acm::ErrorStatus cInit();
  virtual Adesk::Boolean setFactoryDefaults();

  virtual Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const;
  virtual Acm::ErrorStatus checkVisibility(AcmCPartList* pData) const;
  virtual Acm::ErrorStatus initFields(AcmCPartList* pData) const;
  virtual Acm::ErrorStatus setSuggested(AcmCPartList* pData) const;  

  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;
  
  double                   headingHeight() const;
  double                   rowHeight() const;
  double                   realRowTextHeight() const;

  bool                     isHeadingEnabled() const;
  void                     setIsHeadingEnabled(bool isUse);
  AttachmentPoint          attachPoint() const;
  void                     setAttachPoint(AttachmentPoint aPoint);

  bool                     attachPointByStandard() const;
  void                     setAttachPointByStandard(bool byStandard);

  bool                     isGripFrameEnabled() const;
  void                     setIsGripFrameEnabled(bool isUse);

  Acm::PartListMultipleRow multipleRow() const;
  void                     setMultipleRow(Acm::PartListMultipleRow multiple);

  Adesk::UInt16            headTextColor() const;
  void                     setHeadTextColor(Adesk::UInt16 color);  
  const AcCmColor&         headTextTrueColor() const;
  void                     setHeadTextTrueColor(const AcCmColor & col);

  bool                     headTextColorByStandard() const;
  void                     setHeadTextColorByStandard(bool byStandard);

  double                   headTextHeight() const;
  void                     setHeadTextHeight(double height);

  bool                     headTextHeightByStandard() const;
  void                     setHeadTextHeightByStandard(bool byStandard);

  int                      overFlow(TextType enText = kData) const;
  void                     setOverFlow(int overflow, TextType enText = kAll);

  int                      textInOneLine(TextType enText = kData) const;
  void                     setTextInOneLine(const int textiol, TextType enText = kAll);

  TextControl              textControl(TextType enText) const;
  void                     setTextControl(TextControl enControl, TextType enText);

  Adesk::UInt16            frameColor() const;
  void                     setFrameColor(Adesk::UInt16 color);
  const AcCmColor&         frameTrueColor() const;
  void                     setFrameTrueColor(const AcCmColor & color);

  void                     setColumnList(const AcDbIntArray& list);
  void                     getColumnList(AcDbIntArray& list) const;
  Adesk::Boolean           removeColumnByIdx(Adesk::Int16 idx);

  double                   headingGap() const;
  double                   rowGap() const;
  void                     setHeadingGap(double hGap, bool bUpdateMargin = true);
  void                     setRowGap(double rGap, bool bUpdateMargin = true);
  double                   textMargin(TextType enText, MarginType enMargin) const;
  void                     setTextMargin(double nMargin, TextType enText, MarginType enMargin, bool bUpdateGap = false);

  int                      title() const;
  void                     setTitle(int title);
  // text height
  double                   dataTextHeight() const;
  void                     setDataTextHeight(double height);

  bool                     dataTextHeightByStandard() const;
  void                     setDataTextHeightByStandard(bool byStandard);

  // text style  
  AcDbObjectId             textStyleId(TextType enText = kData) const;
  void                     setTextStyleId(AcDbObjectId& textId, TextType enText = kAll);
  // text style by standard
  bool                     textStyleByStandard(TextType enText = kData) const;
  void                     setTextStyleByStandard(bool byStandard, TextType enText = kAll);

  // data text color  
  Adesk::UInt16            dataTextColor() const;
  void                     setDataTextColor(Adesk::UInt16 color);  
  const AcCmColor&         dataTextTrueColor() const;
  void                     setDataTextTrueColor(const AcCmColor & color);

  bool                     dataTextColorByStandard() const;
  void                     setDataTextColorByStandard(bool byStandard);

  AcDb::LineWeight         verticalLineWeight(const AcDbObjectId& layerId) const;  
  
  bool                     isBoldVerticalLine() const;
  void                     setIsBoldVerticalLine(bool isBold);

  bool setCustomBlock(LPCTSTR blName);
  LPCTSTR customBlock() const;
  void setFilterEmpty(bool useFilter);
  bool filterEmpty() const;
  bool isDSK() const;
  void setDSK(bool use);
  Acad::ErrorStatus getBlocksIds(AcDbObjectIdArray& blocksIds) const;

  double partListWidth() const;

  bool             isColumnSplitEnable() const;
  void             setColumnSplitEnable(bool bEnable);

  ColumnSplitWrap  columnSplitWrap() const;
  void             setColumnSplitWrap(ColumnSplitWrap enWrap);

  ColumnSplitStyle columnSplitStyle() const;
  void             setColumnSplitStyle(ColumnSplitStyle enStyle);

  int              columnSplitRows() const;
  void             setColumnSplitRows(int nRows);

  int              columnSplitSections() const;
  void             setColumnSplitSections(int nSections);

  // split wrap around title block
  bool             isColumnSplitWrapAroundTitle() const;
  void             setColumnSplitWrapAroundTitle(bool bEnable);

protected:
  virtual Acm::ErrorStatus onChangeUnits(Adesk::Boolean isMetric);
  void getSubEntsHeading(const AcmCPartList* pSymb, AcmCAuxEntArray& subents) const;
  void getSubEntsRow(const CStringArray& dataAr,
                     const AcmCPartList* pSymb,
                     Adesk::Boolean forData,
                     AcmCAuxEntArray& subents,
                     int row) const; //PL-peck
  void getSubEntsBlock(const AcmCPartList*, AcmCAuxEntArray&) const; 


  AcmBOMStd* mpOwner;
  AcmCPartListStdImp *mpImp;
};


class DllImpExp AcmCPartList : public AcmCSubSymbol
{
public:
  virtual AcDbObjectId bomId() const = 0;
  virtual void setBomId(const AcDbObjectId& bomId) = 0;

  virtual bool isHeadingEnabled() const = 0;
  virtual void setIsHeadingEnabled(bool isUse) = 0;
  virtual bool isGripFrameEnabled() const = 0;
  virtual void setIsGripFrameEnabled(bool isUse) = 0;
  virtual bool isResultBarEnabled() const = 0;
  virtual void setIsResultBarEnabled(bool isUse) = 0;
  virtual bool isFormulaBarEnabled() const = 0;
  virtual void setIsFormulaBarEnabled(bool isUse) = 0;
  virtual AcmCPartListStd::AttachmentPoint attachPoint() const = 0;
  virtual Acm::ErrorStatus setAttachPoint(AcmCPartListStd::AttachmentPoint aPoint) = 0;
  virtual double width() const = 0;
  virtual void setWidth(double width) = 0;
  virtual double height() const = 0;
  virtual void setHeight(double height) = 0;

  virtual int title() const = 0;
  virtual void setTitle(const int title) = 0;

  virtual LPCTSTR titleText() const = 0;
  virtual void setTitleText(const LPCTSTR titleText) = 0;
  
  virtual int overFlow(AcmCPartListStd::TextType enText = AcmCPartListStd::kData) const = 0;
  virtual void setOverFlow(const int overflow, AcmCPartListStd::TextType enText = AcmCPartListStd::kAll) = 0; 

  virtual int textInOneLine(AcmCPartListStd::TextType enText = AcmCPartListStd::kData) const = 0;
  virtual void setTextInOneLine(const int textiol, AcmCPartListStd::TextType enText = AcmCPartListStd::kAll) = 0;

  virtual AcmCPartListStd::TextControl textControl(AcmCPartListStd::TextType enText) const = 0;
  virtual void setTextControl(AcmCPartListStd::TextControl enControl, AcmCPartListStd::TextType enText) = 0;

  virtual Acm::PartListMultipleRow multipleRow() const = 0;
  virtual void setMultipleRow(const Acm::PartListMultipleRow multiple) = 0;

  virtual Adesk::Int32 minItem() const = 0;
  virtual Acm::ErrorStatus setMinItem(const Adesk::Int32 min) = 0;
  virtual Adesk::Int32 maxItem() const = 0;
  virtual Acm::ErrorStatus setMaxItem(const Adesk::Int32 max) = 0;

  virtual Acm::ErrorStatus getItemList(AcDbObjectIdArray& items) const = 0;
  virtual Acm::ErrorStatus setItemList(const AcDbObjectIdArray& items) = 0;

  virtual Acm::ErrorStatus getViewId(AcDbObjectId& viewId) const = 0;
  virtual Acm::ErrorStatus setViewId(const AcDbObjectId& viewId) = 0;

  virtual void setColumnList(const AcDbIntArray& list) = 0;
  virtual void getColumnList(AcDbIntArray& list) const = 0;

  //Custom Block interface
  //This function is attempting to find available blocks with block names
  //if use parameter is seted to true.
  virtual bool getCustomBlockIds(AcDbObjectIdArray&) const = 0;
  virtual bool setCustomBlock(LPCTSTR blName) = 0;
  virtual LPCTSTR customBlock() const = 0;
  virtual void setFilterEmpty(bool useFilter) = 0;
  virtual bool filterEmpty() const = 0;
  virtual bool setDSKName(LPCTSTR blName) = 0;
  virtual LPCTSTR dskName() const = 0;

  //Filter interface
  //If function  returned Acad::eOk, then filter object was added to the database and closed.
  //Its Id is returned in parameter.
  virtual Acad::ErrorStatus addFilter(AmdtItemFilter*, AcDbObjectId&) = 0;
  virtual Acad::ErrorStatus addFilter(Acm::FilterType enType, AcDbObjectId& oId) = 0;
  //Gets filters id for partlist
  virtual bool getFilterIds(AcDbObjectIdArray&) const = 0;
  //Remove and/or erase filter 
  virtual Acad::ErrorStatus removeFilter(const AcDbObjectId&, bool erase = true) = 0;

  virtual Acm::ErrorStatus getValue(LPCTSTR valueName, CString& value) const = 0;
  virtual Acm::ErrorStatus setValue(LPCTSTR valueName, LPCTSTR value) = 0;

  virtual bool isColumnSplitEnable() const = 0;
  virtual void setColumnSplitEnable(bool bEnable) = 0;

  virtual AcmCPartListStd::ColumnSplitWrap  columnSplitWrap() const = 0;
  virtual void                              setColumnSplitWrap(AcmCPartListStd::ColumnSplitWrap enWrap) = 0;

  virtual AcmCPartListStd::ColumnSplitStyle columnSplitStyle() const = 0;
  virtual void                              setColumnSplitStyle(AcmCPartListStd::ColumnSplitStyle enStyle) = 0;

  virtual int  columnSplitRows() const = 0;
  virtual void setColumnSplitRows(int nRows) = 0;

  virtual int  columnSplitSections() const = 0;
  virtual void setColumnSplitSections(int nSections) = 0;

  // split wrap around title block
  virtual bool isColumnSplitWrapAroundTitle() const = 0;
  virtual void setColumnSplitWrapAroundTitle(bool bWrapTitle) = 0;

  // get(set) title id which is associated with partlist 
  virtual AcDbObjectId getTitleId() const = 0;
  virtual void setTitleId(const AcDbObjectId& titleId)  = 0;

  // get(set) title height which is associated with partlist
  virtual double getTitleHeight() const  = 0;
  virtual void setTitleHeight(const double& dHeight)  = 0;

  //set partlist attach point if it's split wrap around title
  virtual Acm::ErrorStatus setWrapPListAttachPoint() = 0;

};




#endif // __BOMSTD_H
