Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

164 lines
6.2 KiB

  1. #ifndef _RICHOLE_
  2. #define _RICHOLE_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif
  6. /*
  7. * RICHOLE.H
  8. *
  9. * Purpose:
  10. * OLE Extensions to the Rich Text Editor
  11. *
  12. * Copyright (c) 1985-1999, Microsoft Corporation
  13. */
  14. // Structure passed to GetObject and InsertObject
  15. typedef struct _reobject
  16. {
  17. DWORD cbStruct; // Size of structure
  18. LONG cp; // Character position of object
  19. CLSID clsid; // Class ID of object
  20. LPOLEOBJECT poleobj; // OLE object interface
  21. LPSTORAGE pstg; // Associated storage interface
  22. LPOLECLIENTSITE polesite; // Associated client site interface
  23. SIZEL sizel; // Size of object (may be 0,0)
  24. DWORD dvaspect; // Display aspect to use
  25. DWORD dwFlags; // Object status flags
  26. DWORD dwUser; // Dword for user's use
  27. } REOBJECT;
  28. // Flags to specify which interfaces should be returned in the structure above
  29. #define REO_GETOBJ_NO_INTERFACES (0x00000000L)
  30. #define REO_GETOBJ_POLEOBJ (0x00000001L)
  31. #define REO_GETOBJ_PSTG (0x00000002L)
  32. #define REO_GETOBJ_POLESITE (0x00000004L)
  33. #define REO_GETOBJ_ALL_INTERFACES (0x00000007L)
  34. // Place object at selection
  35. #define REO_CP_SELECTION ((ULONG) -1L)
  36. // Use character position to specify object instead of index
  37. #define REO_IOB_SELECTION ((ULONG) -1L)
  38. #define REO_IOB_USE_CP ((ULONG) -2L)
  39. // Object flags
  40. #define REO_NULL (0x00000000L) // No flags
  41. #define REO_READWRITEMASK (0x0000003FL) // Mask out RO bits
  42. #define REO_DONTNEEDPALETTE (0x00000020L) // Object doesn't need palette
  43. #define REO_BLANK (0x00000010L) // Object is blank
  44. #define REO_DYNAMICSIZE (0x00000008L) // Object defines size always
  45. #define REO_INVERTEDSELECT (0x00000004L) // Object drawn all inverted if sel
  46. #define REO_BELOWBASELINE (0x00000002L) // Object sits below the baseline
  47. #define REO_RESIZABLE (0x00000001L) // Object may be resized
  48. #define REO_LINK (0x80000000L) // Object is a link (RO)
  49. #define REO_STATIC (0x40000000L) // Object is static (RO)
  50. #define REO_SELECTED (0x08000000L) // Object selected (RO)
  51. #define REO_OPEN (0x04000000L) // Object open in its server (RO)
  52. #define REO_INPLACEACTIVE (0x02000000L) // Object in place active (RO)
  53. #define REO_HILITED (0x01000000L) // Object is to be hilited (RO)
  54. #define REO_LINKAVAILABLE (0x00800000L) // Link believed available (RO)
  55. #define REO_GETMETAFILE (0x00400000L) // Object requires metafile (RO)
  56. // flags for IRichEditOle::GetClipboardData(),
  57. // IRichEditOleCallback::GetClipboardData() and
  58. // IRichEditOleCallback::QueryAcceptData()
  59. #define RECO_PASTE (0x00000000L) // paste from clipboard
  60. #define RECO_DROP (0x00000001L) // drop
  61. #define RECO_COPY (0x00000002L) // copy to the clipboard
  62. #define RECO_CUT (0x00000003L) // cut to the clipboard
  63. #define RECO_DRAG (0x00000004L) // drag
  64. /*
  65. * IRichEditOle
  66. *
  67. * Purpose:
  68. * Interface used by the client of RichEdit to perform OLE-related
  69. * operations.
  70. *
  71. * //$ REVIEW:
  72. * The methods herein may just want to be regular Windows messages.
  73. */
  74. #undef INTERFACE
  75. #define INTERFACE IRichEditOle
  76. DECLARE_INTERFACE_(IRichEditOle, IUnknown)
  77. {
  78. // *** IUnknown methods ***
  79. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lplpObj) PURE;
  80. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  81. STDMETHOD_(ULONG,Release) (THIS) PURE;
  82. // *** IRichEditOle methods ***
  83. STDMETHOD(GetClientSite) (THIS_ LPOLECLIENTSITE FAR * lplpolesite) PURE;
  84. STDMETHOD_(LONG,GetObjectCount) (THIS) PURE;
  85. STDMETHOD_(LONG,GetLinkCount) (THIS) PURE;
  86. STDMETHOD(GetObject) (THIS_ LONG iob, REOBJECT FAR * lpreobject,
  87. DWORD dwFlags) PURE;
  88. STDMETHOD(InsertObject) (THIS_ REOBJECT FAR * lpreobject) PURE;
  89. STDMETHOD(ConvertObject) (THIS_ LONG iob, REFCLSID rclsidNew,
  90. LPCSTR lpstrUserTypeNew) PURE;
  91. STDMETHOD(ActivateAs) (THIS_ REFCLSID rclsid, REFCLSID rclsidAs) PURE;
  92. STDMETHOD(SetHostNames) (THIS_ LPCSTR lpstrContainerApp,
  93. LPCSTR lpstrContainerObj) PURE;
  94. STDMETHOD(SetLinkAvailable) (THIS_ LONG iob, BOOL fAvailable) PURE;
  95. STDMETHOD(SetDvaspect) (THIS_ LONG iob, DWORD dvaspect) PURE;
  96. STDMETHOD(HandsOffStorage) (THIS_ LONG iob) PURE;
  97. STDMETHOD(SaveCompleted) (THIS_ LONG iob, LPSTORAGE lpstg) PURE;
  98. STDMETHOD(InPlaceDeactivate) (THIS) PURE;
  99. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  100. STDMETHOD(GetClipboardData) (THIS_ CHARRANGE FAR * lpchrg, DWORD reco,
  101. LPDATAOBJECT FAR * lplpdataobj) PURE;
  102. STDMETHOD(ImportDataObject) (THIS_ LPDATAOBJECT lpdataobj,
  103. CLIPFORMAT cf, HGLOBAL hMetaPict) PURE;
  104. };
  105. typedef IRichEditOle FAR * LPRICHEDITOLE;
  106. /*
  107. * IRichEditOleCallback
  108. *
  109. * Purpose:
  110. * Interface used by the RichEdit to get OLE-related stuff from the
  111. * application using RichEdit.
  112. */
  113. #undef INTERFACE
  114. #define INTERFACE IRichEditOleCallback
  115. DECLARE_INTERFACE_(IRichEditOleCallback, IUnknown)
  116. {
  117. // *** IUnknown methods ***
  118. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lplpObj) PURE;
  119. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  120. STDMETHOD_(ULONG,Release) (THIS) PURE;
  121. // *** IRichEditOleCallback methods ***
  122. STDMETHOD(GetNewStorage) (THIS_ LPSTORAGE FAR * lplpstg) PURE;
  123. STDMETHOD(GetInPlaceContext) (THIS_ LPOLEINPLACEFRAME FAR * lplpFrame,
  124. LPOLEINPLACEUIWINDOW FAR * lplpDoc,
  125. LPOLEINPLACEFRAMEINFO lpFrameInfo) PURE;
  126. STDMETHOD(ShowContainerUI) (THIS_ BOOL fShow) PURE;
  127. STDMETHOD(QueryInsertObject) (THIS_ LPCLSID lpclsid, LPSTORAGE lpstg,
  128. LONG cp) PURE;
  129. STDMETHOD(DeleteObject) (THIS_ LPOLEOBJECT lpoleobj) PURE;
  130. STDMETHOD(QueryAcceptData) (THIS_ LPDATAOBJECT lpdataobj,
  131. CLIPFORMAT FAR * lpcfFormat, DWORD reco,
  132. BOOL fReally, HGLOBAL hMetaPict) PURE;
  133. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  134. STDMETHOD(GetClipboardData) (THIS_ CHARRANGE FAR * lpchrg, DWORD reco,
  135. LPDATAOBJECT FAR * lplpdataobj) PURE;
  136. STDMETHOD(GetDragDropEffect) (THIS_ BOOL fDrag, DWORD grfKeyState,
  137. LPDWORD pdwEffect) PURE;
  138. STDMETHOD(GetContextMenu) (THIS_ WORD seltype, LPOLEOBJECT lpoleobj,
  139. CHARRANGE FAR * lpchrg,
  140. HMENU FAR * lphmenu) PURE;
  141. };
  142. typedef IRichEditOleCallback FAR * LPRICHEDITOLECALLBACK;
  143. #ifndef MAC
  144. // RichEdit interface GUIDs
  145. DEFINE_GUID(IID_IRichEditOle, 0x00020D00, 0, 0, 0xC0,0,0,0,0,0,0,0x46);
  146. DEFINE_GUID(IID_IRichEditOleCallback, 0x00020D03, 0, 0, 0xC0,0,0,0,0,0,0,0x46);
  147. #endif // !MAC
  148. #endif // _RICHOLE_