rxmember.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766
  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. #pragma once
  12. #include "acbasedefs.h"
  13. #include "adesk.h"
  14. #include "acadstrc.h"
  15. #include "pimplapi.h"
  16. #include "AcString.h"
  17. #include "AcArray.h"
  18. #include "rxoverrule.h"
  19. class AcRxMemberImp;
  20. class AcRxMemberCollectionImp;
  21. class AcRxValue;
  22. class AcRxValueType;
  23. class AcRxAttributeCollection;
  24. class AcRxMemberIteratorImp;
  25. class AcRxMemberQueryContextImp;
  26. class AcRxMemberQueryEngineImp;
  27. class AcRxPromotingQueryContext;
  28. //*************************************************************************
  29. // AcRxMember
  30. //*************************************************************************
  31. /// <summary>
  32. /// Base class for all members. Encapsulates common member properties and
  33. /// behavior.
  34. /// </summary>
  35. ///
  36. class AcRxMember : public Pimpl::ApiPart<AcRxObject, AcRxMemberImp>
  37. {
  38. public:
  39. ACRX_DECLARE_MEMBERS_EXPIMP(AcRxMember, ACBASE_PORT);
  40. /// <summary>
  41. /// Returns the name of the member
  42. /// </summary>
  43. ///
  44. /// <returns>
  45. /// Returns const ACHAR* that points to the name
  46. /// </returns>
  47. ///
  48. ACBASE_PORT const ACHAR* name() const throw();
  49. /// <summary>
  50. /// Returns the localized name of the member, if any.
  51. /// </summary>
  52. ///
  53. /// <returns>
  54. /// Returns AcString object that contains the name
  55. /// </returns>
  56. ///
  57. ACBASE_PORT AcString localName() const throw();
  58. /// <summary>
  59. /// Returns the type of the member.
  60. /// </summary>
  61. ///
  62. /// <returns>
  63. /// Returns const reference to an AcRxValueType object
  64. /// </returns>
  65. ///
  66. ACBASE_PORT const AcRxValueType& type()const throw();
  67. /// <summary>
  68. /// Returns the immutable collection of attributes for this member.
  69. /// </summary>
  70. ///
  71. /// <returns>
  72. /// Returns const reference to an AcRxAttributeCollection object
  73. /// </returns>
  74. ///
  75. ACBASE_PORT const AcRxAttributeCollection& attributes() const throw();
  76. /// <summary>
  77. /// Returns the collection of attributes for this member.
  78. /// </summary>
  79. ///
  80. /// <returns>
  81. /// Returns reference to an AcRxAttributeCollection object
  82. /// </returns>
  83. ///
  84. ACBASE_PORT AcRxAttributeCollection& attributes() throw();
  85. /// <summary>
  86. /// Returns the owner of this member.
  87. /// </summary>
  88. ///
  89. /// <returns>
  90. /// Returns pointer to an AcRxObject if it has an owner, otherwise it returns NULL
  91. /// </returns>
  92. ///
  93. ACBASE_PORT const AcRxObject* owner() const throw();
  94. /// <summary>
  95. /// Returns the children of this member.
  96. /// </summary>
  97. ///
  98. /// <returns>
  99. /// Returns pointer to an AcArray object if it has children
  100. /// </returns>
  101. ///
  102. ACBASE_PORT const AcArray<const AcRxMember*>* children() const throw();
  103. /// <summary>
  104. /// deletes the member passed in and sends "goodbye" notification via AcRxMemberReactor.
  105. /// </summary>
  106. ///
  107. ACBASE_PORT static void deleteMember(const AcRxMember* pMember) throw();
  108. #pragma push_macro("new")
  109. #undef new
  110. /// <summary>
  111. /// new operator
  112. /// </summary>
  113. ACBASE_PORT static void* operator new(size_t size);
  114. /// <summary>
  115. /// debug new operator
  116. /// </summary>
  117. ACBASE_PORT static void* operator new(size_t size, const char *pFName, int nLine);
  118. #pragma pop_macro("new")
  119. protected:
  120. friend class AcRxMemberImp;
  121. #ifndef _ADESK_MAC_
  122. ACBASE_PORT virtual ~AcRxMember() throw();
  123. #else
  124. ACBASE_PORT virtual ~AcRxMember();
  125. #endif
  126. ACBASE_PORT AcRxMember(AcRxMemberImp*) throw();
  127. /// <summary>
  128. /// The function returns the localized name of the member, if any.
  129. /// Derived class can override function to provide custom implementation.
  130. /// </summary>
  131. ///
  132. /// <returns>
  133. /// Returns AcString object that contains the name
  134. /// </returns>
  135. ///
  136. ACBASE_PORT virtual AcString subLocalName() const;
  137. /// <summary>
  138. /// The function returns the children of the member.
  139. /// The difference between subChildren and subChildrenEx is in memory management.
  140. /// Derived class can override function to provide custom implementation. The changes to the children array
  141. /// are cached after the initial call and the derived class will not have a chance to modify the array
  142. /// on subsequent calls to children()
  143. /// The default implementation calls subChildren first. If that method returns Acad::eNotApplicable,
  144. /// then subChildrenEx is called.
  145. /// </summary>
  146. ///
  147. /// <param name="children">
  148. /// Input reference to an AcArray object, to receive the children.
  149. /// </param>
  150. ///
  151. /// <returns> Returns Acad::eOk if successful; otherwise, returns an AutoCAD error status. </returns>
  152. ///
  153. ACBASE_PORT virtual Acad::ErrorStatus subChildren(AcArray<const AcRxMember*>& children) const;
  154. #ifndef __GNUC__
  155. protected:
  156. #else
  157. public:
  158. #endif
  159. #pragma push_macro("delete")
  160. #undef delete
  161. //protected delete operators so that client code is forced to delete AcRxMember objects
  162. //using deleteMember above.
  163. ACBASE_PORT static void operator delete(void *p);
  164. ACBASE_PORT static void operator delete(void *p, const char *pFName, int nLine);
  165. ACBASE_PORT static void operator delete[](void *p);
  166. ACBASE_PORT static void operator delete[](void *p, const char *pFName, int nLine);
  167. #pragma pop_macro("delete")
  168. private:
  169. #pragma push_macro("new")
  170. #undef new
  171. //made private so that arrays cannot be created.
  172. static void* operator new[](size_t size);
  173. static void* operator new[](size_t size, const char *pFName, int nLine);
  174. #pragma pop_macro("new")
  175. /// <summary>
  176. /// The function returns the children of the member.
  177. /// The difference between subChildren and subChildrenEx is in memory management.
  178. /// Derived classes that override this function are responsible for managing the pChildren
  179. /// array - allocationg and deleting. the base class will not hold on to the array and will not call it
  180. // for every invocation of children()
  181. /// The default implementation calls subChildren first. If that method returns Acad::eNotApplicable,
  182. /// the subChildrenEx is called.
  183. ///
  184. /// </summary>
  185. ///
  186. /// <param name="children">
  187. /// Output reference to an AcArray object, that contains the children.
  188. /// </param>
  189. ///
  190. /// <returns> Returns Acad::eOk if successful; otherwise, returns an AutoCAD error status. </returns>
  191. ///
  192. ACBASE_PORT virtual Acad::ErrorStatus subChildrenEx(AcArray<const AcRxMember*>*& pChildren) const;
  193. };
  194. //*************************************************************************
  195. // AcRxEnumTag
  196. //*************************************************************************
  197. /// <summary>
  198. /// This class is used to store the enumeration constant value.
  199. /// </summary>
  200. ///
  201. class AcRxEnumTag : public AcRxMember
  202. {
  203. public:
  204. ACRX_DECLARE_MEMBERS_EXPIMP(AcRxEnumTag, ACBASE_PORT);
  205. /// <summary>
  206. /// Constructor
  207. /// </summary>
  208. ///
  209. /// <param name="name">
  210. /// The text that is used for the string representation of the constant.
  211. /// </param>
  212. ///
  213. /// <param name="value">
  214. /// The value of the enumeration constant.
  215. /// </param>
  216. ///
  217. ACBASE_PORT AcRxEnumTag(const ACHAR* name, const AcRxValue& value) throw();
  218. /// <summary>
  219. /// Returns the value of the enumeration constant.
  220. /// </summary>
  221. ///
  222. /// <returns>
  223. /// Returns const reference to an AcRxValue value
  224. /// </returns>
  225. ///
  226. ACBASE_PORT const AcRxValue& value() const;
  227. /// <summary>
  228. /// Returns a localized string representation of the
  229. /// enumeration constant, if available. If the member has
  230. /// alternate localized name attribute, then it tries to return
  231. /// the alternate localized string representation using the
  232. /// AcRxAlternateLocalizedNameAttribute information.
  233. /// </summary>
  234. ///
  235. /// <returns>
  236. /// Returns AcString object that contains the name
  237. /// </returns>
  238. ///
  239. ACBASE_PORT AcString alternateLocalName() const;
  240. protected:
  241. /// <summary>
  242. /// Destructor
  243. /// </summary>
  244. ///
  245. ACBASE_PORT ~AcRxEnumTag();
  246. /// <summary>
  247. /// Derived class can override this method to provide custom implementation.
  248. /// </summary>
  249. ///
  250. /// <returns>
  251. /// Returns AcString object that contains the name
  252. /// </returns>
  253. ///
  254. ACBASE_PORT virtual AcString subAlternateLocalName() const;
  255. };
  256. //*************************************************************************
  257. // AcRxMemberCollection
  258. //*************************************************************************
  259. /// <summary>
  260. /// This class is a collection of AcRxMember objects.
  261. /// </summary>
  262. ///
  263. class AcRxMemberCollection : public Pimpl::ApiPart<void, AcRxMemberCollectionImp>
  264. {
  265. public:
  266. /// <summary>
  267. /// Destructor
  268. /// </summary>
  269. ///
  270. ACBASE_PORT virtual ~AcRxMemberCollection();
  271. /// <summary>
  272. /// Returns the number of members in the collection.
  273. /// </summary>
  274. ///
  275. /// <returns>
  276. /// Returns the number of AcRxMember objects in the collection
  277. /// </returns>
  278. ///
  279. virtual int count() const;
  280. /// <summary>
  281. /// This method returns a member at the passed in index.
  282. /// </summary>
  283. ///
  284. /// <param name="index">
  285. /// Passed in index of interest
  286. /// </param>
  287. ///
  288. /// <returns>
  289. /// Returns a pointer to AcRxMember object at the passed in index.
  290. /// </returns>
  291. ///
  292. virtual AcRxMember* getAt(int index) const;
  293. protected:
  294. /// <summary>
  295. /// Constructor
  296. /// </summary>
  297. ///
  298. ACBASE_PORT AcRxMemberCollection();
  299. private:
  300. friend class AcRxMemberCollectionImp;
  301. AcRxMemberCollection(AcRxMemberCollectionImp* pImp);
  302. };
  303. //*************************************************************************
  304. // AcRxMemberCollectionBuilder
  305. //*************************************************************************
  306. /// <summary>
  307. /// This class can be used to return collection of AcRxMember objects
  308. /// </summary>
  309. ///
  310. class AcRxMemberCollectionBuilder : public Pimpl::ApiPart<void, AcRxMemberCollectionImp>
  311. {
  312. public:
  313. /// <summary>
  314. /// This method adds the AcRxMember object to the AcRxMemberCollectionBuilder
  315. /// object collection.
  316. /// </summary>
  317. ///
  318. /// <param name="member">
  319. /// Input member object to add to the collection
  320. /// </param>
  321. ///
  322. /// <returns> Returns Acad::eOk if successful; otherwise, returns an AutoCAD error status. </returns>
  323. ///
  324. ACBASE_PORT Acad::ErrorStatus add(AcRxMember* member);
  325. /// <summary>
  326. /// returns the owner of the collection
  327. /// </summary>
  328. ACBASE_PORT const AcRxClass* owner() const;
  329. private:
  330. friend class AcRxMemberCollectionImp;
  331. AcRxMemberCollectionBuilder(AcRxMemberCollectionImp*, const AcRxClass* owner);
  332. ~AcRxMemberCollectionBuilder();
  333. const AcRxClass* m_owner;
  334. };
  335. //*************************************************************************
  336. // AcRxMemberIterator
  337. //*************************************************************************
  338. /// <summary>
  339. /// This class provides the ability to iterate through all AcRxMember objects
  340. /// of an object
  341. /// </summary>
  342. ///
  343. class AcRxMemberIterator : public Pimpl::ApiPart<void, AcRxMemberIteratorImp>
  344. {
  345. public:
  346. /// <summary>
  347. /// Destructor
  348. /// </summary>
  349. ///
  350. ACBASE_PORT virtual ~AcRxMemberIterator();
  351. /// <summary>
  352. /// The function reports whether the iterator has iterated to the end.
  353. /// </summary>
  354. ///
  355. /// <returns>
  356. /// It returns true if it has reached the end, otherwise it returns false.
  357. /// </returns>
  358. ///
  359. ACBASE_PORT virtual bool done();
  360. /// <summary>
  361. /// Positions the iterator to the next object in the structure.
  362. /// </summary>
  363. ///
  364. /// <returns>
  365. /// Returns true if and only if the iterator is not done.
  366. /// </returns>
  367. ///
  368. ACBASE_PORT virtual bool next();
  369. /// <summary>
  370. /// The function tries to return the value at the iterator's
  371. /// current location.
  372. /// </summary>
  373. ///
  374. /// <returns>
  375. /// Returns a pointer to AcRxMember if successful, otherwise it returns NULL.
  376. /// </returns>
  377. ///
  378. ACBASE_PORT virtual AcRxMember* current() const;
  379. /// <summary>
  380. /// Returns a member identified by the name.
  381. /// </summary>
  382. ///
  383. /// <param name="name">
  384. /// Input the name that identifies the member to find.
  385. /// </param>
  386. ///
  387. /// <returns>
  388. /// Returns the pointer to AcRxMember identified by the string name, or NULL
  389. /// if there is no such AcRxMember with the name.
  390. /// </returns>
  391. ///
  392. ACBASE_PORT virtual AcRxMember* find(const ACHAR* name) const;
  393. protected:
  394. /// <summary>
  395. /// Constructor
  396. /// </summary>
  397. ///
  398. ACBASE_PORT AcRxMemberIterator();
  399. private:
  400. friend class AcRxMemberIteratorImp;
  401. AcRxMemberIterator(AcRxMemberIteratorImp*);
  402. };
  403. //*************************************************************************
  404. // AcRxMemberQueryContext
  405. //*************************************************************************
  406. /// <summary>
  407. /// This class provides other contextual data about the query to influence
  408. /// the set of members. The derived classes can implement their own context
  409. /// and return the members relevant to the context.
  410. /// </summary>
  411. ///
  412. class AcRxMemberQueryContext : public Pimpl::ApiPart<AcRxObject, AcRxMemberQueryContextImp>
  413. {
  414. public:
  415. ACRX_DECLARE_MEMBERS_EXPIMP(AcRxMemberQueryContext, ACBASE_PORT);
  416. /// <summary>
  417. /// This method is called by AcRxMemberQueryEngine::newMemberIterator to
  418. /// get the members relevant to the context.
  419. /// </summary>
  420. ///
  421. /// <param name="facets">
  422. /// Input set of classes for which to get the members.
  423. /// </param>
  424. ///
  425. /// <returns>
  426. /// Returns the pointer to AcRxMemberIterator if there are members, otherwise it returns NULL.
  427. /// </returns>
  428. ///
  429. ACBASE_PORT AcRxMemberIterator* newMemberIterator(const AcArray<const AcRxClass*>& facets) const;
  430. protected:
  431. friend class AcRxMemberQueryContextImp;
  432. /// <summary>
  433. /// Constructor
  434. /// </summary>
  435. ///
  436. ACBASE_PORT AcRxMemberQueryContext();
  437. /// <summary>
  438. /// Destructor
  439. /// </summary>
  440. ///
  441. ACBASE_PORT virtual ~AcRxMemberQueryContext();
  442. /// <summary>
  443. /// The derived class must override this method and return the members
  444. /// appropriate to the context.
  445. /// </summary>
  446. ///
  447. /// <param name="facets">
  448. /// Input reference to an AcArray object, to receive the facets.
  449. /// </param>
  450. ///
  451. /// <returns>
  452. /// Returns pointer to AcRxMemberIterator if there are members; otherwise, returns NULL.
  453. /// </returns>
  454. ///
  455. virtual AcRxMemberIterator* subNewMemberIterator(const AcArray<const AcRxClass*>& facets) const = 0;
  456. };
  457. //*************************************************************************
  458. // AcRxFacetProvider
  459. //*************************************************************************
  460. /// <summary>
  461. /// Abstract base class for all facet providers. The class provides a mechanism
  462. /// to supply additional members for a given class in a given context. The
  463. /// derived class can register as a facet provider using AcRxMemberQueryEngine
  464. /// engine. The engine will call getFacets with the object whose members are
  465. /// being queried, along with the context. The class can add the facet objects
  466. /// that supply the additional members to the facet collection that is passed.
  467. /// </summary>
  468. ///
  469. class AcRxFacetProvider : public AcRxObject
  470. {
  471. public:
  472. ACRX_DECLARE_MEMBERS_EXPIMP(AcRxFacetProvider, ACBASE_PORT);
  473. /// <summary>
  474. /// This method is called by AcRxMemberQueryEngine everytime AcRxMemberQueryEngine::newMemberIterator
  475. /// is called. The derived class can add the facets that supply additional
  476. /// members in a given context, to the passed collection.
  477. /// </summary>
  478. ///
  479. /// <param name="pO">
  480. /// Input object, which is queried for its members.
  481. /// </param>
  482. ///
  483. /// <param name="pContext">
  484. /// Input query context object.
  485. /// </param>
  486. ///
  487. /// <param name="facets">
  488. /// Reference to the facet collection. The class can add facets that
  489. /// supply additonal members.
  490. /// </param>
  491. ///
  492. virtual void getFacets(const AcRxObject* pO, const AcRxMemberQueryContext* pContext, AcArray<const AcRxClass*>& facets) = 0;
  493. };
  494. //*************************************************************************
  495. // AcRxMemberReactor
  496. //*************************************************************************
  497. /// <summary>
  498. /// The AcRxMemberReactor can be used to get AcRxMember notifications, like
  499. /// when the member is destroyed.
  500. /// </summary>
  501. ///
  502. class AcRxMemberReactor
  503. {
  504. public:
  505. /// <summary>
  506. /// Destructor
  507. /// </summary>
  508. ///
  509. virtual ~AcRxMemberReactor() {}
  510. /// <summary>
  511. /// This function is invoked when the member is being deleted from memory.
  512. /// </summary>
  513. ///
  514. /// <param name="pMember">
  515. /// Passed in const pointer to the object being destroyed.
  516. /// </param>
  517. ///
  518. virtual void goodbye(const AcRxMember* pMember) { (pMember); }//Unreferenced parameter
  519. };
  520. //*************************************************************************
  521. // AcRxMemberQueryEngine
  522. //*************************************************************************
  523. /// <summary>
  524. /// The AcRxMemberQueryEngine object is used to query the members and register the
  525. /// facet providers. This class is a singleton with a static method that returns
  526. /// a global instance of the object.
  527. /// </summary>
  528. ///
  529. class AcRxMemberQueryEngine: public Pimpl::ApiPart<void, AcRxMemberQueryEngineImp>
  530. {
  531. public:
  532. /// <summary>
  533. /// Returns the singleton object
  534. /// </summary>
  535. ///
  536. /// <returns>
  537. /// Returns pointer to an AcRxMemberQueryEngine if successful, otherwise returns NULL.
  538. /// </returns>
  539. ///
  540. ACBASE_PORT static AcRxMemberQueryEngine* theEngine();
  541. /// <summary>
  542. /// This method can be used to find an AcRxMember of an object using the name.
  543. /// </summary>
  544. ///
  545. /// <param name="pO">
  546. /// Input object that need to be searched for the member.
  547. /// </param>
  548. ///
  549. /// <param name="name">
  550. /// Input the name of the member to find.
  551. /// </param>
  552. ///
  553. /// <param name="pContext">
  554. /// Optional. Input the context data that is used to query the member.
  555. /// </param>
  556. ///
  557. /// <returns>
  558. /// Returns pointer to an AcRxMember if successful, otherwise returns NULL.
  559. /// </returns>
  560. ///
  561. ACBASE_PORT AcRxMember* find(const AcRxObject* pO, const ACHAR* name, const AcRxMemberQueryContext* pContext = NULL) const;
  562. /// <summary>
  563. /// This method can be used to get the members of an object.
  564. /// </summary>
  565. ///
  566. /// <param name="pO">
  567. /// Input object to query for members.
  568. /// </param>
  569. ///
  570. /// <param name="pContext">
  571. /// Optional. Input the context data that is used to query the members.
  572. /// </param>
  573. ///
  574. /// <returns>
  575. /// Returns pointer to AcRxMemberIterator if there are members, otherwise returns NULL.
  576. /// </returns>
  577. ///
  578. ACBASE_PORT AcRxMemberIterator* newMemberIterator(const AcRxObject* pO, const AcRxMemberQueryContext* pContext = NULL) const;
  579. /// <summary>
  580. /// This method can be used to query the defaultContext that can be
  581. /// used to query for members.
  582. /// </summary>
  583. ///
  584. /// <returns>
  585. /// Returns pointer to AcRxMemberQueryContext.
  586. /// </returns>
  587. ///
  588. ACBASE_PORT const AcRxMemberQueryContext* defaultContext();
  589. /// <summary>
  590. /// This method can be used to query the promotingContext that can be
  591. /// used to query for members. The promoting context can be used when
  592. /// certain members need to be promoted with respect to certain other
  593. /// members. For example using the promoting context we can get
  594. /// three promoted members Start X, Start Y and Start Z, instead of
  595. /// a StartPoint member.
  596. /// </summary>
  597. ///
  598. /// <returns>
  599. /// Returns pointer to AcRxPromotingQueryContext.
  600. /// </returns>
  601. ///
  602. ACBASE_PORT const AcRxPromotingQueryContext* promotingContext();
  603. /// <summary>
  604. /// This method can be be used to add a facet provider.
  605. /// </summary>
  606. ///
  607. /// <param name="pProvider">
  608. /// Input facet provider that is to be added.
  609. /// </param>
  610. ///
  611. /// <returns> Returns Acad::eOk if successful; otherwise, returns an AutoCAD error status. </returns>
  612. ///
  613. ACBASE_PORT Acad::ErrorStatus addFacetProvider(AcRxFacetProvider* pProvider);
  614. /// <summary>
  615. /// This method can be be used to remove a facet provider.
  616. /// </summary>
  617. ///
  618. /// <param name="pProvider">
  619. /// Input facet provider that is to be removed.
  620. /// </param>
  621. ///
  622. /// <returns> Returns Acad::eOk if successful; otherwise, returns an AutoCAD error status. </returns>
  623. ///
  624. ACBASE_PORT Acad::ErrorStatus removeFacetProvider(AcRxFacetProvider* pProvider);
  625. /// <summary>
  626. /// Adds AcRxMemberReactor reactor
  627. /// </summary>
  628. ///
  629. /// <param name="pReactor">
  630. /// Input AcRxMemberReactor to add
  631. /// </param>
  632. ///
  633. ACBASE_PORT void addReactor(AcRxMemberReactor* pReactor);
  634. /// <summary>
  635. /// Removes AcRxMemberReactor reactor
  636. /// </summary>
  637. ///
  638. /// <param name="pReactor">
  639. /// Input AcRxMemberReactor to remove
  640. /// </param>
  641. ///
  642. ACBASE_PORT void removeReactor(AcRxMemberReactor* pReactor);
  643. private:
  644. friend class AcRxMemberQueryEngineImp;
  645. AcRxMemberQueryEngine(AcRxMemberQueryEngineImp*);
  646. ~AcRxMemberQueryEngine();
  647. };
  648. /// <summary>
  649. /// Base class for overrules for AcRxMember.
  650. /// </summary>
  651. ///
  652. class AcRxMemberOverrule : public AcRxOverruleBase
  653. {
  654. public:
  655. //Utility class to store a member, overrule pair
  656. struct Record
  657. {
  658. AcRxMember* m_pMember;
  659. AcRxMemberOverrule* m_pOverrule;
  660. Record()
  661. :m_pMember(NULL)
  662. ,m_pOverrule(NULL) {}
  663. Record(AcRxMember* pMember, AcRxMemberOverrule* pOverrule)
  664. :m_pMember(pMember)
  665. ,m_pOverrule(pOverrule) {}
  666. };
  667. ACRX_DECLARE_MEMBERS_EXPIMP(AcRxMemberOverrule, ACBASE_PORT);
  668. /// <summary>
  669. /// Adds an overrule for the specified member.
  670. /// </summary>
  671. ///
  672. /// <param name="pOverruledSubject">
  673. /// The member whose behavior is to be modified.
  674. /// </param>
  675. /// <param name="pOverrule">
  676. /// The overrule object to be added.
  677. /// </param>
  678. /// <param name="bAddAtLast">
  679. /// Parameter the determines what order the overrules are executed. Normally, the last overrule
  680. /// to be added is the one to be executed first.
  681. /// </param>
  682. ///
  683. ACBASE_PORT static Acad::ErrorStatus addOverrule(AcRxMember* pOverruledSubject, AcRxMemberOverrule* pOverrule, bool bAddAtLast = false);
  684. /// <summary>
  685. /// Removes an overrule from the specified member.
  686. /// </summary>
  687. ///
  688. /// <param name="pOverruledSubject">
  689. /// The member from which to remove the overrule from.
  690. /// </param>
  691. /// <param name="pOverrule">
  692. /// The overrule object to be removed.
  693. /// </param>
  694. ///
  695. ACBASE_PORT static Acad::ErrorStatus removeOverrule( AcRxMember* pOverruledSubject, AcRxMemberOverrule* pOverrule);
  696. /// <summary>
  697. /// Removes overrules
  698. /// </summary>
  699. ///
  700. /// <param name="overrules">
  701. /// Member, overrule pairs to remove.
  702. /// </param>
  703. ///
  704. ACBASE_PORT static Acad::ErrorStatus removeOverrules(const AcArray<Record>& overrules);
  705. };