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.

167 lines
6.8 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 (0x000007FFL) // Mask out RO bits
  39. #define REO_CANROTATE (0x00000080L) // Object knows how to display itself rotated
  40. #define REO_OWNERDRAWSELECT (0x00000040L) // Owner draws selected object
  41. #define REO_DONTNEEDPALETTE (0x00000020L) // Object doesn't need palette
  42. #define REO_BLANK (0x00000010L) // Object is blank
  43. #define REO_DYNAMICSIZE (0x00000008L) // Object defines size always
  44. #define REO_INVERTEDSELECT (0x00000004L) // Object drawn all inverted if sel
  45. #define REO_BELOWBASELINE (0x00000002L) // Object sits below the baseline
  46. #define REO_RESIZABLE (0x00000001L) // Object may be resized
  47. #define REO_USEASBACKGROUND (0x00000400L) // Use object as background picture
  48. #define REO_WRAPTEXTAROUND (0x00000200L) // Wrap text around the object
  49. #define REO_ALIGNTORIGHT (0x00000100L) // Align object to view's right side
  50. // Only makes sense when REO_WRAPTEXTAROUND is set
  51. #define REO_LINK (0x80000000L) // Object is a link (RO)
  52. #define REO_STATIC (0x40000000L) // Object is static (RO)
  53. #define REO_SELECTED (0x08000000L) // Object selected (RO)
  54. #define REO_OPEN (0x04000000L) // Object open in its server (RO)
  55. #define REO_INPLACEACTIVE (0x02000000L) // Object in place active (RO)
  56. #define REO_HILITED (0x01000000L) // Object is to be hilited (RO)
  57. #define REO_LINKAVAILABLE (0x00800000L) // Link believed available (RO)
  58. #define REO_GETMETAFILE (0x00400000L) // Object requires metafile (RO)
  59. // Flags for IRichEditOle::GetClipboardData(),
  60. // IRichEditOleCallback::GetClipboardData() and
  61. // IRichEditOleCallback::QueryAcceptData()
  62. #define RECO_PASTE (0x00000000L) // paste from clipboard
  63. #define RECO_DROP (0x00000001L) // drop
  64. #define RECO_COPY (0x00000002L) // copy to the clipboard
  65. #define RECO_CUT (0x00000003L) // cut to the clipboard
  66. #define RECO_DRAG (0x00000004L) // drag
  67. /*
  68. * IRichEditOle
  69. *
  70. * Purpose:
  71. * Interface used by the client of RichEdit to perform OLE-related
  72. * operations.
  73. *
  74. * //$ REVIEW:
  75. * The methods herein may just want to be regular Windows messages.
  76. */
  77. #undef INTERFACE
  78. #define INTERFACE IRichEditOle
  79. DECLARE_INTERFACE_(IRichEditOle, IUnknown)
  80. {
  81. // *** IUnknown methods ***
  82. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lplpObj) PURE;
  83. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  84. STDMETHOD_(ULONG,Release) (THIS) PURE;
  85. // *** IRichEditOle methods ***
  86. STDMETHOD(GetClientSite) (THIS_ LPOLECLIENTSITE FAR * lplpolesite) PURE;
  87. STDMETHOD_(LONG,GetObjectCount) (THIS) PURE;
  88. STDMETHOD_(LONG,GetLinkCount) (THIS) PURE;
  89. STDMETHOD(GetObject) (THIS_ LONG iob, REOBJECT FAR * lpreobject,
  90. DWORD dwFlags) PURE;
  91. STDMETHOD(InsertObject) (THIS_ REOBJECT FAR * lpreobject) PURE;
  92. STDMETHOD(ConvertObject) (THIS_ LONG iob, REFCLSID rclsidNew,
  93. LPCSTR lpstrUserTypeNew) PURE;
  94. STDMETHOD(ActivateAs) (THIS_ REFCLSID rclsid, REFCLSID rclsidAs) PURE;
  95. STDMETHOD(SetHostNames) (THIS_ LPCSTR lpstrContainerApp,
  96. LPCSTR lpstrContainerObj) PURE;
  97. STDMETHOD(SetLinkAvailable) (THIS_ LONG iob, BOOL fAvailable) PURE;
  98. STDMETHOD(SetDvaspect) (THIS_ LONG iob, DWORD dvaspect) PURE;
  99. STDMETHOD(HandsOffStorage) (THIS_ LONG iob) PURE;
  100. STDMETHOD(SaveCompleted) (THIS_ LONG iob, LPSTORAGE lpstg) PURE;
  101. STDMETHOD(InPlaceDeactivate) (THIS) PURE;
  102. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  103. STDMETHOD(GetClipboardData) (THIS_ CHARRANGE FAR * lpchrg, DWORD reco,
  104. LPDATAOBJECT FAR * lplpdataobj) PURE;
  105. STDMETHOD(ImportDataObject) (THIS_ LPDATAOBJECT lpdataobj,
  106. CLIPFORMAT cf, HGLOBAL hMetaPict) PURE;
  107. };
  108. typedef IRichEditOle FAR * LPRICHEDITOLE;
  109. /*
  110. * IRichEditOleCallback
  111. *
  112. * Purpose:
  113. * Interface used by the RichEdit to get OLE-related stuff from the
  114. * application using RichEdit.
  115. */
  116. #undef INTERFACE
  117. #define INTERFACE IRichEditOleCallback
  118. DECLARE_INTERFACE_(IRichEditOleCallback, IUnknown)
  119. {
  120. // *** IUnknown methods ***
  121. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lplpObj) PURE;
  122. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  123. STDMETHOD_(ULONG,Release) (THIS) PURE;
  124. // *** IRichEditOleCallback methods ***
  125. STDMETHOD(GetNewStorage) (THIS_ LPSTORAGE FAR * lplpstg) PURE;
  126. STDMETHOD(GetInPlaceContext) (THIS_ LPOLEINPLACEFRAME FAR * lplpFrame,
  127. LPOLEINPLACEUIWINDOW FAR * lplpDoc,
  128. LPOLEINPLACEFRAMEINFO lpFrameInfo) PURE;
  129. STDMETHOD(ShowContainerUI) (THIS_ BOOL fShow) PURE;
  130. STDMETHOD(QueryInsertObject) (THIS_ LPCLSID lpclsid, LPSTORAGE lpstg,
  131. LONG cp) PURE;
  132. STDMETHOD(DeleteObject) (THIS_ LPOLEOBJECT lpoleobj) PURE;
  133. STDMETHOD(QueryAcceptData) (THIS_ LPDATAOBJECT lpdataobj,
  134. CLIPFORMAT FAR * lpcfFormat, DWORD reco,
  135. BOOL fReally, HGLOBAL hMetaPict) PURE;
  136. STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE;
  137. STDMETHOD(GetClipboardData) (THIS_ CHARRANGE FAR * lpchrg, DWORD reco,
  138. LPDATAOBJECT FAR * lplpdataobj) PURE;
  139. STDMETHOD(GetDragDropEffect) (THIS_ BOOL fDrag, DWORD grfKeyState,
  140. LPDWORD pdwEffect) PURE;
  141. STDMETHOD(GetContextMenu) (THIS_ WORD seltype, LPOLEOBJECT lpoleobj,
  142. CHARRANGE FAR * lpchrg,
  143. HMENU FAR * lphmenu) PURE;
  144. };
  145. typedef IRichEditOleCallback FAR * LPRICHEDITOLECALLBACK;
  146. #ifndef MAC
  147. // RichEdit interface GUIDs
  148. DEFINE_GUID(IID_IRichEditOle, 0x00020D00, 0, 0, 0xC0,0,0,0,0,0,0,0x46);
  149. DEFINE_GUID(IID_IRichEditOleCallback, 0x00020D03, 0, 0, 0xC0,0,0,0,0,0,0,0x46);
  150. #endif // !MAC
  151. #endif // _RICHOLE_