File: Windows.Win32.IValueProvider.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("C7935180-6FB3-4201-B174-7DF73ADBF64A")]
		[SupportedOSPlatform("windows5.1.2600")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IValueProvider
			:IVTable<IValueProvider,IValueProvider.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]<IValueProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IValueProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

			/// <inheritdoc cref="SetValue(winmdroot.Foundation.PCWSTR)"/>
			internal unsafe void SetValue(string val)
			{
				fixed (char* valLocal = val)
				{
					this.SetValue(valLocal);
				}
			}

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

			/// <summary>Sets the value of control.</summary>
			/// <param name="val">
			/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">LPCWSTR</a></b> The value to set. The provider is responsible for converting the value to the appropriate data type.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-ivalueprovider-setvalue#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>Single-line edit controls support programmatic access to their contents by implementing <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-ivalueprovider">IValueProvider</a>. However, multi-line edit controls do not implement <b>IValueProvider</b>; instead they provide access to their content by implementing <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-itextprovider">ITextProvider</a>.</para>
			/// <para>Controls such as ListItem and TreeItem must implement <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-ivalueprovider">IValueProvider</a> if the value of any of the items is editable, regardless of the current edit mode of the control. The parent control must also implement <b>IValueProvider</b> if the child items are editable.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-ivalueprovider-setvalue#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public void SetValue(winmdroot.Foundation.PCWSTR val)
			{
				((delegate *unmanaged [Stdcall]<IValueProvider*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IValueProvider*)Unsafe.AsPointer(ref this), val).ThrowOnFailure();
			}

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

			/// <summary>The value of the control.</summary>
			/// <remarks>
			/// <para>Single-line edit controls support programmatic access to their contents by implementing <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-ivalueprovider">IValueProvider</a> (in addition to <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-itextprovider">ITextProvider</a>). However, multi-line edit controls do not implement <b>IValueProvider</b>.</para>
			/// <para>To retrieve the textual contents of multi-line edit controls, the controls must implement <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-itextprovider">ITextProvider</a>. However, <b>ITextProvider</b> does not support setting the value of a control.</para>
			/// <para><a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-ivalueprovider">IValueProvider</a> does not support the retrieval of formatting information or substring values. Implement <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nn-uiautomationcore-itextprovider">ITextProvider</a> in these scenarios.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-ivalueprovider-get_value#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT get_Value(winmdroot.Foundation.BSTR* pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IValueProvider*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IValueProvider*)Unsafe.AsPointer(ref this), pRetVal);
			}

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

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

			/// <summary>Indicates whether the value of a control is read-only. (IValueProvider.get_IsReadOnly)</summary>
			/// <remarks>
			/// <para>A control should have its IsEnabled property (<a href="https://docs.microsoft.com/windows/desktop/WinAuto/uiauto-automation-element-propids">UIA_IsEnabledPropertyId</a>) set to <b>TRUE</b> and its <b>IValueProvider::IsReadOnly</b> property set to <b>FALSE</b> before allowing a call to <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/nf-uiautomationcore-ivalueprovider-setvalue">IValueProvider::SetValue</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-ivalueprovider-get_isreadonly#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.Foundation.HRESULT get_IsReadOnly(winmdroot.Foundation.BOOL* pRetVal)
			{
				return ((delegate *unmanaged [Stdcall]<IValueProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IValueProvider*)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]<IValueProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IValueProvider*,winmdroot.Foundation.PCWSTR ,winmdroot.Foundation.HRESULT> SetValue_4;

				internal delegate *unmanaged [Stdcall]<IValueProvider*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> get_Value_5;

				internal delegate *unmanaged [Stdcall]<IValueProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT> get_IsReadOnly_6;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->SetValue_4 = &SetValue;
				vtable->get_Value_5 = &get_Value;
				vtable->get_IsReadOnly_6 = &get_IsReadOnly;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{c7935180-6fb3-4201-b174-7df73adbf64a}</value>
			internal static readonly Guid IID_Guid = new Guid(0xC7935180, 0x6FB3, 0x4201, 0xB1, 0x74, 0x7D, 0xF7, 0x3A, 0xDB, 0xF6, 0x4A);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0x80,0x51,0x93,0xC7,0xB3,0x6F,0x01,0x42,0xB1,0x74,0x7D,0xF7,0x3A,0xDB,0xF6,0x4A					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("C7935180-6FB3-4201-B174-7DF73ADBF64A"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows5.1.2600")]
			internal interface Interface
			{
								[PreserveSig()]
winmdroot.Foundation.HRESULT SetValue(winmdroot.Foundation.PCWSTR val);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT get_Value(winmdroot.Foundation.BSTR* pRetVal);

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