File: Windows.Win32.IViewObject.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("0000010D-0000-0000-C000-000000000046")]
		[SupportedOSPlatform("windows5.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IViewObject
			:IVTable<IViewObject,IViewObject.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]<IViewObject*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IViewObject*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="Draw(winmdroot.System.Com.DVASPECT, int, void*, winmdroot.System.Com.DVTARGETDEVICE*, winmdroot.Graphics.Gdi.HDC, winmdroot.Graphics.Gdi.HDC, winmdroot.Foundation.RECTL*, winmdroot.Foundation.RECTL*, nint, nuint)"/>
			internal unsafe void Draw(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hdcTargetDev, winmdroot.Graphics.Gdi.HDC hdcDraw, winmdroot.Foundation.RECTL? lprcBounds, winmdroot.Foundation.RECTL? lprcWBounds, nint pfnContinue, nuint dwContinue)
			{
				winmdroot.Foundation.RECTL lprcBoundsLocal = lprcBounds ?? default(winmdroot.Foundation.RECTL);
				winmdroot.Foundation.RECTL lprcWBoundsLocal = lprcWBounds ?? default(winmdroot.Foundation.RECTL);
				this.Draw(dwDrawAspect, lindex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds.HasValue ? &lprcBoundsLocal : null, lprcWBounds.HasValue ? &lprcWBoundsLocal : null, pfnContinue, dwContinue);
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Draw(IViewObject* pThis, winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, [Optional] winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hdcTargetDev, winmdroot.Graphics.Gdi.HDC hdcDraw, [Optional] winmdroot.Foundation.RECTL* lprcBounds, [Optional] winmdroot.Foundation.RECTL* lprcWBounds, nint pfnContinue, nuint dwContinue)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Draw(dwDrawAspect, lindex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Draws a representation of an object onto the specified device context.</summary>
			/// <param name="dwDrawAspect">Specifies the aspect to be drawn, that is, how the object is to be represented. Representations include content, an icon, a thumbnail, or a printed document. Valid values are taken from the enumerations <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> and <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ne-ocidl-dvaspect2">DVASPECT2</a>. Note that newer objects and containers that support optimized drawing interfaces support the <b>DVASPECT2</b> enumeration values. Older objects and containers that do not support optimized drawing interfaces may not support <b>DVASPECT2</b>. Windowless objects allow only <b>DVASPECT</b>_CONTENT, <b>DVASPECT</b>_OPAQUE, and <b>DVASPECT</b>_TRANSPARENT.</param>
			/// <param name="lindex">Portion of the object that is of interest for the draw operation. Its interpretation varies depending on the value in the dwAspect parameter. See the <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> enumeration for more information.</param>
			/// <param name="pvAspect">Pointer to additional information in a <a href="https://docs.microsoft.com/windows/win32/api/ocidl/ns-ocidl-dvaspectinfo">DVASPECTINFO</a> structure that enables drawing optimizations depending on the aspect specified. Note that newer objects and containers that support optimized drawing interfaces support this parameter as well. Older objects and containers that do not support optimized drawing interfaces always specify <b>NULL</b> for this parameter.</param>
			/// <param name="ptd">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-dvtargetdevice">DVTARGETDEVICE</a> structure that describes the device for which the object is to be rendered. If <b>NULL</b>, the view should be rendered for the default target device (typically the display). A value other than <b>NULL</b> is interpreted in conjunction with <i>hdcTargetDev</i> and <i>hdcDraw</i>. For example, if <i>hdcDraw</i> specifies a printer as the device context, the <i>ptd</i> parameter points to a structure describing that printer device. The data may actually be printed if <i>hdcTargetDev</i> is a valid value or it may be displayed in print preview mode if <i>hdcTargetDev</i> is <b>NULL</b>.</param>
			/// <param name="hdcTargetDev">Information context for the target device indicated by the ptd parameter from which the object can extract device metrics and test the device's capabilities. If <i>ptd</i> is <b>NULL</b>; the object should ignore the value in the <i>hdcTargetDev</i> parameter.</param>
			/// <param name="hdcDraw">Device context on which to draw. For a windowless object, the <i>hdcDraw</i> parameter should be in MM_TEXT mapping mode with its logical coordinates matching the client coordinates of the containing window. For a windowless object, the device context should be in the same state as the one normally passed by a WM_PAINT message.</param>
			/// <param name="lprcBounds">Pointer to a RECTL structure specifying the rectangle on <i>hdcDraw</i> and in which the object should be drawn. This parameter controls the positioning and stretching of the object. This parameter should be <b>NULL</b> to draw a windowless in-place active object. In every other situation, <b>NULL</b> is not a legal value and should result in an E_INVALIDARG error code. If the container passes a non-<b>NULL</b> value to a windowless object, the object should render the requested aspect into the specified device context and rectangle. A container can request this from a windowless object to render a second, non-active view of the object or to print the object.</param>
			/// <param name="lprcWBounds">
			/// <para>If <i>hdcDraw</i> is a metafile device context, pointer to a RECTL structure specifying the bounding rectangle in the underlying metafile. The rectangle structure contains the window extent and window origin. These values are useful for drawing metafiles. The rectangle indicated by <i>lprcBounds</i> is nested inside this <i>lprcWBounds</i> rectangle; they are in the same coordinate space. If <i>hdcDraw</i> is not a metafile device context; <i>lprcWBounds</i> will be <b>NULL</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-draw#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="pfnContinue">Pointer to a callback function that the view object should call periodically during a lengthy drawing operation to determine whether the operation should continue or be canceled. This function returns <b>TRUE</b> to continue drawing. It returns <b>FALSE</b> to stop the drawing in which case <b>IViewObject::Draw</b> returns DRAW_E_ABORT.</param>
			/// <param name="dwContinue">Value to pass as a parameter to the function pointed to by the <i>pfnContinue</i> parameter. Typically, <i>dwContinue</i> is a pointer to an application-defined structure needed inside the callback function.</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>A container application issues a call to <b>IViewObject::Draw</b> to create a representation of a contained object. This method draws the specified piece (<i>lindex</i>) of the specified view (<i>dwAspect</i> and <i>pvAspect</i>) on the specified device context (<i>hdcDraw</i>). Formatting, fonts, and other rendering decisions are made on the basis of the target device specified by the ptd parameter. There is a relationship between the <i>dwDrawAspect</i> value and the <i>lprcbounds</i> value. The <i>lprcbounds</i> value specifies the rectangle on <i>hdcDraw</i> into which the drawing is to be mapped. For <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a>_THUMBNAIL, <b>DVASPECT</b>_ICON, and <b>DVASPECT</b>_SMALLICON, the object draws whatever it wants to draw, and it maps it into the space given in the best way. Some objects might scale to fit while some might scale to fit but preserve the aspect ratio. In addition, some might scale so the drawing appears at full width, but the bottom is cropped. The container can suggest a size via <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-setextent">IOleObject::SetExtent</a>, but it has no control over the rendering size. In the case of <b>DVASPECT</b>_CONTENT, the <b>IViewObject::Draw</b> implementation should either use the extents given by <b>IOleObject::SetExtent</b> or use the bounding rectangle given in the <i>lprcBounds</i> parameter. For newer objects that support optimized drawing techniques and for windowless objects, this method should be used as follows: </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-draw#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void Draw(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, [Optional] winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hdcTargetDev, winmdroot.Graphics.Gdi.HDC hdcDraw, [Optional] winmdroot.Foundation.RECTL* lprcBounds, [Optional] winmdroot.Foundation.RECTL* lprcWBounds, nint pfnContinue, nuint dwContinue)
			{
				((delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,int ,void* ,winmdroot.System.Com.DVTARGETDEVICE* ,winmdroot.Graphics.Gdi.HDC ,winmdroot.Graphics.Gdi.HDC ,winmdroot.Foundation.RECTL* ,winmdroot.Foundation.RECTL* ,nint ,nuint ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IViewObject*)Unsafe.AsPointer(ref this), dwDrawAspect, lindex, pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue, dwContinue).ThrowOnFailure();
			}

			/// <inheritdoc cref="GetColorSet(winmdroot.System.Com.DVASPECT, int, void*, winmdroot.System.Com.DVTARGETDEVICE*, winmdroot.Graphics.Gdi.HDC, winmdroot.Graphics.Gdi.LOGPALETTE**)"/>
			internal unsafe void GetColorSet(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hicTargetDev, out winmdroot.Graphics.Gdi.LOGPALETTE* ppColorSet)
			{
				fixed (winmdroot.Graphics.Gdi.LOGPALETTE** ppColorSetLocal = &ppColorSet)
				{
					this.GetColorSet(dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSetLocal);
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetColorSet(IViewObject* pThis, winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, [Optional] winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hicTargetDev, winmdroot.Graphics.Gdi.LOGPALETTE** ppColorSet)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetColorSet(dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Returns the logical palette that the object will use for drawing in its IViewObject::Draw method with the corresponding parameters.</summary>
			/// <param name="dwDrawAspect">Specifies how the object is to be represented. Representations include content, an icon, a thumbnail, or a printed document. Valid values are taken from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a>. See the <b>DVASPECT</b> enumeration for more information.</param>
			/// <param name="lindex">Portion of the object that is of interest for the draw operation. Its interpretation varies with <i>dwDrawAspect</i>. See the <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> enumeration for more information.</param>
			/// <param name="pvAspect">Pointer to additional information about the view of the object specified in <i>dwDrawAspect</i>. Since none of the current aspects support additional information, <i>pvAspect</i> must always be <b>NULL</b>.</param>
			/// <param name="ptd">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ns-objidl-dvtargetdevice">DVTARGETDEVICE</a> structure that describes the device for which the object is to be rendered. If <b>NULL</b>, the view should be rendered for the default target device (typically the display). A value other than <b>NULL</b> is interpreted in conjunction with <i>hicTargetDev</i> and <i>hdcDraw</i>. For example, if <i>hdcDraw</i> specifies a printer as the device context, ptd points to a structure describing that printer device. The data may actually be printed if <i>hicTargetDev</i> is a valid value or it may be displayed in print preview mode if <i>hicTargetDev</i> is <b>NULL</b>.</param>
			/// <param name="hicTargetDev">Information context for the target device indicated by the <i>ptd</i> parameter from which the object can extract device metrics and test the device's capabilities. If <i>ptd</i> is <b>NULL</b>, the object should ignore the <i>hicTargetDev</i> parameter.</param>
			/// <param name="ppColorSet">Address of LOGPALETTE pointer variable that receives a pointer to the LOGPALETTE structure. The LOGPALETTE structure contains the set of colors that would be used if <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-draw">IViewObject::Draw</a> were called with the same parameters for <i>dwAspect</i>, <i>lindex</i>, <i>pvAspect</i>, <i>ptd</i>, and <i>hicTargetDev</i>. If <i>ppColorSet</i> is <b>NULL</b>, the object does not use a palette.</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 <b>IViewObject::GetColorSet</b> method recursively queries any nested objects and returns a color set that represents the union of all colors requested. The color set eventually percolates to the top-level container that owns the window frame. This container can call <b>IViewObject::GetColorSet</b> on each of its embedded objects to obtain all the colors needed to draw the embedded objects. The container can use the color sets obtained in conjunction with other colors it needs for itself to set the overall color palette. The OLE-provided implementation of <b>IViewObject::GetColorSet</b> looks at the data it has on hand to draw the picture. If CF_DIB is the drawing format, the palette found in the bitmap is used. For a regular bitmap, no color information is returned. If the drawing format is a metafile, the object handler enumerates the metafile looking for a CreatePalette metafile record. If one is found, the handler uses it as the color set.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-getcolorset#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void GetColorSet(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, [Optional] winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hicTargetDev, winmdroot.Graphics.Gdi.LOGPALETTE** ppColorSet)
			{
				((delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,int ,void* ,winmdroot.System.Com.DVTARGETDEVICE* ,winmdroot.Graphics.Gdi.HDC ,winmdroot.Graphics.Gdi.LOGPALETTE** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IViewObject*)Unsafe.AsPointer(ref this), dwDrawAspect, lindex, pvAspect, ptd, hicTargetDev, ppColorSet).ThrowOnFailure();
			}

			/// <inheritdoc cref="Freeze(winmdroot.System.Com.DVASPECT, int, void*, uint*)"/>
			internal unsafe void Freeze(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, out uint pdwFreeze)
			{
				fixed (uint* pdwFreezeLocal = &pdwFreeze)
				{
					this.Freeze(dwDrawAspect, lindex, pvAspect, pdwFreezeLocal);
				}
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT Freeze(IViewObject* pThis, winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, uint* pdwFreeze)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.Freeze(dwDrawAspect, lindex, pvAspect, pdwFreeze);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Freezes the drawn representation of an object so that it will not change until the IViewObject::Unfreeze method is called. The most common use of this method is for banded printing.</summary>
			/// <param name="dwDrawAspect">Specifies how the object is to be represented. Representations include content, an icon, a thumbnail, or a printed document. Valid values are taken from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a>. See the <b>DVASPECT</b> enumeration for more information.</param>
			/// <param name="lindex">Portion of the object that is of interest for the draw operation. Its interpretation varies with dwAspect. See the <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a> enumeration for more information.</param>
			/// <param name="pvAspect">Pointer to additional information about the view of the object specified in <i>dwAspect</i>. Since none of the current aspects support additional information, <i>pvAspect</i> must always be <b>NULL</b>.</param>
			/// <param name="pdwFreeze">Pointer to where an identifying DWORD key is returned. This unique key is later used to cancel the freeze by calling <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-unfreeze">IViewObject::Unfreeze</a>. This key is an index that the default cache uses to keep track of which object is frozen.</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 <b>IViewObject::Freeze</b> method causes the view object to freeze its drawn representation until a subsequent call to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-unfreeze">IViewObject::Unfreeze</a> releases it. After calling <b>IViewObject::Freeze</b>, successive calls to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-draw">IViewObject::Draw</a> with the same parameters produce the same picture until <b>IViewObject::Unfreeze</b> is called. <b>IViewObject::Freeze</b> is not part of the persistent state of the object and does not continue across unloads and reloads of the object. The most common use of this method is for banded printing. While in a frozen state, view notifications are not sent. Pending view notifications are deferred to the subsequent call to <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-unfreeze">IViewObject::Unfreeze</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-freeze#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void Freeze(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, uint* pdwFreeze)
			{
				((delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,int ,void* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IViewObject*)Unsafe.AsPointer(ref this), dwDrawAspect, lindex, pvAspect, pdwFreeze).ThrowOnFailure();
			}

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

			/// <summary>Releases a drawing that was previously frozen using IViewObject::Freeze. The most common use of this method is for banded printing.</summary>
			/// <param name="dwFreeze">Contains a key previously returned from <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-freeze">IViewObject::Freeze</a> that determines which view object to unfreeze.</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><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-unfreeze">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public void Unfreeze(uint dwFreeze)
			{
				((delegate *unmanaged [Stdcall]<IViewObject*,uint ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IViewObject*)Unsafe.AsPointer(ref this), dwFreeze).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT SetAdvise(IViewObject* pThis, winmdroot.System.Com.DVASPECT aspects, uint advf, winmdroot.System.Com.IAdviseSink* pAdvSink)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.SetAdvise(aspects, advf, pAdvSink);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Establishes a connection between the view object and an advise sink so that the advise sink can be notified about changes in the object's view.</summary>
			/// <param name="aspects">View for which the advisory connection is being set up. Valid values are taken from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/wtypes/ne-wtypes-dvaspect">DVASPECT</a>. See the <b>DVASPECT</b> enumeration for more information.</param>
			/// <param name="advf">
			/// <para>Contains a group of flags for controlling the advisory connection. Valid values are from the enumeration <a href="https://docs.microsoft.com/windows/desktop/api/objidl/ne-objidl-advf">ADVF</a>. However, only some of the possible <b>ADVF</b> values are relevant for this method. The following table briefly describes the relevant values. See the <b>ADVF</b> enumeration for a more detailed description. </para>
			/// <para>This doc was truncated.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-setadvise#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <param name="pAdvSink">Pointer to the <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-iadvisesink">IAdviseSink</a> interface on the advisory sink that is to be informed of changes. A <b>NULL</b> value deletes any existing advisory connection.</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>A container application that is requesting a draw operation on a view object can also register with the <b>IViewObject::SetAdvise</b> method to be notified when the presentation of the view object changes. To find out about when an object's underlying data changes, you must call <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-idataobject-dadvise">IDataObject::DAdvise</a> separately. To remove an existing advisory connection, call the <b>IViewObject::SetAdvise</b> method with <i>pAdvSink</i> set to <b>NULL</b>. If the view object changes, a call is made to the appropriate advise sink through its <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nf-objidl-iadvisesink-onviewchange">IAdviseSink::OnViewChange</a> method. At any time, a given view object can support only one advisory connection. Therefore, when <b>IViewObject::SetAdvise</b> is called and the view object is already holding on to an advise sink pointer, OLE releases the existing pointer before the new one is registered.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-setadvise#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void SetAdvise(winmdroot.System.Com.DVASPECT aspects, uint advf, winmdroot.System.Com.IAdviseSink* pAdvSink)
			{
				((delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,uint ,winmdroot.System.Com.IAdviseSink* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IViewObject*)Unsafe.AsPointer(ref this), aspects, advf, pAdvSink).ThrowOnFailure();
			}

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetAdvise(IViewObject* pThis, [Optional] uint* pAspects, [Optional] uint* pAdvf, winmdroot.System.Com.IAdviseSink** ppAdvSink)
			{
				try
				{
					winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
					if (__hr.Failed)
					{
						return __hr;
					}
					return __object.GetAdvise(pAspects, pAdvf, ppAdvSink);
				}
				catch (Exception ex)
				{
					return (winmdroot.Foundation.HRESULT)ex.HResult;
				}
			}

			/// <summary>Retrieves the advisory connection on the object that was used in the most recent call to IViewObject::SetAdvise.</summary>
			/// <param name="pAspects">Pointer to where the <i>dwAspect</i> parameter from the previous <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-setadvise">IViewObject::SetAdvise</a> call is returned. If this pointer is <b>NULL</b>, the caller does not permit this value to be returned.</param>
			/// <param name="pAdvf">Pointer to where the <i>advf</i> parameter from the previous <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-setadvise">IViewObject::SetAdvise</a> call is returned. If this pointer is <b>NULL</b>, the caller does not permit this value to be returned.</param>
			/// <param name="ppAdvSink">Address of <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-iadvisesink">IAdviseSink</a> pointer variable that receives the interface pointer to the advise sink. The connection to this advise sink must have been established with a previous <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-iviewobject-setadvise">IViewObject::SetAdvise</a> call, which provides the <i>pAdvSink</i> parameter. If <i>ppvAdvSink</i> is <b>NULL</b>, there is no established advisory connection.</param>
			/// <returns>This method returns S_OK on success.</returns>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-iviewobject-getadvise">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe void GetAdvise([Optional] uint* pAspects, [Optional] uint* pAdvf, winmdroot.System.Com.IAdviseSink** ppAdvSink)
			{
				((delegate *unmanaged [Stdcall]<IViewObject*,uint* ,uint* ,winmdroot.System.Com.IAdviseSink** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IViewObject*)Unsafe.AsPointer(ref this), pAspects, pAdvf, ppAdvSink).ThrowOnFailure();
			}

			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]<IViewObject*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,int ,void* ,winmdroot.System.Com.DVTARGETDEVICE* ,winmdroot.Graphics.Gdi.HDC ,winmdroot.Graphics.Gdi.HDC ,winmdroot.Foundation.RECTL* ,winmdroot.Foundation.RECTL* ,nint ,nuint ,winmdroot.Foundation.HRESULT> Draw_4;

				internal delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,int ,void* ,winmdroot.System.Com.DVTARGETDEVICE* ,winmdroot.Graphics.Gdi.HDC ,winmdroot.Graphics.Gdi.LOGPALETTE** ,winmdroot.Foundation.HRESULT> GetColorSet_5;

				internal delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,int ,void* ,uint* ,winmdroot.Foundation.HRESULT> Freeze_6;

				internal delegate *unmanaged [Stdcall]<IViewObject*,uint ,winmdroot.Foundation.HRESULT> Unfreeze_7;

				internal delegate *unmanaged [Stdcall]<IViewObject*,winmdroot.System.Com.DVASPECT ,uint ,winmdroot.System.Com.IAdviseSink* ,winmdroot.Foundation.HRESULT> SetAdvise_8;

				internal delegate *unmanaged [Stdcall]<IViewObject*,uint* ,uint* ,winmdroot.System.Com.IAdviseSink** ,winmdroot.Foundation.HRESULT> GetAdvise_9;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->Draw_4 = &Draw;
				vtable->GetColorSet_5 = &GetColorSet;
				vtable->Freeze_6 = &Freeze;
				vtable->Unfreeze_7 = &Unfreeze;
				vtable->SetAdvise_8 = &SetAdvise;
				vtable->GetAdvise_9 = &GetAdvise;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{0000010d-0000-0000-c000-000000000046}</value>
			internal static readonly Guid IID_Guid = new Guid(0x0000010D, 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[]					{
0x0D,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("0000010D-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.0")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Draw(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, [Optional] winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hdcTargetDev, winmdroot.Graphics.Gdi.HDC hdcDraw, [Optional] winmdroot.Foundation.RECTL* lprcBounds, [Optional] winmdroot.Foundation.RECTL* lprcWBounds, nint pfnContinue, nuint dwContinue);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetColorSet(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, [Optional] winmdroot.System.Com.DVTARGETDEVICE* ptd, winmdroot.Graphics.Gdi.HDC hicTargetDev, winmdroot.Graphics.Gdi.LOGPALETTE** ppColorSet);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Freeze(winmdroot.System.Com.DVASPECT dwDrawAspect, int lindex, void* pvAspect, uint* pdwFreeze);

								[PreserveSig()]
winmdroot.Foundation.HRESULT Unfreeze(uint dwFreeze);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT SetAdvise(winmdroot.System.Com.DVASPECT aspects, uint advf, winmdroot.System.Com.IAdviseSink* pAdvSink);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetAdvise([Optional] uint* pAspects, [Optional] uint* pAdvf, winmdroot.System.Com.IAdviseSink** ppAdvSink);
			}
		}
	}
}