|
// ------------------------------------------------------------------------------
// <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("56D00BD0-C4F4-433C-A836-1A52A57E0892")]
[SupportedOSPlatform("windows5.1.2600")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IToggleProvider
:IVTable<IToggleProvider,IToggleProvider.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]<IToggleProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IToggleProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IToggleProvider*,uint>)lpVtbl[1])((IToggleProvider*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IToggleProvider*,uint>)lpVtbl[2])((IToggleProvider*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Toggle(IToggleProvider* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Toggle();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Cycles through the toggle states of a control.</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>A control must cycle through its <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/ne-uiautomationcore-togglestate">ToggleState</a> in this order: <b>ToggleState_On</b>, <b>ToggleState_Off</b> and, if supported, <b>ToggleState_Indeterminate</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-itoggleprovider-toggle#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void Toggle()
{
((delegate *unmanaged [Stdcall]<IToggleProvider*,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IToggleProvider*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
}
/// <inheritdoc cref="get_ToggleState(winmdroot.UI.Accessibility.ToggleState*)"/>
internal unsafe winmdroot.Foundation.HRESULT get_ToggleState(out winmdroot.UI.Accessibility.ToggleState pRetVal)
{
fixed (winmdroot.UI.Accessibility.ToggleState* pRetValLocal = &pRetVal)
{
winmdroot.Foundation.HRESULT __result = this.get_ToggleState(pRetValLocal);
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT get_ToggleState(IToggleProvider* pThis, winmdroot.UI.Accessibility.ToggleState* pRetVal)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.get_ToggleState(pRetVal);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Specifies the toggle state of the control.</summary>
/// <remarks>
/// <para>A control must cycle through its <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationcore/ne-uiautomationcore-togglestate">ToggleState</a> in this order: <b>ToggleState_On</b>, <b>ToggleState_Off</b> and, if supported, <b>ToggleState_Indeterminate</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-itoggleprovider-get_togglestate#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT get_ToggleState(winmdroot.UI.Accessibility.ToggleState* pRetVal)
{
return ((delegate *unmanaged [Stdcall]<IToggleProvider*,winmdroot.UI.Accessibility.ToggleState* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IToggleProvider*)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]<IToggleProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IToggleProvider*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IToggleProvider*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IToggleProvider*,winmdroot.Foundation.HRESULT> Toggle_4;
internal delegate *unmanaged [Stdcall]<IToggleProvider*,winmdroot.UI.Accessibility.ToggleState* ,winmdroot.Foundation.HRESULT> get_ToggleState_5;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->Toggle_4 = &Toggle;
vtable->get_ToggleState_5 = &get_ToggleState;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{56d00bd0-c4f4-433c-a836-1a52a57e0892}</value>
internal static readonly Guid IID_Guid = new Guid(0x56D00BD0, 0xC4F4, 0x433C, 0xA8, 0x36, 0x1A, 0x52, 0xA5, 0x7E, 0x08, 0x92);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0xD0,0x0B,0xD0,0x56,0xF4,0xC4,0x3C,0x43,0xA8,0x36,0x1A,0x52,0xA5,0x7E,0x08,0x92 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("56D00BD0-C4F4-433C-A836-1A52A57E0892"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.1.2600")]
internal interface Interface
{
[PreserveSig()]
winmdroot.Foundation.HRESULT Toggle();
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT get_ToggleState(winmdroot.UI.Accessibility.ToggleState* pRetVal);
}
}
}
}
|