// ------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> // ------------------------------------------------------------------------------ #pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981,SYSLIB1092,CS3021,CS3019 using global::System; using global::System.Diagnostics; using global::System.Diagnostics.CodeAnalysis; using global::System.Runtime.CompilerServices; using global::System.Runtime.InteropServices; using global::System.Runtime.Versioning; using winmdroot = global::Windows.Win32; namespace Windows.Win32 { namespace UI.Controls.RichEdit { [Guid("00020D03-0000-0000-C000-000000000046")] [CLSCompliant(false)] [SupportedOSPlatform("windows6.0.6000")] [global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.287+85e3fa26dd.RR")] internal unsafe partial struct IRichEditOleCallback :winmdroot.IVTable<IRichEditOleCallback,IRichEditOleCallback.Vtbl>,IComIID { /// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT QueryInterface(in global::System.Guid riid, out void* ppvObject) { fixed (void** ppvObjectLocal = &ppvObject) { fixed (global::System.Guid* riidLocal = &riid) { winmdroot.Foundation.HRESULT __result = this.QueryInterface(riidLocal, ppvObjectLocal); return __result; } } } public unsafe winmdroot.Foundation.HRESULT QueryInterface(global::System.Guid* riid, void** ppvObject) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), riid, ppvObject); } public uint AddRef() { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,uint>)lpVtbl[1])((IRichEditOleCallback*)Unsafe.AsPointer(ref this)); } public uint Release() { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,uint>)lpVtbl[2])((IRichEditOleCallback*)Unsafe.AsPointer(ref this)); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetNewStorage(IRichEditOleCallback* pThis, winmdroot.System.Com.StructuredStorage.IStorage** lplpstg) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetNewStorage(lplpstg); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Provides storage for a new object pasted from the clipboard or read in from an Rich Text Format (RTF) stream.</summary> /// <param name="lplpstg"> /// <para>Type: <b>LPSTORAGE*</b> The address of the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-istorage">IStorage</a> interface created for the new object.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getnewstorage#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b> on success. If the method fails, it can return one of the following values. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks>This method must be implemented to allow cut, copy, paste, drag, and drop operations of Component Object Model (COM) objects.</remarks> public unsafe winmdroot.Foundation.HRESULT GetNewStorage(winmdroot.System.Com.StructuredStorage.IStorage** lplpstg) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Com.StructuredStorage.IStorage** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), lplpstg); } /// <inheritdoc cref="GetInPlaceContext(winmdroot.System.Ole.IOleInPlaceFrame**, winmdroot.System.Ole.IOleInPlaceUIWindow**, winmdroot.System.Ole.OLEINPLACEFRAMEINFO*)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT GetInPlaceContext(winmdroot.System.Ole.IOleInPlaceFrame** lplpFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** lplpDoc, ref winmdroot.System.Ole.OLEINPLACEFRAMEINFO lpFrameInfo) { fixed (winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfoLocal = &lpFrameInfo) { winmdroot.Foundation.HRESULT __result = this.GetInPlaceContext(lplpFrame, lplpDoc, lpFrameInfoLocal); return __result; } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetInPlaceContext(IRichEditOleCallback* pThis, winmdroot.System.Ole.IOleInPlaceFrame** lplpFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** lplpDoc, winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfo) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetInPlaceContext(lplpFrame, lplpDoc, lpFrameInfo); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Provides the application and document-level interfaces and information required to support in-place activation.</summary> /// <param name="lplpFrame"> /// <para>Type: <b>LPOLEINPLACEFRAME*</b> The address of the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceframe">IOleInPlaceFrame</a> interface that represents the frame window of a rich edit control client. Use the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> method to increment the reference count. The rich edit control releases the interface when it is no longer needed.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getinplacecontext#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="lplpDoc"> /// <para>Type: <b>LPOLEINPLACEUIWINDOW*</b> The address of the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceuiwindow">IOleInPlaceUIWindow</a> interface that represents the document window of the rich edit control client. An interface need not be returned if the frame and document windows are the same. Use the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> method to increment the reference count. The rich edit control releases the interface when it is no longer needed.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getinplacecontext#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="lpFrameInfo"> /// <para>Type: <b>LPOLEINPLACEFRAMEINFO</b> The accelerator information.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getinplacecontext#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b> on success. If the method fails, it can return the following value. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getinplacecontext">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe winmdroot.Foundation.HRESULT GetInPlaceContext(winmdroot.System.Ole.IOleInPlaceFrame** lplpFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** lplpDoc, winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfo) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Ole.IOleInPlaceFrame** ,winmdroot.System.Ole.IOleInPlaceUIWindow** ,winmdroot.System.Ole.OLEINPLACEFRAMEINFO* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), lplpFrame, lplpDoc, lpFrameInfo); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT ShowContainerUI(IRichEditOleCallback* pThis, winmdroot.Foundation.BOOL fShow) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.ShowContainerUI(fShow); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Indicates whether or not the application is to display its container UI.</summary> /// <param name="fShow"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">BOOL</a></b> Show container UI flag. The value is <b>TRUE</b> if the container UI is displayed, and <b>FALSE</b> if it is not.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-showcontainerui#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b> on success. If the method fails, it can return the following value. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks> /// <para>The <b>IRichEditOleCallback::ShowContainerUI</b> method is called by the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplacesite-onuiactivate">IOleInPlaceSite::OnUIActivate</a> and <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplacesite-onuideactivate">IOleInPlaceSite::OnUIDeactivate</a> methods of the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplacesite">IOleInPlaceSite</a> interface.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-showcontainerui#">Read more on learn.microsoft.com</see>.</para> /// </remarks> public winmdroot.Foundation.HRESULT ShowContainerUI(winmdroot.Foundation.BOOL fShow) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), fShow); } /// <inheritdoc cref="QueryInsertObject(global::System.Guid*, winmdroot.System.Com.StructuredStorage.IStorage*, int)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT QueryInsertObject(ref global::System.Guid lpclsid, winmdroot.System.Com.StructuredStorage.IStorage* lpstg, int cp) { fixed (global::System.Guid* lpclsidLocal = &lpclsid) { winmdroot.Foundation.HRESULT __result = this.QueryInsertObject(lpclsidLocal, lpstg, cp); return __result; } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT QueryInsertObject(IRichEditOleCallback* pThis, global::System.Guid* lpclsid, winmdroot.System.Com.StructuredStorage.IStorage* lpstg, int cp) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.QueryInsertObject(lpclsid, lpstg, cp); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Queries the application as to whether an object should be inserted. The member is called when pasting and when reading Rich Text Format (RTF).</summary> /// <param name="lpclsid"> /// <para>Type: <b>LPCLSID</b> Class identifier of the object to be inserted.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryinsertobject#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="lpstg"> /// <para>Type: <b>LPSTORAGE</b> Storage containing the object.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryinsertobject#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="cp"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">LONG</a></b> Character position, at which the object will be inserted.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryinsertobject#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns S_OK on success. If the return value is not S_OK, the object was not inserted. If the method fails, it can return the following value. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryinsertobject">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe winmdroot.Foundation.HRESULT QueryInsertObject(global::System.Guid* lpclsid, winmdroot.System.Com.StructuredStorage.IStorage* lpstg, int cp) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,global::System.Guid* ,winmdroot.System.Com.StructuredStorage.IStorage* ,int ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), lpclsid, lpstg, cp); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT DeleteObject(IRichEditOleCallback* pThis, winmdroot.System.Ole.IOleObject* lpoleobj) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.DeleteObject(lpoleobj); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Sends notification that an object is about to be deleted from a rich edit control. The object is not necessarily being released when this member is called.</summary> /// <param name="lpoleobj"> /// <para>Type: <b>LPOLEOBJECT</b> The object that is being deleted.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-deleteobject#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b>.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-deleteobject">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe winmdroot.Foundation.HRESULT DeleteObject(winmdroot.System.Ole.IOleObject* lpoleobj) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Ole.IOleObject* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), lpoleobj); } /// <inheritdoc cref="QueryAcceptData(winmdroot.System.Com.IDataObject*, ushort*, winmdroot.System.SystemServices.RECO_FLAGS, winmdroot.Foundation.BOOL, winmdroot.Foundation.HGLOBAL)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT QueryAcceptData(winmdroot.System.Com.IDataObject* lpdataobj, ref ushort lpcfFormat, winmdroot.System.SystemServices.RECO_FLAGS reco, winmdroot.Foundation.BOOL fReally, winmdroot.Foundation.HGLOBAL hMetaPict) { fixed (ushort* lpcfFormatLocal = &lpcfFormat) { winmdroot.Foundation.HRESULT __result = this.QueryAcceptData(lpdataobj, lpcfFormatLocal, reco, fReally, hMetaPict); return __result; } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT QueryAcceptData(IRichEditOleCallback* pThis, winmdroot.System.Com.IDataObject* lpdataobj, ushort* lpcfFormat, winmdroot.System.SystemServices.RECO_FLAGS reco, winmdroot.Foundation.BOOL fReally, winmdroot.Foundation.HGLOBAL hMetaPict) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.QueryAcceptData(lpdataobj, lpcfFormat, reco, fReally, hMetaPict); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>During a paste operation or a drag event, determines if the data that is pasted or dragged should be accepted.</summary> /// <param name="lpdataobj"> /// <para>Type: <b>LPDATAOBJECT</b> The data object being pasted or dragged.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryacceptdata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="lpcfFormat"> /// <para>Type: <b>CLIPFORMAT*</b> The clipboard format that will be used for the paste or drop operation. If the value pointed to by <i>lpcfFormat</i> is zero, the best available format will be used. If the callback changes the value pointed to by <i>lpcfFormat</i>, the rich edit control only uses that format and the operation will fail if the format is not available.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryacceptdata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="reco"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">DWORD</a></b> A clipboard operation flag, which can be one of these values. </para> /// <para>This doc was truncated.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryacceptdata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="fReally"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">BOOL</a></b> Indicates whether the drag-drop is actually happening or if it is just a query. A nonzero value indicates the paste or drop is actually happening. A zero value indicates the operation is just a query, such as for <a href="https://docs.microsoft.com/windows/desktop/Controls/em-canpaste">EM_CANPASTE</a>.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryacceptdata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="hMetaPict"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HGLOBAL</a></b> Handle to a metafile containing the icon view of an object if <b>DVASPECT_ICON</b> is being imposed on an object by a paste special operation.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-queryacceptdata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b> on success. See Remarks.</para> /// </returns> /// <remarks>On failure, the rich edit control refuses the data and terminates the operation. Otherwise, the control checks the data itself for acceptable formats. A success code other than <b>S_OK</b> means that the callback either checked the data itself (if <i>fReally</i> is <b>FALSE</b>) or imported the data itself (if <i>fReally</i> is <b>TRUE</b>). If the application returns a success code other than <b>S_OK</b>, the control does not check the read-only state of the edit control.</remarks> public unsafe winmdroot.Foundation.HRESULT QueryAcceptData(winmdroot.System.Com.IDataObject* lpdataobj, ushort* lpcfFormat, winmdroot.System.SystemServices.RECO_FLAGS reco, winmdroot.Foundation.BOOL fReally, winmdroot.Foundation.HGLOBAL hMetaPict) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Com.IDataObject* ,ushort* ,winmdroot.System.SystemServices.RECO_FLAGS ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HGLOBAL ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), lpdataobj, lpcfFormat, reco, fReally, hMetaPict); } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT ContextSensitiveHelp(IRichEditOleCallback* pThis, winmdroot.Foundation.BOOL fEnterMode) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.ContextSensitiveHelp(fEnterMode); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Indicates if the application should transition into or out of context-sensitive help mode. This method should implement the functionality described for IOleWindow::ContextSensitiveHelp.</summary> /// <param name="fEnterMode"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">BOOL</a></b> If <b>TRUE</b>, the application should enter context-sensitive help mode. If <b>FALSE</b>, the application should leave context-sensitive help mode.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-contextsensitivehelp#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b> on success. If the method fails, it can be the following value. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-contextsensitivehelp">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), fEnterMode); } /// <inheritdoc cref="GetClipboardData(winmdroot.UI.Controls.RichEdit.CHARRANGE*, uint, winmdroot.System.Com.IDataObject**)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT GetClipboardData(ref winmdroot.UI.Controls.RichEdit.CHARRANGE lpchrg, uint reco, winmdroot.System.Com.IDataObject** lplpdataobj) { fixed (winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrgLocal = &lpchrg) { winmdroot.Foundation.HRESULT __result = this.GetClipboardData(lpchrgLocal, reco, lplpdataobj); return __result; } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetClipboardData(IRichEditOleCallback* pThis, winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrg, uint reco, winmdroot.System.Com.IDataObject** lplpdataobj) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetClipboardData(lpchrg, reco, lplpdataobj); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Allows the client to supply its own clipboard object.</summary> /// <param name="lpchrg"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/richedit/ns-richedit-charrange">CHARRANGE</a>*</b> The clipboard object range.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getclipboarddata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="reco"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">DWORD</a></b> The clipboard operation flag can be one of these values.</para> /// <para></para> /// <para>This doc was truncated.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getclipboarddata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="lplpdataobj"> /// <para>Type: <b>LPDATAOBJECT*</b> Pointer to the pointer variable that receives the address of the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a> implementation representing the range specified in the <i>lpchrg</i> parameter. The value of <i>lplpdataobj</i> is ignored if an error is returned.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getclipboarddata#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b> on success. If the return value is <b>E_NOTIMPL</b>, the rich edit control created its own clipboard object. If the return value is a failure other than <b>E_NOTIMPL</b>, the operation failed.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getclipboarddata">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe winmdroot.Foundation.HRESULT GetClipboardData(winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrg, uint reco, winmdroot.System.Com.IDataObject** lplpdataobj) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.UI.Controls.RichEdit.CHARRANGE* ,uint ,winmdroot.System.Com.IDataObject** ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), lpchrg, reco, lplpdataobj); } /// <inheritdoc cref="GetDragDropEffect(winmdroot.Foundation.BOOL, winmdroot.System.SystemServices.MODIFIERKEYS_FLAGS, winmdroot.System.Ole.DROPEFFECT*)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT GetDragDropEffect(winmdroot.Foundation.BOOL fDrag, winmdroot.System.SystemServices.MODIFIERKEYS_FLAGS grfKeyState, ref winmdroot.System.Ole.DROPEFFECT pdwEffect) { fixed (winmdroot.System.Ole.DROPEFFECT* pdwEffectLocal = &pdwEffect) { winmdroot.Foundation.HRESULT __result = this.GetDragDropEffect(fDrag, grfKeyState, pdwEffectLocal); return __result; } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetDragDropEffect(IRichEditOleCallback* pThis, winmdroot.Foundation.BOOL fDrag, winmdroot.System.SystemServices.MODIFIERKEYS_FLAGS grfKeyState, winmdroot.System.Ole.DROPEFFECT* pdwEffect) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetDragDropEffect(fDrag, grfKeyState, pdwEffect); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Allows the client to specify the effects of a drop operation.</summary> /// <param name="fDrag"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">BOOL</a></b> <b>TRUE</b> if the query is for a <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-idroptarget-dragenter">IDropTarget::DragEnter</a> or <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-idroptarget-dragover">IDropTarget::DragOver</a>. <b>FALSE</b> if the query is for <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-idroptarget-drop">IDropTarget::Drop</a>.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getdragdropeffect#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="grfKeyState"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">DWORD</a></b> Key state as defined by OLE.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getdragdropeffect#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="pdwEffect"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">LPDWORD</a></b> The effect used by a rich edit control. When <i>fDrag</i> is <b>TRUE</b>, on return, its content is set to the effect allowable by the rich edit control. When <i>fDrag</i> is <b>FALSE</b>, on return, the variable is set to the effect to use.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getdragdropeffect#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> This method returns <b>S_OK</b>.</para> /// </returns> /// <remarks> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getdragdropeffect">Learn more about this API from learn.microsoft.com</see>.</para> /// </remarks> public unsafe winmdroot.Foundation.HRESULT GetDragDropEffect(winmdroot.Foundation.BOOL fDrag, winmdroot.System.SystemServices.MODIFIERKEYS_FLAGS grfKeyState, winmdroot.System.Ole.DROPEFFECT* pdwEffect) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.Foundation.BOOL ,winmdroot.System.SystemServices.MODIFIERKEYS_FLAGS ,winmdroot.System.Ole.DROPEFFECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), fDrag, grfKeyState, pdwEffect); } /// <inheritdoc cref="GetContextMenu(winmdroot.UI.Controls.RichEdit.RICH_EDIT_GET_CONTEXT_MENU_SEL_TYPE, winmdroot.System.Ole.IOleObject*, winmdroot.UI.Controls.RichEdit.CHARRANGE*, winmdroot.UI.WindowsAndMessaging.HMENU*)"/> [OverloadResolutionPriority(1)] internal unsafe winmdroot.Foundation.HRESULT GetContextMenu(winmdroot.UI.Controls.RichEdit.RICH_EDIT_GET_CONTEXT_MENU_SEL_TYPE seltype, winmdroot.System.Ole.IOleObject* lpoleobj, ref winmdroot.UI.Controls.RichEdit.CHARRANGE lpchrg, ref winmdroot.UI.WindowsAndMessaging.HMENU lphmenu) { fixed (winmdroot.UI.WindowsAndMessaging.HMENU* lphmenuLocal = &lphmenu) { fixed (winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrgLocal = &lpchrg) { winmdroot.Foundation.HRESULT __result = this.GetContextMenu(seltype, lpoleobj, lpchrgLocal, lphmenuLocal); return __result; } } } [UnmanagedCallersOnly(CallConvs = new []{ typeof(CallConvStdcall)} )] private static winmdroot.Foundation.HRESULT GetContextMenu(IRichEditOleCallback* pThis, winmdroot.UI.Controls.RichEdit.RICH_EDIT_GET_CONTEXT_MENU_SEL_TYPE seltype, winmdroot.System.Ole.IOleObject* lpoleobj, winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrg, winmdroot.UI.WindowsAndMessaging.HMENU* lphmenu) { try { winmdroot.Foundation.HRESULT __hr = winmdroot.ComHelpers.UnwrapCCW(pThis, out Interface __object); if (__hr.Failed) { return __hr; } return __object.GetContextMenu(seltype, lpoleobj, lpchrg, lphmenu); } catch (Exception ex) { return (winmdroot.Foundation.HRESULT)ex.HResult; } } /// <summary>Queries the application for a context menu to use on a right-click event.</summary> /// <param name="seltype">Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">WORD</a></b></param> /// <param name="lpoleobj"> /// <para>Type: <b>LPOLEOBJECT</b> Pointer to an interface. If the <i>seltype</i> parameter includes the <b>SEL_OBJECT</b> flag, <i>lpoleobj</i> is a pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleobject">IOleObject</a> interface for the first selected COM object. If <i>seltype</i> includes the <b>GCM_RIGHTMOUSEDROP</b> flag, <i>lpoleobj</i> is a pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-idataobject">IDataObject</a> interface. Otherwise, <i>lpoleobj</i> is <b>NULL</b>. If you hold on to the interface pointer, you must call the <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">AddRef</a> method to increment the object's reference count.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getcontextmenu#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="lpchrg"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/richedit/ns-richedit-charrange">CHARRANGE</a>*</b> Pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/richedit/ns-richedit-charrange">CHARRANGE</a> structure containing the current selection.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getcontextmenu#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <param name="lphmenu"> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HMENU</a>*</b> The handle of a context menu to use. This parameter is ignored if an error is returned. A rich edit control destroys the menu when it is finished with it so the client should not.</para> /// <para><see href="https://learn.microsoft.com/windows/win32/api/richole/nf-richole-iricheditolecallback-getcontextmenu#parameters">Read more on learn.microsoft.com</see>.</para> /// </param> /// <returns> /// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> Returns <b>S_OK</b> on success. If the method fails, it can be the following value. </para> /// <para>This doc was truncated.</para> /// </returns> /// <remarks>When the user selects an item from the context window, a <a href="https://docs.microsoft.com/windows/desktop/menurc/wm-command">WM_COMMAND</a> message is sent to the parent window of the rich edit control.</remarks> public unsafe winmdroot.Foundation.HRESULT GetContextMenu(winmdroot.UI.Controls.RichEdit.RICH_EDIT_GET_CONTEXT_MENU_SEL_TYPE seltype, winmdroot.System.Ole.IOleObject* lpoleobj, winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrg, winmdroot.UI.WindowsAndMessaging.HMENU* lphmenu) { return ((delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.UI.Controls.RichEdit.RICH_EDIT_GET_CONTEXT_MENU_SEL_TYPE ,winmdroot.System.Ole.IOleObject* ,winmdroot.UI.Controls.RichEdit.CHARRANGE* ,winmdroot.UI.WindowsAndMessaging.HMENU* ,winmdroot.Foundation.HRESULT>)lpVtbl[12])((IRichEditOleCallback*)Unsafe.AsPointer(ref this), seltype, lpoleobj, lpchrg, lphmenu); } internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv) where T : unmanaged { Guid guid = typeof(T).GUID; void* pv; var hr = this.QueryInterface(&guid, &pv); if (hr.Succeeded) { ppv = (T*)pv; } else { ppv = null; } return hr; } internal struct Vtbl { internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,uint> AddRef_2; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,uint> Release_3; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Com.StructuredStorage.IStorage** ,winmdroot.Foundation.HRESULT> GetNewStorage_4; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Ole.IOleInPlaceFrame** ,winmdroot.System.Ole.IOleInPlaceUIWindow** ,winmdroot.System.Ole.OLEINPLACEFRAMEINFO* ,winmdroot.Foundation.HRESULT> GetInPlaceContext_5; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ShowContainerUI_6; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,global::System.Guid* ,winmdroot.System.Com.StructuredStorage.IStorage* ,int ,winmdroot.Foundation.HRESULT> QueryInsertObject_7; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Ole.IOleObject* ,winmdroot.Foundation.HRESULT> DeleteObject_8; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.System.Com.IDataObject* ,ushort* ,winmdroot.System.SystemServices.RECO_FLAGS ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HGLOBAL ,winmdroot.Foundation.HRESULT> QueryAcceptData_9; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ContextSensitiveHelp_10; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.UI.Controls.RichEdit.CHARRANGE* ,uint ,winmdroot.System.Com.IDataObject** ,winmdroot.Foundation.HRESULT> GetClipboardData_11; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.Foundation.BOOL ,winmdroot.System.SystemServices.MODIFIERKEYS_FLAGS ,winmdroot.System.Ole.DROPEFFECT* ,winmdroot.Foundation.HRESULT> GetDragDropEffect_12; internal delegate *unmanaged [Stdcall]<IRichEditOleCallback*,winmdroot.UI.Controls.RichEdit.RICH_EDIT_GET_CONTEXT_MENU_SEL_TYPE ,winmdroot.System.Ole.IOleObject* ,winmdroot.UI.Controls.RichEdit.CHARRANGE* ,winmdroot.UI.WindowsAndMessaging.HMENU* ,winmdroot.Foundation.HRESULT> GetContextMenu_13; } public static void PopulateVTable(Vtbl* vtable) { vtable->GetNewStorage_4 = &GetNewStorage; vtable->GetInPlaceContext_5 = &GetInPlaceContext; vtable->ShowContainerUI_6 = &ShowContainerUI; vtable->QueryInsertObject_7 = &QueryInsertObject; vtable->DeleteObject_8 = &DeleteObject; vtable->QueryAcceptData_9 = &QueryAcceptData; vtable->ContextSensitiveHelp_10 = &ContextSensitiveHelp; vtable->GetClipboardData_11 = &GetClipboardData; vtable->GetDragDropEffect_12 = &GetDragDropEffect; vtable->GetContextMenu_13 = &GetContextMenu; } private void** lpVtbl; /// <summary>The IID guid for this interface.</summary> /// <value>{00020d03-0000-0000-c000-000000000046}</value> internal static readonly Guid IID_Guid = new Guid(0x00020D03, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46); static ref readonly Guid IComIID.Guid { [MethodImpl(MethodImplOptions.AggressiveInlining)] get { ReadOnlySpan<byte> data = new byte[] { 0x03,0x0D,0x02,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 }; return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data)); } } [Guid("00020D03-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()] [SupportedOSPlatform("windows6.0.6000")] internal interface Interface { [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetNewStorage(winmdroot.System.Com.StructuredStorage.IStorage** lplpstg); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetInPlaceContext(winmdroot.System.Ole.IOleInPlaceFrame** lplpFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** lplpDoc, winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfo); [PreserveSig()] winmdroot.Foundation.HRESULT ShowContainerUI(winmdroot.Foundation.BOOL fShow); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT QueryInsertObject(global::System.Guid* lpclsid, winmdroot.System.Com.StructuredStorage.IStorage* lpstg, int cp); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT DeleteObject(winmdroot.System.Ole.IOleObject* lpoleobj); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT QueryAcceptData(winmdroot.System.Com.IDataObject* lpdataobj, ushort* lpcfFormat, winmdroot.System.SystemServices.RECO_FLAGS reco, winmdroot.Foundation.BOOL fReally, winmdroot.Foundation.HGLOBAL hMetaPict); [PreserveSig()] winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetClipboardData(winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrg, uint reco, winmdroot.System.Com.IDataObject** lplpdataobj); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetDragDropEffect(winmdroot.Foundation.BOOL fDrag, winmdroot.System.SystemServices.MODIFIERKEYS_FLAGS grfKeyState, winmdroot.System.Ole.DROPEFFECT* pdwEffect); [PreserveSig()] unsafe winmdroot.Foundation.HRESULT GetContextMenu(winmdroot.UI.Controls.RichEdit.RICH_EDIT_GET_CONTEXT_MENU_SEL_TYPE seltype, winmdroot.System.Ole.IOleObject* lpoleobj, winmdroot.UI.Controls.RichEdit.CHARRANGE* lpchrg, winmdroot.UI.WindowsAndMessaging.HMENU* lphmenu); } } } }