File: Windows.Win32.IExpandCollapseProvider.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 UI.Accessibility
	{
		[Guid("D847D3A5-CAB0-4A98-8C32-ECB45C59AD24")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IExpandCollapseProvider
			:IVTable<IExpandCollapseProvider,IExpandCollapseProvider.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]<IExpandCollapseProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IExpandCollapseProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

			/// <summary>Displays all child nodes, controls, or content of the control.</summary>
			/// <returns>
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para>
			/// </returns>
			/// <remarks>This is a blocking method that returns after the control has been expanded.</remarks>
			public void Expand()
			{
				((delegate *unmanaged [Stdcall]<IExpandCollapseProvider*,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IExpandCollapseProvider*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

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

			/// <summary>Hides all child nodes, controls, or content of this element.</summary>
			/// <returns>
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">HRESULT</a></b> If this method succeeds, it returns <b>S_OK</b>. Otherwise, it returns an <b>HRESULT</b> error code.</para>
			/// </returns>
			/// <remarks>This is a blocking method that returns after the element has been collapsed.</remarks>
			public void Collapse()
			{
				((delegate *unmanaged [Stdcall]<IExpandCollapseProvider*,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IExpandCollapseProvider*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
			}

			/// <inheritdoc cref="get_ExpandCollapseState(winmdroot.UI.Accessibility.ExpandCollapseState*)"/>
			internal unsafe winmdroot.Foundation.HRESULT get_ExpandCollapseState(out winmdroot.UI.Accessibility.ExpandCollapseState pRetVal)
			{
				fixed (winmdroot.UI.Accessibility.ExpandCollapseState* pRetValLocal = &pRetVal)
				{
					winmdroot.Foundation.HRESULT __result = this.get_ExpandCollapseState(pRetValLocal);
					return __result;
				}
			}

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

			/// <summary>Indicates the state, expanded or collapsed, of the control.</summary>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iexpandcollapseprovider-get_expandcollapsestate">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT get_ExpandCollapseState(winmdroot.UI.Accessibility.ExpandCollapseState* pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IExpandCollapseProvider*,winmdroot.UI.Accessibility.ExpandCollapseState* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IExpandCollapseProvider*)Unsafe.AsPointer(ref this), pRetVal);
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IExpandCollapseProvider*,winmdroot.Foundation.HRESULT> Expand_4;

				internal delegate *unmanaged [Stdcall]<IExpandCollapseProvider*,winmdroot.Foundation.HRESULT> Collapse_5;

				internal delegate *unmanaged [Stdcall]<IExpandCollapseProvider*,winmdroot.UI.Accessibility.ExpandCollapseState* ,winmdroot.Foundation.HRESULT> get_ExpandCollapseState_6;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->Expand_4 = &Expand;
				vtable->Collapse_5 = &Collapse;
				vtable->get_ExpandCollapseState_6 = &get_ExpandCollapseState;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{d847d3a5-cab0-4a98-8c32-ecb45c59ad24}</value>
			internal static readonly Guid IID_Guid = new Guid(0xD847D3A5, 0xCAB0, 0x4A98, 0x8C, 0x32, 0xEC, 0xB4, 0x5C, 0x59, 0xAD, 0x24);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xA5,0xD3,0x47,0xD8,0xB0,0xCA,0x98,0x4A,0x8C,0x32,0xEC,0xB4,0x5C,0x59,0xAD,0x24					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("D847D3A5-CAB0-4A98-8C32-ECB45C59AD24"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
								[PreserveSig()]
winmdroot.Foundation.HRESULT Expand();

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

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT get_ExpandCollapseState(winmdroot.UI.Accessibility.ExpandCollapseState* pRetVal);
			}
		}
	}
}