File: Windows.Win32.IOleInPlaceSite.g.cs
Project: src\src\System.Windows.Forms.Primitives\src\System.Windows.Forms.Primitives.csproj (System.Windows.Forms.Primitives)
// ------------------------------------------------------------------------------
// <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
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 System.Ole
	{
		[Guid("00000119-0000-0000-C000-000000000046")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IOleInPlaceSite
			:IVTable<IOleInPlaceSite,IOleInPlaceSite.Vtbl>,IComIID		{
			/// <inheritdoc cref="QueryInterface(global::System.Guid*, void**)"/>
			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]<IOleInPlaceSite*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleInPlaceSite*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

			public uint AddRef()
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,uint>)lpVtbl[1])((IOleInPlaceSite*)Unsafe.AsPointer(ref this));
			}

			public uint Release()
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,uint>)lpVtbl[2])((IOleInPlaceSite*)Unsafe.AsPointer(ref this));
			}

			/// <inheritdoc cref="GetWindow(winmdroot.Foundation.HWND*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetWindow(out winmdroot.Foundation.HWND phwnd)
			{
				fixed (winmdroot.Foundation.HWND* phwndLocal = &phwnd)
				{
					winmdroot.Foundation.HRESULT __result = this.GetWindow(phwndLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetWindow(IOleInPlaceSite* pThis, winmdroot.Foundation.HWND* phwnd)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetWindow(phwnd);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			public unsafe winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleInPlaceSite*)Unsafe.AsPointer(ref this), phwnd);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT ContextSensitiveHelp(IOleInPlaceSite* pThis, winmdroot.Foundation.BOOL fEnterMode)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.ContextSensitiveHelp(fEnterMode);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			public winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleInPlaceSite*)Unsafe.AsPointer(ref this), fEnterMode);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT CanInPlaceActivate(IOleInPlaceSite* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.CanInPlaceActivate();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Determines whether the container can activate the object in place.</summary>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>Only objects being displayed as DVASPECT_CONTENT can be activated in place.</para>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> <b>CanInPlaceActivate</b> is called by the client site's immediate child object when this object must activate in place. This function allows the container application to accept or refuse the activation request.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-caninplaceactivate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT CanInPlaceActivate()
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleInPlaceSite*)Unsafe.AsPointer(ref this));
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT OnInPlaceActivate(IOleInPlaceSite* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.OnInPlaceActivate();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Notifies the container that one of its objects is being activated in place.</summary>
			/// <returns>
			/// <para>This method returns S_OK if the container allows the in-place activation. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> <b>OnInPlaceActivate</b> is called by the active embedded object when it is activated in-place for the first time. The container should note that the object is becoming active. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> A container that supports linking to embedded objects must properly manage the running of its in-place objects when they are UI-inactive and running in the hidden state. To reactivate the in-place object quickly, a container should not call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-close">IOleObject::Close</a> until the container's <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplacesite-deactivateandundo">IOleInPlaceSite::DeactivateAndUndo</a> method is called. To help protect against the object being left in an unstable state if a linking client updates silently, the container should call <a href="https://docs.microsoft.com/windows/desktop/api/ole2/nf-ole2-olelockrunning">OleLockRunning</a> to lock the object in the running state. This prevents the hidden in-place object from shutting down before it can be saved in its container.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-oninplaceactivate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT OnInPlaceActivate()
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleInPlaceSite*)Unsafe.AsPointer(ref this));
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT OnUIActivate(IOleInPlaceSite* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.OnUIActivate();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Notifies the container that the object is about to be activated in place and that the object is going to replace the container's main menu with an in-place composite menu.</summary>
			/// <returns>
			/// <para>This method returns S_OK if the container allows the in-place activation. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The in-place object calls <b>IOleInPlaceSite::OnUIActivate</b> just before activating its user interface. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> The container should remove any user interface associated with its own activation. If the container is itself an embedded object, it should remove its document-level user interface. If there is already an object active in place in the same document, the container should call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceobject-uideactivate">IOleInPlaceObject::UIDeactivate</a> before calling <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplacesite-onuideactivate">OnUIDeactivate</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-onuiactivate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT OnUIActivate()
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleInPlaceSite*)Unsafe.AsPointer(ref this));
			}

			/// <inheritdoc cref="GetWindowContext(winmdroot.System.Ole.IOleInPlaceFrame**, winmdroot.System.Ole.IOleInPlaceUIWindow**, winmdroot.Foundation.RECT*, winmdroot.Foundation.RECT*, winmdroot.System.Ole.OLEINPLACEFRAMEINFO*)"/>
			internal unsafe winmdroot.Foundation.HRESULT GetWindowContext(winmdroot.System.Ole.IOleInPlaceFrame** ppFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** ppDoc, out winmdroot.Foundation.RECT lprcPosRect, out winmdroot.Foundation.RECT lprcClipRect, ref winmdroot.System.Ole.OLEINPLACEFRAMEINFO lpFrameInfo)
			{
				fixed (winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfoLocal = &lpFrameInfo)
				{
					fixed (winmdroot.Foundation.RECT* lprcClipRectLocal = &lprcClipRect)
					{
						fixed (winmdroot.Foundation.RECT* lprcPosRectLocal = &lprcPosRect)
						{
							winmdroot.Foundation.HRESULT __result = this.GetWindowContext(ppFrame, ppDoc, lprcPosRectLocal, lprcClipRectLocal, lpFrameInfoLocal);
							return __result;
						}
					}
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetWindowContext(IOleInPlaceSite* pThis, winmdroot.System.Ole.IOleInPlaceFrame** ppFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** ppDoc, winmdroot.Foundation.RECT* lprcPosRect, winmdroot.Foundation.RECT* lprcClipRect, winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfo)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetWindowContext(ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Enables an in-place object to retrieve the window interfaces that form the window object hierarchy, and the position in the parent window where the object's in-place activation window should be located.</summary>
			/// <param name="ppFrame">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceframe">IOleInPlaceFrame</a> pointer variable that receives the interface pointer to the frame. If an error occurs, the implementation must set <i>ppFrame</i> to <b>NULL</b>.</param>
			/// <param name="ppDoc">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceuiwindow">IOleInPlaceUIWindow</a> pointer variable that receives the interface pointer to the document window. If the document window is the same as the frame window, <i>ppDoc</i> is set to <b>NULL</b>. In this case, the object can only use <i>ppFrame</i> or border negotiation. If an error is returned, the implementation must set <i>ppDoc</i> to <b>NULL</b>.</param>
			/// <param name="lprcPosRect">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/windef/ns-windef-rect">RECT</a> structure for the rectangle containing the position of the in-place object in the client coordinates of its parent window. If an error is returned, this parameter must be set to <b>NULL</b>.</param>
			/// <param name="lprcClipRect">A pointer to a <a href="https://docs.microsoft.com/windows/desktop/api/windef/ns-windef-rect">RECT</a> structure for the outer rectangle containing the in-place object's position rectangle (<i>lprcPosRect</i>). This rectangle is relative to the client area of the object's parent window. If an error is returned, this parameter must be set to <b>NULL</b>.</param>
			/// <param name="lpFrameInfo">A pointer to an <a href="https://docs.microsoft.com/windows/win32/api/oleidl/ns-oleidl-oleinplaceframeinfo">OLEINPLACEFRAMEINFO</a> structure the container is to fill in with appropriate data. If an error is returned, this parameter must be set to <b>NULL</b>.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The <a href="https://docs.microsoft.com/windows/win32/api/oleidl/ns-oleidl-oleinplaceframeinfo">OLEINPLACEFRAMEINFO</a> structure provides data needed by OLE to dispatch keystroke accelerators to a container frame while an object is active in place. When an object is activated, it calls <b>GetWindowContext</b> from its container. The container returns the handle to its in-place accelerator table through the <a href="https://docs.microsoft.com/windows/win32/api/oleidl/ns-oleidl-oleinplaceframeinfo">OLEINPLACEFRAMEINFO</a> structure. Before calling <b>GetWindowContext</b>, the object must provide the size of the <b>OLEINPLACEFRAMEINFO</b> structure by filling in the cb member, pointed to by <i>lpFrameInfo</i>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-getwindowcontext#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetWindowContext(winmdroot.System.Ole.IOleInPlaceFrame** ppFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** ppDoc, winmdroot.Foundation.RECT* lprcPosRect, winmdroot.Foundation.RECT* lprcClipRect, winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfo)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.System.Ole.IOleInPlaceFrame** ,winmdroot.System.Ole.IOleInPlaceUIWindow** ,winmdroot.Foundation.RECT* ,winmdroot.Foundation.RECT* ,winmdroot.System.Ole.OLEINPLACEFRAMEINFO* ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleInPlaceSite*)Unsafe.AsPointer(ref this), ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Scroll(IOleInPlaceSite* pThis, winmdroot.Foundation.SIZE scrollExtant)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Scroll(scrollExtant);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Instructs the container to scroll the view of the object by the specified number of pixels.</summary>
			/// <param name="scrollExtant">The number of pixels by which to scroll in the X and Y directions.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>As a result of scrolling, the object's visible rectangle can change. If that happens, the container should give the new clipping rectangle to the object by calling <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceobject-setobjectrects">IOleInPlaceObject::SetObjectRects</a>. The intersection of the <i>lprcClipRect</i> and <i>lprcPosRect</i> rectangles gives the new visible rectangle. See <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplacesite-getwindowcontext">IOleInPlaceSite::GetWindowContext</a> for more information. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Called by an active, in-place object when it is asking the container to scroll.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-scroll#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT Scroll(winmdroot.Foundation.SIZE scrollExtant)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.SIZE ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IOleInPlaceSite*)Unsafe.AsPointer(ref this), scrollExtant);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT OnUIDeactivate(IOleInPlaceSite* pThis, winmdroot.Foundation.BOOL fUndoable)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.OnUIDeactivate(fUndoable);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Notifies the container that it should reinstall its user interface and take focus, and whether the object has an undoable state.</summary>
			/// <param name="fUndoable">Specifies whether the object can undo changes (TRUE) or not (FALSE).</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>The object indicates whether it can undo changes through the <i>fUndoable</i> flag. If the object can undo changes, the container can (by the user invoking the <b>Edit Undo</b> command) call the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceobject-reactivateandundo">IOleInPlaceObject::ReactivateAndUndo</a> method to undo the changes. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> <b>IOleInPlaceSite::OnUIDeactivate</b> is called by the site's immediate child object when it is deactivating to notify the container that it should reinstall its own user interface components and take focus. The container should wait for the call to <b>IOleInPlaceSite::OnUIDeactivate</b> to complete before fully cleaning up and destroying any composite submenus.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-onuideactivate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void OnUIDeactivate(winmdroot.Foundation.BOOL fUndoable)
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IOleInPlaceSite*)Unsafe.AsPointer(ref this), fUndoable).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT OnInPlaceDeactivate(IOleInPlaceSite* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.OnInPlaceDeactivate();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Notifies the container that the object is no longer active in place.</summary>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> <b>OnInPlaceDeactivate</b> is called by an in-place object when it is fully deactivated. This function notifies the container that the object has been deactivated, and it gives the container a chance to run code pertinent to the object's deactivation. In particular, <b>OnInPlaceDeactivate</b> is called as a result of <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceobject-inplacedeactivate">IOleInPlaceObject::InPlaceDeactivate</a> being called. Calling <b>OnInPlaceDeactivate</b> indicates that the object can no longer support Undo. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> If the container is holding pointers to the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceobject">IOleInPlaceObject</a> and <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleinplaceactiveobject">IOleInPlaceActiveObject</a> interface implementations, it should release them after the <b>OnInPlaceDeactivate</b> call.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-oninplacedeactivate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void OnInPlaceDeactivate()
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IOleInPlaceSite*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT DiscardUndoState(IOleInPlaceSite* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.DiscardUndoState();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Instructs the container to discard its undo state. The container should not call IOleInPlaceObject::ReActivateAndUndo.</summary>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para>If an object is activated in place and the object's associated object application maintains only one level of undo, there is no need to have more than one entry on the undo stack. That is, after a change has been made to the active object that invalidates its undo state saved by the container, there is no need to maintain this undo state in the container. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> <b>DiscardUndoState</b> is called by the active object while performing some action that would discard the undo state of the object. The in-place object calls this method to notify the container to discard the object's last saved undo state.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-discardundostate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void DiscardUndoState()
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT>)lpVtbl[12])((IOleInPlaceSite*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT DeactivateAndUndo(IOleInPlaceSite* pThis)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.DeactivateAndUndo();
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Deactivates the object, ends the in-place session, and reverts to the container's saved undo state.</summary>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> Called by the active object when the user invokes undo just after activating the object. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Upon completion of this call, the container should call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceobject-uideactivate">IOleInPlaceObject::UIDeactivate</a> to remove the user interface for the object, activate itself, and undo.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-deactivateandundo#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void DeactivateAndUndo()
			{
				((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT>)lpVtbl[13])((IOleInPlaceSite*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			/// <inheritdoc cref="OnPosRectChange(winmdroot.Foundation.RECT*)"/>
			internal unsafe winmdroot.Foundation.HRESULT OnPosRectChange(in winmdroot.Foundation.RECT lprcPosRect)
			{
				fixed (winmdroot.Foundation.RECT* lprcPosRectLocal = &lprcPosRect)
				{
					winmdroot.Foundation.HRESULT __result = this.OnPosRectChange(lprcPosRectLocal);
					return __result;
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT OnPosRectChange(IOleInPlaceSite* pThis, winmdroot.Foundation.RECT* lprcPosRect)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.OnPosRectChange(lprcPosRect);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Notifies the container that the object extents have changed.</summary>
			/// <param name="lprcPosRect">A pointer a <a href="https://docs.microsoft.com/windows/desktop/api/windef/ns-windef-rect">RECT</a> structure that contains the position of the in-place object in the client coordinates of its parent window.</param>
			/// <returns>
			/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
			/// <para>This doc was truncated.</para>
			/// </returns>
			/// <remarks>
			/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The <b>OnPosRectChange</b> method is called by the in-place object. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> When the in-place object calls <b>OnPosRectChange</b>, the container must call <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleinplaceobject-setobjectrects">IOleInPlaceObject::SetObjectRects</a> to specify the new position of the in-place window and the clipping rectangle. Only then does the object resize its window. In most cases, the object grows to the right and/or down. There could be cases where the object grows to the left and/or up, as conveyed through <i>lprcPosRect</i>. It is also possible to change the object's position without changing its size.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleinplacesite-onposrectchange#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT OnPosRectChange(winmdroot.Foundation.RECT* lprcPosRect)
			{
				return ((delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT>)lpVtbl[14])((IOleInPlaceSite*)Unsafe.AsPointer(ref this), lprcPosRect);
			}

			internal unsafe global::Windows.Win32.Foundation.HRESULT QueryInterface<T>(out T* ppv)
where T : unmanaged

			{
				var hr = this.QueryInterface(typeof(T).GUID, out void* pv);
				if (hr.Succeeded)

				{
					ppv = (T*)pv;
				}
				else

				{
					ppv = null;
				}

				return hr;
			}

			internal struct Vtbl
			{
				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,uint> AddRef_2;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,uint> Release_3;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HWND* ,winmdroot.Foundation.HRESULT> GetWindow_4;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> ContextSensitiveHelp_5;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT> CanInPlaceActivate_6;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT> OnInPlaceActivate_7;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT> OnUIActivate_8;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.System.Ole.IOleInPlaceFrame** ,winmdroot.System.Ole.IOleInPlaceUIWindow** ,winmdroot.Foundation.RECT* ,winmdroot.Foundation.RECT* ,winmdroot.System.Ole.OLEINPLACEFRAMEINFO* ,winmdroot.Foundation.HRESULT> GetWindowContext_9;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.SIZE ,winmdroot.Foundation.HRESULT> Scroll_10;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> OnUIDeactivate_11;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT> OnInPlaceDeactivate_12;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT> DiscardUndoState_13;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.HRESULT> DeactivateAndUndo_14;

				internal delegate *unmanaged [Stdcall]<IOleInPlaceSite*,winmdroot.Foundation.RECT* ,winmdroot.Foundation.HRESULT> OnPosRectChange_15;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetWindow_4 = &GetWindow;
				vtable->ContextSensitiveHelp_5 = &ContextSensitiveHelp;
				vtable->CanInPlaceActivate_6 = &CanInPlaceActivate;
				vtable->OnInPlaceActivate_7 = &OnInPlaceActivate;
				vtable->OnUIActivate_8 = &OnUIActivate;
				vtable->GetWindowContext_9 = &GetWindowContext;
				vtable->Scroll_10 = &Scroll;
				vtable->OnUIDeactivate_11 = &OnUIDeactivate;
				vtable->OnInPlaceDeactivate_12 = &OnInPlaceDeactivate;
				vtable->DiscardUndoState_13 = &DiscardUndoState;
				vtable->DeactivateAndUndo_14 = &DeactivateAndUndo;
				vtable->OnPosRectChange_15 = &OnPosRectChange;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{00000119-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x00000119, 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[]					{
0x19,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("00000119-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
				:winmdroot.System.Ole.IOleWindow.Interface			{
				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT GetWindow(winmdroot.Foundation.HWND* phwnd);

				[PreserveSig()]
				new winmdroot.Foundation.HRESULT ContextSensitiveHelp(winmdroot.Foundation.BOOL fEnterMode);

								[PreserveSig()]
winmdroot.Foundation.HRESULT CanInPlaceActivate();

								[PreserveSig()]
winmdroot.Foundation.HRESULT OnInPlaceActivate();

								[PreserveSig()]
winmdroot.Foundation.HRESULT OnUIActivate();

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetWindowContext(winmdroot.System.Ole.IOleInPlaceFrame** ppFrame, winmdroot.System.Ole.IOleInPlaceUIWindow** ppDoc, winmdroot.Foundation.RECT* lprcPosRect, winmdroot.Foundation.RECT* lprcClipRect, winmdroot.System.Ole.OLEINPLACEFRAMEINFO* lpFrameInfo);

								[PreserveSig()]
winmdroot.Foundation.HRESULT Scroll(winmdroot.Foundation.SIZE scrollExtant);

								[PreserveSig()]
winmdroot.Foundation.HRESULT OnUIDeactivate(winmdroot.Foundation.BOOL fUndoable);

								[PreserveSig()]
winmdroot.Foundation.HRESULT OnInPlaceDeactivate();

								[PreserveSig()]
winmdroot.Foundation.HRESULT DiscardUndoState();

								[PreserveSig()]
winmdroot.Foundation.HRESULT DeactivateAndUndo();

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT OnPosRectChange(winmdroot.Foundation.RECT* lprcPosRect);
			}
		}
	}
}