acappvar.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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. // DESCRIPTION: Header for Application/Session Variables Class
  13. // for variables in pre Tahoe versions stored in the
  14. // database header.
  15. //
  16. #ifndef ACAPPVAR_H
  17. #define ACAPPVAR_H
  18. #include "acdb.h"
  19. #pragma pack (push, 8)
  20. enum {
  21. kGroupsOn = 0x01,
  22. kHatchAssocOn = 0x02
  23. };
  24. class AcDbAppSystemVariables {
  25. public:
  26. inline AcDbAppSystemVariables();
  27. inline ~AcDbAppSystemVariables() {};
  28. // ATTDIA
  29. Acad::ErrorStatus setAttdia(bool value, bool bUndo = false);
  30. inline bool attdia() const;
  31. // ATTREQ
  32. Acad::ErrorStatus setAttreq(bool, bool bUndo = false);
  33. inline bool attreq() const;
  34. // BLIPMODE
  35. Acad::ErrorStatus setBlipmode(bool, bool bUndo = false);
  36. inline bool blipmode() const;
  37. // COORDS
  38. Acad::ErrorStatus setCoords(Adesk::Int16 value, bool bUndo = false);
  39. inline Adesk::Int16 coords() const;
  40. // STATUSBAR
  41. Acad::ErrorStatus setStatusbar(Adesk::Int16 value, bool bUndo = false);
  42. inline Adesk::Int16 statusbar() const;
  43. // MENUBAR
  44. Acad::ErrorStatus setMenubar(bool value, bool bUndo = false);
  45. inline bool menubar() const;
  46. // APPSTATUSBARUSEICONS
  47. Acad::ErrorStatus setAppStatusBarUseIcons(bool value, bool bUndo = false);
  48. inline bool appstatusbaruseicons() const;
  49. // DELOBJ
  50. Acad::ErrorStatus setDelUsedObj(Adesk::Int16, bool bUndo = false);
  51. inline Adesk::Int16 delUsedObj() const;
  52. // DRAGMODE
  53. Acad::ErrorStatus setDragmode(Adesk::Int16, bool bUndo = false);
  54. inline Adesk::Int16 dragmode() const;
  55. // OSMODE
  56. Acad::ErrorStatus setOsmode(Adesk::Int16 value, bool bUndo = false);
  57. inline Adesk::Int16 osmode() const;
  58. // PICKSTYLE
  59. Acad::ErrorStatus setPickstyle(Adesk::Int16 value, bool bUndo = false);
  60. inline Adesk::Int16 pickstyle() const;
  61. // LWDEFAULT
  62. Acad::ErrorStatus setLwdefault(AcDb::LineWeight value, bool bUndo = false);
  63. inline AcDb::LineWeight lwdefault() const;
  64. // HPASSOC
  65. Acad::ErrorStatus setHpassoc(bool value, bool bUndo = false);
  66. inline bool hpassoc() const;
  67. private:
  68. bool m_attdia; // ATTDIA
  69. bool m_attreq; // ATTREQ
  70. bool m_blipmode; // BLIPMODE
  71. short m_delobj; // DELOBJS
  72. short m_coords; // COORDS
  73. short m_statusbar; // STATUSBAR
  74. bool m_menubar; // MENUBAR
  75. bool m_appstatusbaruseicons; // APPSTATUSBARUSEICONS
  76. short m_dragmode; // DRAGMODE
  77. short m_osmode; // OSMODE
  78. short m_pkstyle; // PICKSTYLE
  79. AcDb::LineWeight m_lwdefault; // LWDEFAULT
  80. bool m_hpassoc; // HPASSOC
  81. };
  82. inline
  83. AcDbAppSystemVariables::AcDbAppSystemVariables()
  84. : m_attdia(true),
  85. m_attreq(true),
  86. m_blipmode(false),
  87. m_delobj(3),
  88. m_coords(0),
  89. m_statusbar(1),
  90. m_menubar(false),
  91. m_appstatusbaruseicons(true),
  92. m_dragmode(2),
  93. m_osmode(0),
  94. m_pkstyle(kGroupsOn),
  95. m_lwdefault(AcDb::kLnWt025),
  96. m_hpassoc(1)
  97. {
  98. }
  99. // ATTDIA
  100. inline bool AcDbAppSystemVariables::attdia() const
  101. {
  102. return m_attdia;
  103. }
  104. // ATTREQ
  105. inline bool AcDbAppSystemVariables::attreq() const
  106. {
  107. return m_attreq;
  108. }
  109. // BLIPMODE
  110. inline bool AcDbAppSystemVariables::blipmode() const
  111. {
  112. return m_blipmode;
  113. }
  114. // COORDS
  115. inline Adesk::Int16 AcDbAppSystemVariables::coords() const
  116. {
  117. return m_coords;
  118. }
  119. // STATUSBAR
  120. inline Adesk::Int16 AcDbAppSystemVariables::statusbar() const
  121. {
  122. return m_statusbar;
  123. }
  124. // MENUBAR
  125. inline bool AcDbAppSystemVariables::menubar() const
  126. {
  127. return m_menubar;
  128. }
  129. // APPSTATUSBARUSEICONS
  130. inline bool AcDbAppSystemVariables::appstatusbaruseicons() const
  131. {
  132. return m_appstatusbaruseicons;
  133. }
  134. // DELOBJS
  135. inline Adesk::Int16 AcDbAppSystemVariables::delUsedObj() const
  136. {
  137. return m_delobj;
  138. }
  139. // DRAGMODE
  140. inline Adesk::Int16 AcDbAppSystemVariables::dragmode() const
  141. {
  142. return m_dragmode;
  143. }
  144. // OSMODE
  145. inline Adesk::Int16 AcDbAppSystemVariables::osmode() const
  146. {
  147. return m_osmode;
  148. }
  149. // PICKSTYLE
  150. inline Adesk::Int16 AcDbAppSystemVariables::pickstyle() const
  151. {
  152. return m_pkstyle;
  153. }
  154. // LWDEFAULT
  155. inline AcDb::LineWeight AcDbAppSystemVariables::lwdefault() const
  156. {
  157. return m_lwdefault;
  158. }
  159. // HPASSOC
  160. inline bool AcDbAppSystemVariables::hpassoc() const
  161. {
  162. return m_hpassoc;
  163. }
  164. #pragma pack (pop)
  165. #endif // ACAPPSVAR_H