File: Windows.Win32.ITextProvider2.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("0DC5E6ED-3E16-4BF1-8F9A-A979878BC195")]
		[SupportedOSPlatform("windows8.0")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct ITextProvider2
			:IVTable<ITextProvider2,ITextProvider2.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]<ITextProvider2*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((ITextProvider2*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
			private static winmdroot.Foundation.HRESULT GetSelection(ITextProvider2* 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;
				}
			}

			public unsafe winmdroot.System.Com.SAFEARRAY* GetSelection()
			{
				winmdroot.System.Com.SAFEARRAY* __retVal = default(winmdroot.System.Com.SAFEARRAY*);
				((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((ITextProvider2*)Unsafe.AsPointer(ref this), &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

			public unsafe winmdroot.System.Com.SAFEARRAY* GetVisibleRanges()
			{
				winmdroot.System.Com.SAFEARRAY* __retVal = default(winmdroot.System.Com.SAFEARRAY*);
				((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.System.Com.SAFEARRAY** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((ITextProvider2*)Unsafe.AsPointer(ref this), &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

			public unsafe winmdroot.UI.Accessibility.ITextRangeProvider* RangeFromChild(winmdroot.UI.Accessibility.IRawElementProviderSimple* childElement)
			{
				winmdroot.UI.Accessibility.ITextRangeProvider* __retVal = default(winmdroot.UI.Accessibility.ITextRangeProvider*);
				((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.IRawElementProviderSimple* ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((ITextProvider2*)Unsafe.AsPointer(ref this), childElement, &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

			public unsafe winmdroot.UI.Accessibility.ITextRangeProvider* RangeFromPoint(winmdroot.UI.Accessibility.UiaPoint point)
			{
				winmdroot.UI.Accessibility.ITextRangeProvider* __retVal = default(winmdroot.UI.Accessibility.ITextRangeProvider*);
				((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.UiaPoint ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((ITextProvider2*)Unsafe.AsPointer(ref this), point, &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

			internal unsafe winmdroot.UI.Accessibility.ITextRangeProvider* DocumentRange
			{
				get
				{
					winmdroot.UI.Accessibility.ITextRangeProvider* __result;
					((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((ITextProvider2*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
					return __result;
				}
			}

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

			internal winmdroot.UI.Accessibility.SupportedTextSelection SupportedTextSelection
			{
				get
				{
					winmdroot.UI.Accessibility.SupportedTextSelection __result;
					((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.SupportedTextSelection* ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((ITextProvider2*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
					return __result;
				}
			}

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

			/// <summary>Exposes a text range that contains the text that is the target of the annotation associated with the specified annotation element.</summary>
			/// <param name="annotationElement">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-irawelementprovidersimple">IRawElementProviderSimple</a>*</b> The provider for an element that implements the <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-iannotationprovider">IAnnotationProvider</a> interface. The annotation element is a sibling of the element that implements the <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-itextprovider2">ITextProvider2</a> interface for the document.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-itextprovider2-rangefromannotation#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><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-itextprovider2-rangefromannotation">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.UI.Accessibility.ITextRangeProvider* RangeFromAnnotation(winmdroot.UI.Accessibility.IRawElementProviderSimple* annotationElement)
			{
				winmdroot.UI.Accessibility.ITextRangeProvider* __retVal = default(winmdroot.UI.Accessibility.ITextRangeProvider*);
				((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.IRawElementProviderSimple* ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((ITextProvider2*)Unsafe.AsPointer(ref this), annotationElement, &__retVal).ThrowOnFailure();
				return __retVal;
			}

			/// <inheritdoc cref="GetCaretRange(winmdroot.Foundation.BOOL*)"/>
			internal unsafe winmdroot.UI.Accessibility.ITextRangeProvider* GetCaretRange(out winmdroot.Foundation.BOOL isActive)
			{
				fixed (winmdroot.Foundation.BOOL* isActiveLocal = &isActive)
				{
					winmdroot.UI.Accessibility.ITextRangeProvider* __result = this.GetCaretRange(isActiveLocal);
					return __result;
				}
			}

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

			/// <summary>Provides a zero-length text range at the location of the caret that belongs to the text-based control.</summary>
			/// <param name="isActive">
			/// <para>Type: <b>BOOL*</b> <b>TRUE</b> if the text-based control that contains the caret has keyboard focus, otherwise <b>FALSE</b>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-itextprovider2-getcaretrange#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>If the <i>isActive</i> parameter is <b>FALSE</b>, the caret that belongs to the text-based control might not be at the same location as the system caret. This method retrieves a text range that a client can use to find the bounding rectangle of the caret that belongs to the text-based control, or to find the text near the caret.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-itextprovider2-getcaretrange#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.UI.Accessibility.ITextRangeProvider* GetCaretRange(winmdroot.Foundation.BOOL* isActive)
			{
				winmdroot.UI.Accessibility.ITextRangeProvider* __retVal = default(winmdroot.UI.Accessibility.ITextRangeProvider*);
				((delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.Foundation.BOOL* ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((ITextProvider2*)Unsafe.AsPointer(ref this), isActive, &__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]<ITextProvider2*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

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

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

				internal delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.IRawElementProviderSimple* ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT> RangeFromChild_6;

				internal delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.UiaPoint ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT> RangeFromPoint_7;

				internal delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT> get_DocumentRange_8;

				internal delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.SupportedTextSelection* ,winmdroot.Foundation.HRESULT> get_SupportedTextSelection_9;

				internal delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.UI.Accessibility.IRawElementProviderSimple* ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT> RangeFromAnnotation_10;

				internal delegate *unmanaged [Stdcall]<ITextProvider2*,winmdroot.Foundation.BOOL* ,winmdroot.UI.Accessibility.ITextRangeProvider** ,winmdroot.Foundation.HRESULT> GetCaretRange_11;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->GetSelection_4 = &GetSelection;
				vtable->GetVisibleRanges_5 = &GetVisibleRanges;
				vtable->RangeFromChild_6 = &RangeFromChild;
				vtable->RangeFromPoint_7 = &RangeFromPoint;
				vtable->get_DocumentRange_8 = &get_DocumentRange;
				vtable->get_SupportedTextSelection_9 = &get_SupportedTextSelection;
				vtable->RangeFromAnnotation_10 = &RangeFromAnnotation;
				vtable->GetCaretRange_11 = &GetCaretRange;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{0dc5e6ed-3e16-4bf1-8f9a-a979878bc195}</value>
			internal static readonly Guid IID_Guid = new Guid(0x0DC5E6ED, 0x3E16, 0x4BF1, 0x8F, 0x9A, 0xA9, 0x79, 0x87, 0x8B, 0xC1, 0x95);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xED,0xE6,0xC5,0x0D,0x16,0x3E,0xF1,0x4B,0x8F,0x9A,0xA9,0x79,0x87,0x8B,0xC1,0x95					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("0DC5E6ED-3E16-4BF1-8F9A-A979878BC195"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows8.0")]
			internal interface Interface
				:winmdroot.UI.Accessibility.ITextProvider.Interface			{
				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT GetSelection(winmdroot.System.Com.SAFEARRAY** pRetVal);

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

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT RangeFromChild(winmdroot.UI.Accessibility.IRawElementProviderSimple* childElement, winmdroot.UI.Accessibility.ITextRangeProvider** pRetVal);

				[PreserveSig()]
				unsafe new winmdroot.Foundation.HRESULT RangeFromPoint(winmdroot.UI.Accessibility.UiaPoint point, winmdroot.UI.Accessibility.ITextRangeProvider** pRetVal);

				unsafe new winmdroot.UI.Accessibility.ITextRangeProvider* DocumentRange
				{
					get;
				}

				new winmdroot.UI.Accessibility.SupportedTextSelection SupportedTextSelection
				{
					get;
				}

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT RangeFromAnnotation(winmdroot.UI.Accessibility.IRawElementProviderSimple* annotationElement, winmdroot.UI.Accessibility.ITextRangeProvider** pRetVal);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT GetCaretRange(winmdroot.Foundation.BOOL* isActive, winmdroot.UI.Accessibility.ITextRangeProvider** pRetVal);
			}
		}
	}
}