dbTableStyle.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // dbTableStyle.h
  12. //
  13. // DESCRIPTION: AcDbTableStyle API class declaration
  14. //
  15. // AcRxObject
  16. // AcDbObject
  17. // AcDbTableStyle
  18. //
  19. #ifndef __DBTABLESTYLE_H__
  20. #define __DBTABLESTYLE_H__
  21. #pragma once
  22. #include "dbmain.h"
  23. #include "AdAChar.h"
  24. #include "AcValue.h"
  25. #include "AcString.h"
  26. #include "DbFormattedTableData.h"
  27. #pragma pack (push, 8)
  28. class AcDbTableTemplate;
  29. class AcDbTableStyle : public AcDbObject
  30. {
  31. public:
  32. ACDB_DECLARE_MEMBERS(AcDbTableStyle);
  33. AcDbTableStyle();
  34. virtual ~AcDbTableStyle();
  35. // AcDbTableStyle protocol
  36. //
  37. // General Properties
  38. //
  39. virtual Acad::ErrorStatus getName(ACHAR*& pszName) const;
  40. virtual Acad::ErrorStatus setName(const ACHAR * pszName);
  41. bool isRenamable() const;
  42. virtual const ACHAR* description(void) const;
  43. virtual Acad::ErrorStatus setDescription(const ACHAR * pszDescription);
  44. virtual Adesk::UInt32 bitFlags() const;
  45. virtual Acad::ErrorStatus setBitFlags(Adesk::UInt32 flags);
  46. virtual AcDb::FlowDirection flowDirection(void) const;
  47. virtual Acad::ErrorStatus setFlowDirection(AcDb::FlowDirection flow);
  48. // Use margin(AcDb::CellMargin nMargin, const ACHAR* pszCellStyle)
  49. ADESK_DEPRECATED virtual double horzCellMargin(void) const;
  50. // Use setMargin(AcDb::CellMargin nMargins, double fMargin, const ACHAR* pszCellStyle)
  51. ADESK_DEPRECATED virtual Acad::ErrorStatus setHorzCellMargin(double dCellMargin);
  52. // Use margin(AcDb::CellMargin nMargin, const ACHAR* pszCellStyle)
  53. ADESK_DEPRECATED virtual double vertCellMargin(void) const;
  54. // Use setMargin(AcDb::CellMargin nMargins, double fMargin, const ACHAR* pszCellStyle)
  55. ADESK_DEPRECATED virtual Acad::ErrorStatus setVertCellMargin(double dCellMargin);
  56. ADESK_DEPRECATED virtual bool isTitleSuppressed(void) const;
  57. ADESK_DEPRECATED virtual Acad::ErrorStatus suppressTitleRow(bool bValue);
  58. ADESK_DEPRECATED virtual bool isHeaderSuppressed(void) const;
  59. ADESK_DEPRECATED virtual Acad::ErrorStatus suppressHeaderRow(bool bValue);
  60. // Cell properties
  61. //
  62. virtual AcDbObjectId textStyle(AcDb::RowType rowType = AcDb::kDataRow) const;
  63. virtual Acad::ErrorStatus setTextStyle(const AcDbObjectId id,
  64. int rowTypes = AcDb::kAllRows);
  65. virtual double textHeight(AcDb::RowType rowType = AcDb::kDataRow) const;
  66. virtual Acad::ErrorStatus setTextHeight(double dHeight,
  67. int rowTypes = AcDb::kAllRows);
  68. virtual AcDb::CellAlignment alignment(AcDb::RowType rowType = AcDb::kDataRow) const;
  69. virtual Acad::ErrorStatus setAlignment(AcDb::CellAlignment alignment,
  70. int rowTypes = AcDb::kAllRows);
  71. virtual AcCmColor color(AcDb::RowType rowType = AcDb::kDataRow) const;
  72. virtual Acad::ErrorStatus setColor(const AcCmColor& color,
  73. int rowTypes = AcDb::kAllRows);
  74. virtual AcCmColor backgroundColor(AcDb::RowType rowType = AcDb::kDataRow) const;
  75. virtual Acad::ErrorStatus setBackgroundColor(const AcCmColor& color,
  76. int rowTypes = AcDb::kAllRows);
  77. ADESK_DEPRECATED virtual bool isBackgroundColorNone(AcDb::RowType rowType = AcDb::kDataRow) const;
  78. ADESK_DEPRECATED virtual Acad::ErrorStatus setBackgroundColorNone(bool bValue,
  79. int rowTypes = AcDb::kAllRows);
  80. virtual Acad::ErrorStatus getDataType(AcValue::DataType& nDataType,
  81. AcValue::UnitType& nUnitType) const;
  82. // For internal use only
  83. ADESK_DEPRECATED virtual Acad::ErrorStatus getDataType(AcValue::DataType& nDataType,
  84. AcValue::UnitType& nUnitType,
  85. AcDb::RowType rowType) const;
  86. virtual Acad::ErrorStatus setDataType(AcValue::DataType nDataType,
  87. AcValue::UnitType nUnitType);
  88. // For internal use only
  89. ADESK_DEPRECATED virtual Acad::ErrorStatus setDataType(AcValue::DataType nDataType,
  90. AcValue::UnitType nUnitType,
  91. int rowTypes);
  92. // Use format(const ACHAR* pszCellStyle)
  93. ADESK_DEPRECATED virtual const ACHAR* format (void) const;
  94. // For internal use only
  95. ADESK_DEPRECATED virtual const ACHAR* format (AcDb::RowType rowType) const;
  96. // Use setFormat(const ACHAR* pszFormat, const ACHAR* pszCellStyle);
  97. ADESK_DEPRECATED virtual Acad::ErrorStatus setFormat(const ACHAR* pszFormat);
  98. // For internal use only
  99. ADESK_DEPRECATED virtual Acad::ErrorStatus setFormat(const ACHAR* pszFormat,
  100. int rowTypes);
  101. //Gridline properties
  102. //
  103. virtual AcDb::LineWeight gridLineWeight(AcDb::GridLineType gridLineType,
  104. AcDb::RowType rowType = AcDb::kDataRow) const;
  105. virtual Acad::ErrorStatus setGridLineWeight(AcDb::LineWeight lineWeight,
  106. int gridLineTypes = AcDb::kAllGridLines,
  107. int rowTypes = AcDb::kAllRows);
  108. virtual AcCmColor gridColor(AcDb::GridLineType gridLineType,
  109. AcDb::RowType rowType = AcDb::kDataRow) const;
  110. virtual Acad::ErrorStatus setGridColor(const AcCmColor color,
  111. int gridLineTypes = AcDb::kAllGridLines,
  112. int rowTypes = AcDb::kAllRows);
  113. virtual AcDb::Visibility gridVisibility(AcDb::GridLineType gridLineType,
  114. AcDb::RowType rowType = AcDb::kDataRow) const;
  115. virtual Acad::ErrorStatus setGridVisibility(AcDb::Visibility visible,
  116. int gridLineTypes = AcDb::kAllGridLines,
  117. int rowTypes = AcDb::kAllRows);
  118. // AcDbObject protocol
  119. //
  120. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler);
  121. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  122. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* pFiler);
  123. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  124. virtual Acad::ErrorStatus audit(AcDbAuditInfo* pAuditInfo);
  125. // Utility functions
  126. //
  127. virtual Acad::ErrorStatus postTableStyleToDb(AcDbDatabase* pDb,
  128. const ACHAR* styleName,
  129. AcDbObjectId& tableStyleId);
  130. // New functions added in Spago - these methods are not virtual so API
  131. // compatibility is maintained
  132. // Creates a cell style and assigns a unique name
  133. const ACHAR * createCellStyle (void);
  134. Acad::ErrorStatus createCellStyle (const ACHAR* pszCellStyle);
  135. Acad::ErrorStatus createCellStyle (const ACHAR* pszCellStyle,
  136. const ACHAR* pszFromCellStyle);
  137. Acad::ErrorStatus renameCellStyle (const ACHAR* pszOldName,
  138. const ACHAR* pszNewName);
  139. Acad::ErrorStatus deleteCellStyle (const ACHAR* pszCellStyle);
  140. Acad::ErrorStatus copyCellStyle (const ACHAR* pszSrcCellStyle,
  141. const ACHAR* pszTargetCellStyle);
  142. Acad::ErrorStatus copyCellStyle (const AcDbTableStyle* pSrc,
  143. const ACHAR* pszSrcCellStyle,
  144. const ACHAR* pszTargetCellStyle);
  145. Acad::ErrorStatus getUniqueCellStyleName(const ACHAR* pszBaseName,
  146. AcString& sUniqueName) const;
  147. bool isCellStyleInUse (const ACHAR* pszCellStyle) const;
  148. int numCellStyles (void) const;
  149. int getCellStyles (AcStringArray& cellstyles) const;
  150. AcDbObjectId textStyle (const ACHAR* pszCellStyle) const;
  151. Acad::ErrorStatus setTextStyle (const AcDbObjectId& id,
  152. const ACHAR* pszCellStyle);
  153. double textHeight (const ACHAR* pszCellStyle) const;
  154. Acad::ErrorStatus setTextHeight (double dHeight,
  155. const ACHAR* pszCellStyle);
  156. AcDb::CellAlignment alignment (const ACHAR* pszCellStyle) const;
  157. Acad::ErrorStatus setAlignment (AcDb::CellAlignment alignment,
  158. const ACHAR* pszCellStyle);
  159. AcCmColor color (const ACHAR* pszCellStyle) const;
  160. Acad::ErrorStatus setColor (const AcCmColor& color,
  161. const ACHAR* pszCellStyle);
  162. AcCmColor backgroundColor (const ACHAR* pszCellStyle) const;
  163. Acad::ErrorStatus setBackgroundColor (const AcCmColor& color,
  164. const ACHAR* pszCellStyle);
  165. Acad::ErrorStatus getDataType (AcValue::DataType& nDataType,
  166. AcValue::UnitType& nUnitType,
  167. const ACHAR* pszCellStyle) const;
  168. Acad::ErrorStatus setDataType (AcValue::DataType nDataType,
  169. AcValue::UnitType nUnitType,
  170. const ACHAR* pszCellStyle);
  171. const ACHAR * format (const ACHAR* pszCellStyle) const;
  172. Acad::ErrorStatus setFormat (const ACHAR* pszFormat,
  173. const ACHAR* pszCellStyle);
  174. int cellClass (const ACHAR* pszCellStyle) const;
  175. Acad::ErrorStatus setCellClass (int nClass,
  176. const ACHAR* pszCellStyle);
  177. double rotation (const ACHAR* pszCellStyle) const;
  178. Acad::ErrorStatus setRotation (double fRotation,
  179. const ACHAR* pszCellStyle);
  180. bool isMergeAllEnabled (const ACHAR* pszCellStyle) const;
  181. Acad::ErrorStatus enableMergeAll (bool bEnable,
  182. const ACHAR* pszCellStyle);
  183. double margin (AcDb::CellMargin nMargin,
  184. const ACHAR* pszCellStyle) const;
  185. Acad::ErrorStatus setMargin (AcDb::CellMargin nMargins,
  186. double fMargin,
  187. const ACHAR* pszCellStyle);
  188. //Gridline properties
  189. //
  190. AcDb::LineWeight gridLineWeight (AcDb::GridLineType gridLineType,
  191. const ACHAR* pszCellStyle) const;
  192. Acad::ErrorStatus setGridLineWeight (AcDb::LineWeight lineWeight,
  193. AcDb::GridLineType gridLineTypes,
  194. const ACHAR* pszCellStyle);
  195. AcCmColor gridColor (AcDb::GridLineType gridLineType,
  196. const ACHAR* pszCellStyle) const;
  197. Acad::ErrorStatus setGridColor (const AcCmColor color,
  198. AcDb::GridLineType gridLineTypes,
  199. const ACHAR* pszCellStyle);
  200. AcDb::Visibility gridVisibility (AcDb::GridLineType gridLineType,
  201. const ACHAR* pszCellStyle) const;
  202. Acad::ErrorStatus setGridVisibility (AcDb::Visibility visible,
  203. AcDb::GridLineType gridLineTypes,
  204. const ACHAR* pszCellStyle);
  205. double gridDoubleLineSpacing (AcDb::GridLineType gridLineType,
  206. const ACHAR* pszCellStyle) const;
  207. Acad::ErrorStatus setGridDoubleLineSpacing(double fSpacing,
  208. AcDb::GridLineType gridLineTypes,
  209. const ACHAR* pszCellStyle);
  210. AcDb::GridLineStyle gridLineStyle (AcDb::GridLineType gridLineType,
  211. const ACHAR* pszCellStyle) const;
  212. Acad::ErrorStatus setGridLineStyle (AcDb::GridLineStyle nLineStyle,
  213. AcDb::GridLineType gridLineTypes,
  214. const ACHAR* pszCellStyle);
  215. AcDbObjectId gridLinetype (AcDb::GridLineType gridLineType,
  216. const ACHAR* pszCellStyle) const;
  217. Acad::ErrorStatus setGridLinetype (const AcDbObjectId& id,
  218. AcDb::GridLineType gridLineTypes,
  219. const ACHAR* pszCellStyle);
  220. Acad::ErrorStatus getGridProperty (AcGridProperty& gridProp,
  221. AcDb::GridLineType nGridLineTypes,
  222. const ACHAR* pszCellStyle) const;
  223. Acad::ErrorStatus setGridProperty (const AcGridProperty& gridProp,
  224. AcDb::GridLineType nGridLineTypes,
  225. const ACHAR* pszCellStyle);
  226. // Template functions
  227. AcDbObjectId getTemplate (void) const;
  228. Acad::ErrorStatus getTemplate (AcDbTableTemplate*& pTemplate,
  229. AcDb::OpenMode mode);
  230. Acad::ErrorStatus setTemplate (const AcDbObjectId& templateId,
  231. AcDb::MergeCellStyleOption nOption);
  232. Acad::ErrorStatus setTemplate (AcDbTableTemplate* pTemplate,
  233. AcDb::MergeCellStyleOption nOption,
  234. AcDbObjectId& templateId);
  235. AcDbObjectId removeTemplate (void);
  236. protected:
  237. //********************************************************************
  238. // Get corresponding COM wrapper class ID
  239. //********************************************************************
  240. //
  241. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  242. };
  243. #pragma pack (pop)
  244. #endif // __DBTABLESTYLE_H__