|
// ------------------------------------------------------------------------------
// <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 System.Ole
{
[Guid("894AD3B0-EF97-11CE-9BC9-00AA00608E01")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IOleUndoUnit
:IVTable<IOleUndoUnit,IOleUndoUnit.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]<IOleUndoUnit*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleUndoUnit*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IOleUndoUnit*,uint>)lpVtbl[1])((IOleUndoUnit*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IOleUndoUnit*,uint>)lpVtbl[2])((IOleUndoUnit*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Do(IOleUndoUnit* pThis, winmdroot.System.Ole.IOleUndoManager* pUndoManager)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Do(pUndoManager);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Instructs the undo unit to carry out its action. Note that if it contains child undo units, it must call their Do methods as well.</summary>
/// <param name="pUndoManager">A pointer to the undo manager. See <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundomanager">IOleUndoManager</a>.</param>
/// <returns>This method returns S_OK on success.</returns>
/// <remarks>
/// <para>The undo unit is responsible for carrying out its action. Performing its own undo action results in another action that can potentially be reversed. However, if <i>pUndoManager</i> is <b>NULL</b>, the undo unit should perform its undo action but should not attempt to put anything on the redo or undo stack. If <i>pUndoManager</i> is not <b>NULL</b>, then the unit is required to put a corresponding unit on the redo or undo stack. As a result, this method either moves itself to the redo or undo stack, or it creates a new undo unit and adds it to the appropriate stack. After creating a new undo unit, this undo unit calls <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-open">IOleUndoManager::Open</a> or <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-add">IOleUndoManager::Add</a>. The undo manager will put the new undo unit on the undo or redo stack depending on its current state. A parent unit must pass to its children the same undo manager, possibly <b>NULL</b>, that was given to the parent. It is permissible, but not necessary, when <i>pUndoManager</i> is <b>NULL</b> to open a parent unit on the redo or undo stack as long as it is not committed. A blocked parent unit ensures that nothing is added to the stack by child units. If this undo unit is a parent unit, it should put itself on the redo or undo stack before calling the <b>Do</b> method on its children. After calling this method, the undo manager must release the undo unit. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> See the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundomanager">IOleUndoManager</a> interface for error handling strategies for undo units. The error handling strategy affects the implementation of this method, particularly for parent units.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundounit-do#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Do(winmdroot.System.Ole.IOleUndoManager* pUndoManager)
{
((delegate *unmanaged [Stdcall]<IOleUndoUnit*,winmdroot.System.Ole.IOleUndoManager* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleUndoUnit*)Unsafe.AsPointer(ref this), pUndoManager).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetDescription(IOleUndoUnit* pThis, winmdroot.Foundation.BSTR* pBstr)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetDescription(pBstr);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves a description of the undo unit that can be used in the undo or redo user interface.</summary>
/// <param name="pBstr">A pointer to string that describes this undo unit.</param>
/// <returns>This method returns S_OK on success.</returns>
/// <remarks>
/// <para>All units are required to provide a user-readable description of themselves. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> The <i>pbstr</i> parameter is allocated with the standard string allocator. The caller is responsible for freeing this string.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundounit-getdescription#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetDescription(winmdroot.Foundation.BSTR* pBstr)
{
((delegate *unmanaged [Stdcall]<IOleUndoUnit*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleUndoUnit*)Unsafe.AsPointer(ref this), pBstr).ThrowOnFailure();
}
/// <inheritdoc cref="GetUnitType(global::System.Guid*, int*)"/>
internal unsafe void GetUnitType(out global::System.Guid pClsid, out int plID)
{
fixed (int* plIDLocal = &plID)
{
fixed (global::System.Guid* pClsidLocal = &pClsid)
{
this.GetUnitType(pClsidLocal, plIDLocal);
}
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetUnitType(IOleUndoUnit* pThis, global::System.Guid* pClsid, int* plID)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetUnitType(pClsid, plID);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves the CLSID and a type identifier for the undo unit.</summary>
/// <param name="pClsid">A pointer to CLSID for the undo unit.</param>
/// <param name="plID">A pointer to the type identifier for the undo unit.</param>
/// <returns>This method returns S_OK on success.</returns>
/// <remarks>
/// <para>A parent undo unit can call this method on its child units to determine whether it can apply special handling to them. The CLSID returned can be the CLSID of the undo unit itself, of its creating object, or an arbitrary GUID. The undo unit has the option of returning CLSID_NULL, in which case the caller can make no assumptions about the type of this unit. The only requirement is that the CLSID and type identifier together uniquely identify this type of undo unit. Note that the undo manager and parent undo units do not have the option of accepting or rejecting child units based on their type.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundounit-getunittype#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetUnitType(global::System.Guid* pClsid, int* plID)
{
((delegate *unmanaged [Stdcall]<IOleUndoUnit*,global::System.Guid* ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleUndoUnit*)Unsafe.AsPointer(ref this), pClsid, plID).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT OnNextAdd(IOleUndoUnit* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.OnNextAdd();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Notifies the last undo unit in the collection that a new unit has been added.</summary>
/// <returns>Implementations of this method always return S_OK. The <b>HRESULT</b> return type is used only for remotability.</returns>
/// <remarks>
/// <para>An object can create an undo unit for an action and add it to the undo manager but can continue inserting data into it through private interfaces. When the undo unit receives a call to this method, it communicates back to the creating object that the context has changed. Then, the creating object stops inserting data into the undo unit. The parent undo unit calls this method on its most recently added child undo unit to notify the child unit that the context has changed and a new undo unit has been added. For example, this method is used for supporting fuzzy actions, like typing, which do not have a clear point of termination but instead are terminated only when something else happens. This method may not always be called if the undo manager or an open parent unit chooses to discard the unit by calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">IUnknown::Release</a> instead. Any connection which feeds data to the undo unit behind the scenes through private interfaces should not <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">IUnknown::AddRef</a> the undo unit. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> Note that parent units merely delegate this method to their most recently added child unit. A parent unit should terminate communication through any private interfaces when it is closed. A parent unit knows it is being closed when it receives S_FALSE from calling <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-close">IOleParentUndoUnit::Close</a>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundounit-onnextadd#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void OnNextAdd()
{
((delegate *unmanaged [Stdcall]<IOleUndoUnit*,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleUndoUnit*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
}
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]<IOleUndoUnit*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IOleUndoUnit*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IOleUndoUnit*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IOleUndoUnit*,winmdroot.System.Ole.IOleUndoManager* ,winmdroot.Foundation.HRESULT> Do_4;
internal delegate *unmanaged [Stdcall]<IOleUndoUnit*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetDescription_5;
internal delegate *unmanaged [Stdcall]<IOleUndoUnit*,global::System.Guid* ,int* ,winmdroot.Foundation.HRESULT> GetUnitType_6;
internal delegate *unmanaged [Stdcall]<IOleUndoUnit*,winmdroot.Foundation.HRESULT> OnNextAdd_7;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->Do_4 = &Do;
vtable->GetDescription_5 = &GetDescription;
vtable->GetUnitType_6 = &GetUnitType;
vtable->OnNextAdd_7 = &OnNextAdd;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{894ad3b0-ef97-11ce-9bc9-00aa00608e01}</value>
internal static readonly Guid IID_Guid = new Guid(0x894AD3B0, 0xEF97, 0x11CE, 0x9B, 0xC9, 0x00, 0xAA, 0x00, 0x60, 0x8E, 0x01);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0xB0,0xD3,0x4A,0x89,0x97,0xEF,0xCE,0x11,0x9B,0xC9,0x00,0xAA,0x00,0x60,0x8E,0x01 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("894AD3B0-EF97-11CE-9BC9-00AA00608E01"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Do(winmdroot.System.Ole.IOleUndoManager* pUndoManager);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetDescription(winmdroot.Foundation.BSTR* pBstr);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetUnitType(global::System.Guid* pClsid, int* plID);
[PreserveSig()]
winmdroot.Foundation.HRESULT OnNextAdd();
}
}
}
}
|