File: Windows.Win32.IRawElementProviderFragment.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("F7063DA8-8359-439C-9297-BBC5299A7D87")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IRawElementProviderFragment
			:IVTable<IRawElementProviderFragment,IRawElementProviderFragment.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]<IRawElementProviderFragment*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IRawElementProviderFragment*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

			/// <summary>Retrieves the Microsoft UI Automation element in a specified direction within the UI Automation tree.</summary>
			/// <param name="pRetVal">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-irawelementproviderfragment">IRawElementProviderFragment</a>**</b> Receives a pointer to the provider of the UI Automation element in the specified direction, or <b>NULL</b> if there is no element in that direction. This parameter is passed uninitialized.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-navigate#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>The UI Automation server's implementations of this method define the structure of the UI Automation tree. Navigation must be supported upward to the parent, downward to the first and last child, and laterally to the next and previous siblings, as applicable. Each child node has only one parent and must be placed in the chain of siblings reached from the parent by <b>NavigateDirection_FirstChild</b> and <b>NavigateDirection_LastChild</b>. Relationships among siblings must be identical in both directions: if A is B's previous sibling (<b>NavigateDirection_PreviousSibling</b>), then B is A's next sibling (<b>NavigateDirection_NextSibling</b>). A first child (<b>NavigateDirection_FirstChild</b>) has no previous sibling, and a last child  (<b>NavigateDirection_LastChild</b>) has no next sibling. Fragment roots do not enable navigation to a parent or siblings; navigation among fragment roots is handled by the default window providers. Elements in fragments must navigate only to other elements within that fragment.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-navigate#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT Navigate(winmdroot.UI.Accessibility.NavigateDirection direction, winmdroot.UI.Accessibility.IRawElementProviderFragment** pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.UI.Accessibility.NavigateDirection ,winmdroot.UI.Accessibility.IRawElementProviderFragment** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IRawElementProviderFragment*)Unsafe.AsPointer(ref this), direction, pRetVal);
			}

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

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

			/// <summary>Retrieves the runtime identifier of an element.</summary>
			/// <param name="pRetVal">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/win32/api/oaidl/ns-oaidl-safearray">SAFEARRAY</a>**</b> Receives a pointer to the runtime identifier. This parameter is passed uninitialized.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-getruntimeid#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>Implementations should return <b>NULL</b> for a top-level element that is hosted in a window. Other elements should return an array that contains <b>UiaAppendRuntimeId</b> (defined in Uiautomationcoreapi.h), followed by a value that is unique within an instance of the fragment.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-getruntimeid#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetRuntimeId(winmdroot.System.Com.SAFEARRAY** pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IRawElementProviderFragment*)Unsafe.AsPointer(ref this), pRetVal);
			}

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

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

			/// <summary>Specifies the bounding rectangle of this element.</summary>
			/// <remarks>
			/// <para>The bounding rectangle is defined by the location of the top left corner on the screen, and the dimensions. No clipping is required if the element is partly obscured or partly off-screen. The IsOffscreen property should be set to indicate whether the rectangle is actually visible. Not all points within the bounding rectangle are necessarily clickable.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-get_boundingrectangle#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT get_BoundingRectangle(winmdroot.UI.Accessibility.UiaRect* pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.UI.Accessibility.UiaRect* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IRawElementProviderFragment*)Unsafe.AsPointer(ref this), pRetVal);
			}

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

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

			/// <summary>Retrieves an array of root fragments that are embedded in the Microsoft UI Automation tree rooted at the current element.</summary>
			/// <param name="pRetVal">
			/// <para>Type: <b>SAFEARRAY**</b> Receives an array of pointers to the root fragments, or <b>NULL</b> (see Remarks). This parameter is passed uninitialized.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-getembeddedfragmentroots#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>This method returns an array of fragments only if the current element is hosting another automation framework. Most providers return <b>NULL</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-getembeddedfragmentroots#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT GetEmbeddedFragmentRoots(winmdroot.System.Com.SAFEARRAY** pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IRawElementProviderFragment*)Unsafe.AsPointer(ref this), pRetVal);
			}

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

			/// <summary>Sets the focus to 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>
			/// <para>The Microsoft UI Automation framework will ensure that the part of the interface that hosts this fragment is already focused before calling this method. Your implementation should update only its internal focus state; for example, by repainting a list item to show that it has the focus. If you prefer that UI Automation not focus the parent window, set <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/ne-uiautomationcore-provideroptions">ProviderOptions_ProviderOwnsSetFocus</a> in <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nf-uiautomationcore-irawelementprovidersimple-get_provideroptions">IRawElementProviderSimple::ProviderOptions</a> for the fragment root.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-setfocus#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public winmdroot.Foundation.HRESULT SetFocus()
			{
				return ((delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IRawElementProviderFragment*)Unsafe.AsPointer(ref this));
			}

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

			/// <summary>Specifies the root node of the fragment.</summary>
			/// <remarks>
			/// <para>A provider for a fragment root should return a pointer to its own implementation of <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-irawelementproviderfragmentroot">IRawElementProviderFragmentRoot</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-irawelementproviderfragment-get_fragmentroot#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT get_FragmentRoot(winmdroot.UI.Accessibility.IRawElementProviderFragmentRoot** pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.UI.Accessibility.IRawElementProviderFragmentRoot** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IRawElementProviderFragment*)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]<IRawElementProviderFragment*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.UI.Accessibility.NavigateDirection ,winmdroot.UI.Accessibility.IRawElementProviderFragment** ,winmdroot.Foundation.HRESULT> Navigate_4;

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

				internal delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.UI.Accessibility.UiaRect* ,winmdroot.Foundation.HRESULT> get_BoundingRectangle_6;

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

				internal delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.Foundation.HRESULT> SetFocus_8;

				internal delegate *unmanaged [Stdcall]<IRawElementProviderFragment*,winmdroot.UI.Accessibility.IRawElementProviderFragmentRoot** ,winmdroot.Foundation.HRESULT> get_FragmentRoot_9;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->Navigate_4 = &Navigate;
				vtable->GetRuntimeId_5 = &GetRuntimeId;
				vtable->get_BoundingRectangle_6 = &get_BoundingRectangle;
				vtable->GetEmbeddedFragmentRoots_7 = &GetEmbeddedFragmentRoots;
				vtable->SetFocus_8 = &SetFocus;
				vtable->get_FragmentRoot_9 = &get_FragmentRoot;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{f7063da8-8359-439c-9297-bbc5299a7d87}</value>
			internal static readonly Guid IID_Guid = new Guid(0xF7063DA8, 0x8359, 0x439C, 0x92, 0x97, 0xBB, 0xC5, 0x29, 0x9A, 0x7D, 0x87);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xA8,0x3D,0x06,0xF7,0x59,0x83,0x9C,0x43,0x92,0x97,0xBB,0xC5,0x29,0x9A,0x7D,0x87					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("F7063DA8-8359-439C-9297-BBC5299A7D87"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Navigate(winmdroot.UI.Accessibility.NavigateDirection direction, winmdroot.UI.Accessibility.IRawElementProviderFragment** pRetVal);

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

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT get_BoundingRectangle(winmdroot.UI.Accessibility.UiaRect* pRetVal);

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

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

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