|
// ------------------------------------------------------------------------------
// <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("B38B8077-1FC3-42A5-8CAE-D40C2215055A")]
[SupportedOSPlatform("windows5.1.2600")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IScrollProvider
:IVTable<IScrollProvider,IScrollProvider.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]<IScrollProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IScrollProvider*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IScrollProvider*,uint>)lpVtbl[1])((IScrollProvider*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IScrollProvider*,uint>)lpVtbl[2])((IScrollProvider*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Scroll(IScrollProvider* pThis, winmdroot.UI.Accessibility.ScrollAmount horizontalAmount, winmdroot.UI.Accessibility.ScrollAmount verticalAmount)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Scroll(horizontalAmount, verticalAmount);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Scrolls the visible region of the content area horizontally and vertically. (IScrollProvider.Scroll)</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><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-scroll">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public void Scroll(winmdroot.UI.Accessibility.ScrollAmount horizontalAmount, winmdroot.UI.Accessibility.ScrollAmount verticalAmount)
{
((delegate *unmanaged [Stdcall]<IScrollProvider*,winmdroot.UI.Accessibility.ScrollAmount ,winmdroot.UI.Accessibility.ScrollAmount ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IScrollProvider*)Unsafe.AsPointer(ref this), horizontalAmount, verticalAmount).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT SetScrollPercent(IScrollProvider* pThis, double horizontalPercent, double verticalPercent)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.SetScrollPercent(horizontalPercent, verticalPercent);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Sets the horizontal and vertical scroll position as a percentage of the total content area within the control.</summary>
/// <param name="horizontalPercent">
/// <para>Type: <b>double</b> The horizontal position as a percentage of the content area's total range, or <b>UIA_ScrollPatternNoScroll</b> if there is no horizontal scrolling.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-setscrollpercent#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="verticalPercent">
/// <para>Type: <b>double</b> The vertical position as a percentage of the content area's total range, or <b>UIA_ScrollPatternNoScroll</b> if there is no vertical scrolling.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-setscrollpercent#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 is only useful when the content area of the control is larger than the visible region.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-setscrollpercent#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void SetScrollPercent(double horizontalPercent, double verticalPercent)
{
((delegate *unmanaged [Stdcall]<IScrollProvider*,double ,double ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IScrollProvider*)Unsafe.AsPointer(ref this), horizontalPercent, verticalPercent).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT get_HorizontalScrollPercent(IScrollProvider* pThis, double* pRetVal)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
*pRetVal = __object.HorizontalScrollPercent;
return winmdroot.Foundation.HRESULT.S_OK;
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Specifies the horizontal scroll position.</summary>
/// <remarks>The horizontal scroll position can be reported as <b>UIA_ScrollPatternNoScroll</b> if no valid position is available; for example, if the window does not have a horizontal scroll bar.</remarks>
internal double HorizontalScrollPercent
{
get
{
double __result;
((delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IScrollProvider*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT get_VerticalScrollPercent(IScrollProvider* pThis, double* pRetVal)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
*pRetVal = __object.VerticalScrollPercent;
return winmdroot.Foundation.HRESULT.S_OK;
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Specifies the vertical scroll position.</summary>
/// <remarks>The vertical scroll position can be reported as <b>UIA_ScrollPatternNoScroll</b> if no valid position is available; for example, if the window does not have a vertical scroll bar.</remarks>
internal double VerticalScrollPercent
{
get
{
double __result;
((delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IScrollProvider*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT get_HorizontalViewSize(IScrollProvider* pThis, double* pRetVal)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
*pRetVal = __object.HorizontalViewSize;
return winmdroot.Foundation.HRESULT.S_OK;
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Specifies the horizontal size of the viewable region.</summary>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-get_horizontalviewsize">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
internal double HorizontalViewSize
{
get
{
double __result;
((delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IScrollProvider*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT get_VerticalViewSize(IScrollProvider* pThis, double* pRetVal)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
*pRetVal = __object.VerticalViewSize;
return winmdroot.Foundation.HRESULT.S_OK;
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Specifies the vertical size of the viewable region.</summary>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-get_verticalviewsize">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
internal double VerticalViewSize
{
get
{
double __result;
((delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IScrollProvider*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT get_HorizontallyScrollable(IScrollProvider* pThis, winmdroot.Foundation.BOOL* pRetVal)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
*pRetVal = __object.HorizontallyScrollable;
return winmdroot.Foundation.HRESULT.S_OK;
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Indicates whether the control can scroll horizontally.</summary>
/// <remarks>
/// <para>This property can be dynamic. For example, the content area of the control might not be larger than the current viewable area, meaning <b>IScrollProvider::HorizontallyScrollable</b> is <b>FALSE</b>. However, either resizing the control or adding child items may increase the bounds of the content area beyond the viewable area, meaning <b>IScrollProvider::HorizontallyScrollable</b> is <b>TRUE</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-get_horizontallyscrollable#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
internal winmdroot.Foundation.BOOL HorizontallyScrollable
{
get
{
winmdroot.Foundation.BOOL __result;
((delegate *unmanaged [Stdcall]<IScrollProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IScrollProvider*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
return __result;
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT get_VerticallyScrollable(IScrollProvider* pThis, winmdroot.Foundation.BOOL* pRetVal)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
*pRetVal = __object.VerticallyScrollable;
return winmdroot.Foundation.HRESULT.S_OK;
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Indicates whether the control can scroll vertically.</summary>
/// <remarks>
/// <para>This property can be dynamic. For example, the content area of the control might not be larger than the viewable area, meaning <b>IScrollProvider::VerticallyScrollable</b> is <b>FALSE</b>. However, resizing the control or adding child items may increase the bounds of the content area beyond the viewable area, meaning that <b>IScrollProvider::VerticallyScrollable</b> is <b>TRUE</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationcore/nf-uiautomationcore-iscrollprovider-get_verticallyscrollable#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
internal winmdroot.Foundation.BOOL VerticallyScrollable
{
get
{
winmdroot.Foundation.BOOL __result;
((delegate *unmanaged [Stdcall]<IScrollProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IScrollProvider*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
return __result;
}
}
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]<IScrollProvider*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,winmdroot.UI.Accessibility.ScrollAmount ,winmdroot.UI.Accessibility.ScrollAmount ,winmdroot.Foundation.HRESULT> Scroll_4;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,double ,double ,winmdroot.Foundation.HRESULT> SetScrollPercent_5;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT> get_HorizontalScrollPercent_6;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT> get_VerticalScrollPercent_7;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT> get_HorizontalViewSize_8;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,double* ,winmdroot.Foundation.HRESULT> get_VerticalViewSize_9;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT> get_HorizontallyScrollable_10;
internal delegate *unmanaged [Stdcall]<IScrollProvider*,winmdroot.Foundation.BOOL* ,winmdroot.Foundation.HRESULT> get_VerticallyScrollable_11;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->Scroll_4 = &Scroll;
vtable->SetScrollPercent_5 = &SetScrollPercent;
vtable->get_HorizontalScrollPercent_6 = &get_HorizontalScrollPercent;
vtable->get_VerticalScrollPercent_7 = &get_VerticalScrollPercent;
vtable->get_HorizontalViewSize_8 = &get_HorizontalViewSize;
vtable->get_VerticalViewSize_9 = &get_VerticalViewSize;
vtable->get_HorizontallyScrollable_10 = &get_HorizontallyScrollable;
vtable->get_VerticallyScrollable_11 = &get_VerticallyScrollable;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{b38b8077-1fc3-42a5-8cae-d40c2215055a}</value>
internal static readonly Guid IID_Guid = new Guid(0xB38B8077, 0x1FC3, 0x42A5, 0x8C, 0xAE, 0xD4, 0x0C, 0x22, 0x15, 0x05, 0x5A);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x77,0x80,0x8B,0xB3,0xC3,0x1F,0xA5,0x42,0x8C,0xAE,0xD4,0x0C,0x22,0x15,0x05,0x5A };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("B38B8077-1FC3-42A5-8CAE-D40C2215055A"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.1.2600")]
internal interface Interface
{
[PreserveSig()]
winmdroot.Foundation.HRESULT Scroll(winmdroot.UI.Accessibility.ScrollAmount horizontalAmount, winmdroot.UI.Accessibility.ScrollAmount verticalAmount);
[PreserveSig()]
winmdroot.Foundation.HRESULT SetScrollPercent(double horizontalPercent, double verticalPercent);
double HorizontalScrollPercent
{
get;
}
double VerticalScrollPercent
{
get;
}
double HorizontalViewSize
{
get;
}
double VerticalViewSize
{
get;
}
winmdroot.Foundation.BOOL HorizontallyScrollable
{
get;
}
winmdroot.Foundation.BOOL VerticallyScrollable
{
get;
}
}
}
}
}
|