oleaprot.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #ifndef OLEAUTO_H
  12. #define OLEAUTO_H
  13. #include "adesk.h"
  14. #ifdef _ADESK_WINDOWS_
  15. #include "dbmain.h"
  16. #include <wtypes.h>
  17. #pragma pack (push, 8)
  18. //
  19. // AcAxOleLinkManager is used to maintain the link between an ARX
  20. // objects and their respective COM wrapper.
  21. //
  22. class AcAxOleLinkManager
  23. {
  24. public:
  25. // Given a pointer to a database resident object, return
  26. // the IUnknown of the COM wrapper. NULL is returned if
  27. // no wrapper is found.
  28. virtual IUnknown* GetIUnknown(AcDbObject* pObject) = 0;
  29. // Set the link between a database resident object and a
  30. // COM wrapper. If the IUnknown is NULL, then the link is removed.
  31. virtual Adesk::Boolean SetIUnknown(AcDbObject* pObject, IUnknown* pUnknown) = 0;
  32. // Given a pointer to a database object, return
  33. // the IUnknown of the COM wrapper. NULL is returned if
  34. // no wrapper is found.
  35. virtual IUnknown* GetIUnknown(AcDbDatabase* pDatabase) = 0;
  36. // Set the link between a database object and a COM wrapper.
  37. // If the IUnknown is NULL, then the link is removed.
  38. virtual Adesk::Boolean SetIUnknown(AcDbDatabase* pDatabase, IUnknown* pUnknown) = 0;
  39. // Given a pointer to a database object, return the
  40. // IDispatch of then document object. NULL is returned if
  41. // the database does not belong to a particular document.
  42. virtual IDispatch* GetDocIDispatch(AcDbDatabase* pDatabase) = 0;
  43. // Set the link between a database object and the IDispatch
  44. // of the document it belongs to. If the IDispatch is NULL, then
  45. // the link is removed.
  46. virtual Adesk::Boolean SetDocIDispatch(AcDbDatabase* pDatabase, IDispatch* pDispatch) = 0;
  47. // Given a pointer to a database resident object and a subentID, return
  48. // the IUnknown of the COM wrapper. NULL is returned if
  49. // no wrapper is found.
  50. virtual IUnknown* GetIUnknown(AcDbObject* pObject,
  51. const AcDbSubentId &id) = 0;
  52. // Set the link between a database resident object, a subentID and a
  53. // COM wrapper. If the IUnknown is NULL, then the link is removed.
  54. virtual Adesk::Boolean SetIUnknown(AcDbObject* pObject,
  55. const AcDbSubentId &id, IUnknown* pUnknown) = 0;
  56. };
  57. AcAxOleLinkManager* AcAxGetOleLinkManager();
  58. #pragma pack (pop)
  59. #endif //_ADESK_WINDOWS_
  60. #endif // OLEAUTO_H