File: Windows.Win32.ISelectionProvider.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("FB8B03AF-3BDF-48D4-BD36-1A65793BE168")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct ISelectionProvider
			:IVTable<ISelectionProvider,ISelectionProvider.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]<ISelectionProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((ISelectionProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

			/// <summary>Retrieves a Microsoft UI Automation provider for each child element that is selected.</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>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iselectionprovider-getselection">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.System.Com.SAFEARRAY* GetSelection()
			{
				winmdroot.System.Com.SAFEARRAY* __retVal = default(winmdroot.System.Com.SAFEARRAY*);
				((delegate *unmanaged [Stdcall]<ISelectionProvider*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((ISelectionProvider*)Unsafe.AsPointer(ref this), &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

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

			/// <summary>Indicates whether the Microsoft UI Automation provider allows more than one child element to be selected concurrently.</summary>
			/// <remarks>
			/// <para>This property may be dynamic. For example, in rare cases a control might allow multiple items to be selected on initialization but subsequently allow only single selections to be made.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iselectionprovider-get_canselectmultiple#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT get_CanSelectMultiple(winmdroot.Foundation.BOOL* pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<ISelectionProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((ISelectionProvider*)Unsafe.AsPointer(ref this), pRetVal);
			}

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

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

			/// <summary>Indicates whether the Microsoft UI Automation provider requires at least one child element to be selected.</summary>
			/// <remarks>
			/// <para>This property can be dynamic. For example, the initial state of a control might not have any items selected by default, meaning that <b>ISelectionProvider::IsSelectionRequired</b> is <b>FALSE</b>. However, after an item is selected the control must always have at least one item selected.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iselectionprovider-get_isselectionrequired#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT get_IsSelectionRequired(winmdroot.Foundation.BOOL* pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<ISelectionProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((ISelectionProvider*)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]<ISelectionProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<ISelectionProvider*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT> GetSelection_4;

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

				internal delegate *unmanaged [Stdcall]<ISelectionProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT> get_IsSelectionRequired_6;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetSelection_4 = &GetSelection;
				vtable->get_CanSelectMultiple_5 = &get_CanSelectMultiple;
				vtable->get_IsSelectionRequired_6 = &get_IsSelectionRequired;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{fb8b03af-3bdf-48d4-bd36-1a65793be168}</value>
			internal static readonly Guid IID_Guid = new Guid(0xFB8B03AF, 0x3BDF, 0x48D4, 0xBD, 0x36, 0x1A, 0x65, 0x79, 0x3B, 0xE1, 0x68);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xAF,0x03,0x8B,0xFB,0xDF,0x3B,0xD4,0x48,0xBD,0x36,0x1A,0x65,0x79,0x3B,0xE1,0x68					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("FB8B03AF-3BDF-48D4-BD36-1A65793BE168"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetSelection(winmdroot.System.Com.SAFEARRAY** pRetVal);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT get_CanSelectMultiple(winmdroot.Foundation.BOOL* pRetVal);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT get_IsSelectionRequired(winmdroot.Foundation.BOOL* pRetVal);
			}
		}
	}
}