File: Windows.Win32.IUIAutomationCacheRequest.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("B32A92B5-BC25-4078-9C08-D7EE95C48E03")]
		[SupportedOSPlatform("windows6.1")]
		[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
		internal unsafe partial struct IUIAutomationCacheRequest
			:IVTable<IUIAutomationCacheRequest,IUIAutomationCacheRequest.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]<IUIAutomationCacheRequest*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), riid, ppvObject);
			}

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

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

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

			/// <summary>Adds a property to the cache request.</summary>
			/// <param name="propertyId">
			/// <para>Type: <b>PROPERTYID</b> A property identifier.  For a list of property IDs, see <a href="https://docs.microsoft.com/windows/desktop/WinAuto/uiauto-entry-propids">Property Identifiers</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationcacherequest-addproperty#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/uiautomationclient/nf-uiautomationclient-iuiautomationcacherequest-addproperty">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public void AddProperty(winmdroot.UI.Accessibility.UIA_PROPERTY_ID propertyId)
			{
				((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.UIA_PROPERTY_ID ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), propertyId).ThrowOnFailure();
			}

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

			/// <summary>Adds a control pattern to the cache request.</summary>
			/// <param name="patternId">
			/// <para>Type: <b>PATTERNID</b> The identifier of the control pattern to add to the cache request. For a list of control pattern IDs, see <a href="https://docs.microsoft.com/windows/desktop/WinAuto/uiauto-controlpattern-ids">Control Pattern Identifiers</a>.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationcacherequest-addpattern#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>Adding a control pattern that is already in the cache request has no effect.</remarks>
			public void AddPattern(winmdroot.UI.Accessibility.UIA_PATTERN_ID patternId)
			{
				((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.UIA_PATTERN_ID ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), patternId).ThrowOnFailure();
			}

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

			/// <summary>Creates a copy of the cache request.</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/uiautomationclient/nf-uiautomationclient-iuiautomationcacherequest-clone">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			public unsafe winmdroot.UI.Accessibility.IUIAutomationCacheRequest* Clone()
			{
				winmdroot.UI.Accessibility.IUIAutomationCacheRequest* __retVal = default(winmdroot.UI.Accessibility.IUIAutomationCacheRequest*);
				((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.IUIAutomationCacheRequest** ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), &__retVal).ThrowOnFailure();
				return __retVal;
			}

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

			/// <summary>Specifies the scope of caching. (Get)</summary>
			/// <remarks>When an element is retrieved, caching can be performed  for only the element itself (the default behavior), or for the element and its children or descendants. This property describes the scope of the request.</remarks>
			internal winmdroot.UI.Accessibility.TreeScope TreeScope
			{
				get
				{
					winmdroot.UI.Accessibility.TreeScope __result;
					((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.TreeScope* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
					return __result;
				}
				set
				{
					((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.TreeScope ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), value).ThrowOnFailure();
				}
			}

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

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

			/// <summary>Specifies the view of the UI Automation element tree that is used when caching. (Get)</summary>
			/// <remarks>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationcacherequest-get_treefilter">Learn more about this API from docs.microsoft.com</see>.</para>
			/// </remarks>
			internal unsafe winmdroot.UI.Accessibility.IUIAutomationCondition* TreeFilter
			{
				get
				{
					winmdroot.UI.Accessibility.IUIAutomationCondition* __result;
					((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.IUIAutomationCondition** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
					return __result;
				}
				set
				{
					((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.IUIAutomationCondition* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), value).ThrowOnFailure();
				}
			}

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

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

			/// <summary>Indicates whether returned elements contain full references to the underlying UI, or only cached information. (Get)</summary>
			/// <remarks>
			/// <para><a href="https://docs.microsoft.com/windows/desktop/api/uiautomationclient/ne-uiautomationclient-automationelementmode">AutomationElementMode_Full</a> is the default value, and specifies that returned elements contain a full reference to the underlying UI. <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationclient/ne-uiautomationclient-automationelementmode">AutomationElementMode_None</a> specifies that the returned elements have no reference to the underlying UI, and contain only cached information. Certain operations on elements, including <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue">GetCurrentPropertyValue</a>, and <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus">SetFocus</a>, require a full reference; attempting to perform these on an element that has none results in an error. Using <a href="https://docs.microsoft.com/windows/desktop/api/uiautomationclient/ne-uiautomationclient-automationelementmode">AutomationElementMode_None</a> can be more efficient when only properties are needed, as it avoids the overhead involved in setting up full references.</para>
			/// <para><see href="https://learn.microsoft.com/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationcacherequest-get_automationelementmode#">Read more on docs.microsoft.com</see>.</para>
			/// </remarks>
			internal winmdroot.UI.Accessibility.AutomationElementMode AutomationElementMode
			{
				get
				{
					winmdroot.UI.Accessibility.AutomationElementMode __result;
					((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.AutomationElementMode* ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), &__result).ThrowOnFailure();
					return __result;
				}
				set
				{
					((delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.AutomationElementMode ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IUIAutomationCacheRequest*)Unsafe.AsPointer(ref this), value).ThrowOnFailure();
				}
			}

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

			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]<IUIAutomationCacheRequest*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;

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

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

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.UIA_PROPERTY_ID ,winmdroot.Foundation.HRESULT> AddProperty_4;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.UIA_PATTERN_ID ,winmdroot.Foundation.HRESULT> AddPattern_5;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.IUIAutomationCacheRequest** ,winmdroot.Foundation.HRESULT> Clone_6;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.TreeScope* ,winmdroot.Foundation.HRESULT> get_TreeScope_7;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.TreeScope ,winmdroot.Foundation.HRESULT> put_TreeScope_8;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.IUIAutomationCondition** ,winmdroot.Foundation.HRESULT> get_TreeFilter_9;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.IUIAutomationCondition* ,winmdroot.Foundation.HRESULT> put_TreeFilter_10;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.AutomationElementMode* ,winmdroot.Foundation.HRESULT> get_AutomationElementMode_11;

				internal delegate *unmanaged [Stdcall]<IUIAutomationCacheRequest*,winmdroot.UI.Accessibility.AutomationElementMode ,winmdroot.Foundation.HRESULT> put_AutomationElementMode_12;
			} 
			public static void PopulateVTable(Vtbl* vtable)
			{
				vtable->AddProperty_4 = &AddProperty;
				vtable->AddPattern_5 = &AddPattern;
				vtable->Clone_6 = &Clone;
				vtable->get_TreeScope_7 = &get_TreeScope;
				vtable->put_TreeScope_8 = &put_TreeScope;
				vtable->get_TreeFilter_9 = &get_TreeFilter;
				vtable->put_TreeFilter_10 = &put_TreeFilter;
				vtable->get_AutomationElementMode_11 = &get_AutomationElementMode;
				vtable->put_AutomationElementMode_12 = &put_AutomationElementMode;
			}

			private void** lpVtbl;

			/// <summary>The IID guid for this interface.</summary>
			/// <value>{b32a92b5-bc25-4078-9c08-d7ee95c48e03}</value>
			internal static readonly Guid IID_Guid = new Guid(0xB32A92B5, 0xBC25, 0x4078, 0x9C, 0x08, 0xD7, 0xEE, 0x95, 0xC4, 0x8E, 0x03);

			static ref readonly Guid IComIID.Guid			{
								[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
				{
					ReadOnlySpan<byte> data = new byte[]					{
0xB5,0x92,0x2A,0xB3,0x25,0xBC,0x78,0x40,0x9C,0x08,0xD7,0xEE,0x95,0xC4,0x8E,0x03					};
					return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
				}
			}
			[Guid("B32A92B5-BC25-4078-9C08-D7EE95C48E03"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
			[SupportedOSPlatform("windows6.1")]
			internal interface Interface
			{
								[PreserveSig()]
winmdroot.Foundation.HRESULT AddProperty(winmdroot.UI.Accessibility.UIA_PROPERTY_ID propertyId);

								[PreserveSig()]
winmdroot.Foundation.HRESULT AddPattern(winmdroot.UI.Accessibility.UIA_PATTERN_ID patternId);

				[PreserveSig()]
				unsafe winmdroot.Foundation.HRESULT Clone(winmdroot.UI.Accessibility.IUIAutomationCacheRequest** clonedRequest);

				winmdroot.UI.Accessibility.TreeScope TreeScope
				{
					get;
					set;
				}

				unsafe winmdroot.UI.Accessibility.IUIAutomationCondition* TreeFilter
				{
					get;
					set;
				}

				winmdroot.UI.Accessibility.AutomationElementMode AutomationElementMode
				{
					get;
					set;
				}
			}
		}
	}
}