Leaked source code of windows server 2003
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.

161 lines
6.4 KiB

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