File: Windows.Win32.IMultipleViewProvider.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("6278CAB1-B556-4A1A-B4E0-418ACC523201")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IMultipleViewProvider
			:IVTable<IMultipleViewProvider,IMultipleViewProvider.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]<IMultipleViewProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IMultipleViewProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

			/// <summary>Retrieves the name of a control-specific view. (IMultipleViewProvider.GetViewName)</summary>
			/// <param name="viewId">
			/// <para>Type: <b>int</b> A view identifier.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-getviewname#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <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>View identifiers can be retrieved by using <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-getsupportedviews">IMultipleViewProvider::GetSupportedViews</a>.</para>
			/// <para>The collection of view identifiers must be identical for all instances of a control.</para>
			/// <para>View names must be suitable for use in text-to-speech, Braille, and other accessible applications.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-getviewname#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.BSTR GetViewName(int viewId)
			{
				winmdroot.Foundation.BSTR __retVal = default(winmdroot.Foundation.BSTR);
				((delegate *unmanaged [Stdcall]<IMultipleViewProvider*,int ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IMultipleViewProvider*)Unsafe.AsPointer(ref this), viewId, &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

			/// <summary>Sets the current control-specific view.</summary>
			/// <param name="viewId">
			/// <para>Type: <b>int</b> A view identifier.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-setcurrentview#parameters">Read more on docs.microsoft.com</see>.</para>
			/// </param>
			/// <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>View identifiers can be retrieved by using <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-getsupportedviews">IMultipleViewProvider::GetSupportedViews</a>.</para>
			/// <para>The collection of view identifiers must be identical for all instances of a control.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-setcurrentview#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void SetCurrentView(int viewId)
			{
				((delegate *unmanaged [Stdcall]<IMultipleViewProvider*,int ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IMultipleViewProvider*)Unsafe.AsPointer(ref this), viewId).ThrowOnFailure();
			}

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

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

			/// <summary>Identifies the current view that the control is using to display information or child controls.</summary>
			/// <remarks>The collection of view identifiers must be identical for all instances of a control.</remarks>
			public unsafe winmdroot.Foundation.HRESULT get_CurrentView(int* pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IMultipleViewProvider*,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IMultipleViewProvider*)Unsafe.AsPointer(ref this), pRetVal);
			}

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

			/// <summary>Retrieves a collection of control-specific view identifiers. (IMultipleViewProvider.GetSupportedViews)</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>An empty array is returned by UIAutoCore.dll if the provider does not supply any view identifiers.</para>
			/// <para>The collection of view identifiers must be identical for all instances of a control.</para>
			/// <para>View identifier values can be passed to <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-getviewname">IMultipleViewProvider::GetViewName</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-imultipleviewprovider-getsupportedviews#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.System.Com.SAFEARRAY* GetSupportedViews()
			{
				winmdroot.System.Com.SAFEARRAY* __retVal = default(winmdroot.System.Com.SAFEARRAY*);
				((delegate *unmanaged [Stdcall]<IMultipleViewProvider*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IMultipleViewProvider*)Unsafe.AsPointer(ref this), &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

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

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

				internal delegate *unmanaged [Stdcall]<IMultipleViewProvider*,int ,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetViewName_4;

				internal delegate *unmanaged [Stdcall]<IMultipleViewProvider*,int ,winmdroot.Foundation.HRESULT> SetCurrentView_5;

				internal delegate *unmanaged [Stdcall]<IMultipleViewProvider*,int* ,winmdroot.Foundation.HRESULT> get_CurrentView_6;

				internal delegate *unmanaged [Stdcall]<IMultipleViewProvider*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT> GetSupportedViews_7;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetViewName_4 = &GetViewName;
				vtable->SetCurrentView_5 = &SetCurrentView;
				vtable->get_CurrentView_6 = &get_CurrentView;
				vtable->GetSupportedViews_7 = &GetSupportedViews;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{6278cab1-b556-4a1a-b4e0-418acc523201}</value>
			internal static readonly Guid IID_Guid = new Guid(0x6278CAB1, 0xB556, 0x4A1A, 0xB4, 0xE0, 0x41, 0x8A, 0xCC, 0x52, 0x32, 0x01);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xB1,0xCA,0x78,0x62,0x56,0xB5,0x1A,0x4A,0xB4,0xE0,0x41,0x8A,0xCC,0x52,0x32,0x01					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("6278CAB1-B556-4A1A-B4E0-418ACC523201"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetViewName(int viewId, winmdroot.Foundation.BSTR* pRetVal);

								[PreserveSig()]
winmdroot.Foundation.HRESULT SetCurrentView(int viewId);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT get_CurrentView(int* pRetVal);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetSupportedViews(winmdroot.System.Com.SAFEARRAY** pRetVal);
			}
		}
	}
}