dbObjContext.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. //
  2. //
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright 2015 Autodesk, Inc. All rights reserved.
  6. //
  7. // Use of this software is subject to the terms of the Autodesk license
  8. // agreement provided at the time of installation or download, or which
  9. // otherwise accompanies this software in either electronic or hard copy form.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. //
  13. #pragma once
  14. #pragma pack(push, 8)
  15. #include "dbmain.h"
  16. ////////////////////////////////////////////////////////////////////////
  17. // class AcDbObjectContext
  18. ////////////////////////////////////////////////////////////////////////
  19. /// <summary>
  20. /// Abstract base class for representing a particular context which
  21. /// may affect the properties and/or behavior of one or more types
  22. /// of objects.Classes that are derived from this base class are used
  23. /// to represent a particular type of context such as annotation scale.
  24. /// </summary>
  25. ///
  26. ///
  27. class AcDbObjectContext : public AcRxObject
  28. {
  29. public:
  30. ACRX_DECLARE_MEMBERS(AcDbObjectContext);
  31. /// <summary>
  32. /// Default constructor.
  33. /// </summary>
  34. ///
  35. AcDbObjectContext ();
  36. /// <summary>
  37. /// Destructor. Performs any necessary cleanup of the context data.
  38. /// </summary>
  39. ///
  40. virtual ~AcDbObjectContext ();
  41. /// <summary>
  42. /// The name of the object context.
  43. /// </summary>
  44. ///
  45. /// <param name="name">
  46. /// Output parameter containing the name of the object context.
  47. /// </param>
  48. ///
  49. /// <returns>
  50. /// Returns Acad::eOk if succssful.
  51. /// </returns>
  52. ///
  53. /// <remarks>
  54. /// The name of an object context may appear in user interface components
  55. /// visile to the user, and may change if the context supports renaming.
  56. /// Applications should not identify contexts by name internally but should
  57. /// use the context ID, which is guaranteed to be unique and invariant over
  58. /// time.
  59. /// </remarks>
  60. ///
  61. virtual Acad::ErrorStatus getName ( AcString& name) const = 0;
  62. /// <summary>
  63. /// Sets the name of the object context.
  64. /// </summary>
  65. ///
  66. /// <param name="name">
  67. /// New name of the object context.
  68. /// </param>
  69. ///
  70. /// <returns>
  71. /// Returns Acad::eOk if succssful, returns Acad::eNotImplemented if
  72. /// the context object does not support renaming.
  73. /// </returns>
  74. ///
  75. /// <remarks>
  76. /// Custom object contexts implement this method to support renaming
  77. /// context object instances.
  78. /// </remarks>
  79. virtual Acad::ErrorStatus setName ( const AcString& name ) = 0;
  80. /// <summary>
  81. /// The unique context identifier
  82. /// </summary>
  83. ///
  84. /// <returns>
  85. /// Returns the object context identifier.
  86. /// </returns>
  87. ///
  88. /// <remarks>
  89. /// The unique identifier should be invariant for the lifetime of this
  90. /// object and is unique amongst all instances of the context object type
  91. /// within an AcDbObjectContextCollection. If an AcDbObjectContext is not
  92. /// currently resident within a collection then the returned identifier may
  93. /// not be unique. Although this property is represented as an
  94. /// Adesk::LongPtr, it does not have to be a memory or other address and
  95. /// will not be used as a memory address by core AutoCAD.
  96. /// </remarks>
  97. ///
  98. virtual Adesk::LongPtr uniqueIdentifier () const = 0;
  99. /// <summary>
  100. /// The name of the containing collection.
  101. /// </summary>
  102. ///
  103. /// <returns>
  104. /// Returns the name of the containing collection.
  105. /// </returns>
  106. ///
  107. /// <remarks>
  108. /// Context objects should returns a non-null string even if the context
  109. /// object is not currently residing in a collection. The purpose of this
  110. /// method is to allow clients to identify the context type via a
  111. /// collection name, and to allow clients (including collection objects) to
  112. /// determine whether a context object is allowed in a collection instance.
  113. /// </remarks>
  114. ///
  115. virtual AcString collectionName () const = 0;
  116. };
  117. #pragma pack(pop)