AcFdUtil.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // Name: AcFdUtil.h
  13. //
  14. // Description: Header for global methods exported from AcFdEval
  15. // module
  16. //
  17. //////////////////////////////////////////////////////////////////////////////
  18. #pragma once
  19. #include "adesk.h"
  20. #include "AdAChar.h"
  21. #include "AcCell.h"
  22. #ifdef ACFD_API
  23. # define ACFD_PORT __declspec(dllexport)
  24. #else
  25. # define ACFD_PORT
  26. #endif
  27. // From dbeval.h
  28. typedef Adesk::UInt32 AcDbEvalNodeId;
  29. namespace AcFdEval
  30. {
  31. // Option bit flags for object property field
  32. enum ObjectFieldOption
  33. {
  34. kObjFieldNone = 0,
  35. kObjFieldUnresolvedBlockRef = (0x1 << 0),
  36. kObjFieldApplyBlockTransform = (0x1 << 1),
  37. kObjFieldUnresolvedObjectRef = (0x1 << 2),
  38. };
  39. // Option bit flags for sheet set field
  40. enum SheetSetFieldOption
  41. {
  42. kSheetSetNone = 0,
  43. kSheetSetHyperlink = (0x1 << 0),
  44. kSheetSetUnresolvedComponent = (0x1 << 1),
  45. };
  46. // Option bit flags for expression field
  47. enum ExpressionFieldOption
  48. {
  49. // Function types
  50. kExprFieldNone = 0,
  51. kExprFieldSum = (0x1 << 0),
  52. kExprFieldAverage = (0x1 << 1),
  53. kExprFieldCount = (0x1 << 2),
  54. kExprFieldCell = (0x1 << 3),
  55. kExprFieldEquation = (0x1 << 4),
  56. };
  57. };
  58. #ifndef _ADESK_MAC_
  59. interface IAcSmDatabase;
  60. interface IAcSmSheetSet;
  61. interface IAcSmComponent;
  62. #else
  63. __interface IAcSmDatabase;
  64. __interface IAcSmSheetSet;
  65. __interface IAcSmComponent;
  66. #endif
  67. struct AcHyperlink;
  68. ACFD_PORT BOOL AcFdMakeFieldCode (const AcDbObjectId& objId,
  69. AcDbEvalNodeId blockParamId,
  70. const ACHAR * pszPropOrConnectionName,
  71. AcFdEval::ObjectFieldOption nOption,
  72. const ACHAR * pszFormat,
  73. AcHyperlink* pHyperlink,
  74. ACHAR*& pszFieldCode);
  75. ACFD_PORT BOOL AcFdMakeFieldCode (IAcSmDatabase* pSmDb,
  76. IAcSmSheetSet* pSmSheetSet,
  77. IAcSmComponent* pSmComp,
  78. const ACHAR * pszCompName,
  79. const ACHAR * pszPropName,
  80. AcFdEval::SheetSetFieldOption nOption,
  81. const ACHAR * pszFormat,
  82. ACHAR*& pszFieldCode);
  83. ACFD_PORT BOOL AcFdMakeFieldCode (const AcDbObjectId& tableId,
  84. const AcDbObjectId& targetTableId,
  85. AcFdEval::ExpressionFieldOption nOption,
  86. const AcCellRangeArray& cellRanges,
  87. const ACHAR * pszFormat,
  88. AcHyperlink* pHyperlink,
  89. ACHAR*& pszFieldCode);
  90. ACFD_PORT BOOL AcFdExtractData (AcDbField* pField,
  91. ACHAR *& pszSheetSetFile,
  92. ACHAR *& pszSheetSetId,
  93. ACHAR *& pszCompName,
  94. ACHAR *& pszCompId,
  95. ACHAR *& pszPropName);
  96. ACFD_PORT BOOL AcFdExtractData (AcDbField* pField,
  97. AcDbObjectId& objId,
  98. ACHAR *& pszPropName);