|
// ------------------------------------------------------------------------------
// <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("D001F200-EF97-11CE-9BC9-00AA00608E01")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IOleUndoManager
:IVTable<IOleUndoManager,IOleUndoManager.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]<IOleUndoManager*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleUndoManager*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IOleUndoManager*,uint>)lpVtbl[1])((IOleUndoManager*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IOleUndoManager*,uint>)lpVtbl[2])((IOleUndoManager*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Open(IOleUndoManager* pThis, winmdroot.System.Ole.IOleParentUndoUnit* pPUU)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Open(pPUU);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Opens a new parent undo unit, which becomes part of its containing unit's undo stack.</summary>
/// <param name="pPUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleparentundounit">IOleParentUndoUnit</a> pointer to the parent undo unit to be opened.</param>
/// <returns>This method returns S_OK if the parent undo unit was successfully opened or if a currently open unit is blocked. If the undo manager is currently disabled, it will return S_OK and do nothing else.</returns>
/// <remarks>
/// <para>This method is implemented the same as <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-open">IOleParentUndoUnit::Open</a>. The specified parent unit is created and remains open. The undo manager then calls the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-add">IOleUndoManager::Add</a> or <b>IOleUndoManager::Open</b> methods on this parent unit to add new units to it. This parent unit receives any additional undo units until its <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-close">IOleUndoManager::Close</a> method is called. The parent unit specified by <i>pPUU</i> is not added to the undo stack until its <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-close">IOleUndoManager::Close</a> method is called with the <i>fCommit</i> parameter set to <b>TRUE</b>. The parent undo unit or undo manager must contain any undo unit given to it unless it is blocked. If it is blocked, it must return S_OK but should do nothing else.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-open#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Open(winmdroot.System.Ole.IOleParentUndoUnit* pPUU)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleUndoManager*)Unsafe.AsPointer(ref this), pPUU).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Close(IOleUndoManager* pThis, winmdroot.System.Ole.IOleParentUndoUnit* pPUU, winmdroot.Foundation.BOOL fCommit)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Close(pPUU, fCommit);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Closes the specified parent undo unit. (IOleUndoManager.Close)</summary>
/// <param name="pPUU">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleparentundounit">IOleParentUndoUnit</a> interface for the currently open parent unit to be closed.</param>
/// <param name="fCommit">Indicates whether to keep or discard the unit. If <b>TRUE</b>, the unit is kept in the collection. If <b>FALSE</b>, the unit is discarded. This parameter is used to allow the client to discard an undo unit under construction if an error or a cancellation occurs.</param>
/// <returns>
/// <para>This method returns S_OK if the undo manager had an open parent undo unit and it was successfully closed. If the undo manager is disabled, it should immediately return S_OK and do nothing else. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>This method is implemented the same as <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-close">IOleParentUndoUnit::Close</a>. A parent undo unit knows it is being closed when it returns S_FALSE from this method. At that time, it should terminate any communication with other objects which may be giving data to it through private interfaces. <h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> An error return indicates a fatal error condition. The parent unit or undo manager must accept the undo unit if <i>fCommit</i> is <b>TRUE</b>. <h3><a id="Note_to_Implementers"></a><a id="note_to_implementers"></a><a id="NOTE_TO_IMPLEMENTERS"></a>Note to Implementers</h3> To process a close request, a parent undo unit first checks to see if it has an open child unit. If it does not, it returns S_FALSE. If it does have a child unit open, it calls the <b>IOleUndoManager::Close</b> method on the child. If the child returns S_FALSE, then the parent undo unit verifies that <i>pPUU</i> points to the child unit, and closes that child undo unit. If the child returns S_OK then it handled the close internally and its parent should do nothing. If the parent unit is blocked, it should check the <i>pPUU</i> parameter to determine the appropriate return code. If <i>pPUU</i> is pointing to itself, then it should return S_FALSE. Otherwise, it should return S_OK; the <i>fCommit</i> parameter is ignored; and no action is taken. If <i>pPUU</i> does not match the currently open parent undo unit, then implementations of this method should return E_INVALIDARG without changing any internal state. The only exception to this is if the unit is blocked.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-close#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Close(winmdroot.System.Ole.IOleParentUndoUnit* pPUU, winmdroot.Foundation.BOOL fCommit)
{
return ((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleUndoManager*)Unsafe.AsPointer(ref this), pPUU, fCommit);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Add(IOleUndoManager* pThis, winmdroot.System.Ole.IOleUndoUnit* pUU)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Add(pUU);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Adds a simple undo unit to the collection. While a parent undo unit is open, the undo manager adds undo units to it by calling IOleParentUndoUnit::Add.</summary>
/// <param name="pUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundounit">IOleUndoUnit</a> pointer to the undo unit to be added.</param>
/// <returns>This method returns S_OK if the specified unit was successfully added, the parent unit was blocked, or the undo manager is disabled.</returns>
/// <remarks>
/// <para>This method is implemented the same as <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-add">IOleParentUndoUnit::Add</a>. The parent undo unit or undo manager must accept any undo unit given to it, unless it is blocked. If it is blocked, it should do nothing but return S_OK. <h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> If the undo manager is in the base state, it should put the new unit on the undo stack and discard the entire redo stack. If the undo manager is in the undo state, it should put new units on the redo stack. If the undo manager is in the redo state, it should put units on the undo stack without affecting the redo stack.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-add#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Add(winmdroot.System.Ole.IOleUndoUnit* pUU)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleUndoManager*)Unsafe.AsPointer(ref this), pUU).ThrowOnFailure();
}
/// <inheritdoc cref="GetOpenParentState(uint*)"/>
internal unsafe void GetOpenParentState(out uint pdwState)
{
fixed (uint* pdwStateLocal = &pdwState)
{
this.GetOpenParentState(pdwStateLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetOpenParentState(IOleUndoManager* pThis, uint* pdwState)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetOpenParentState(pdwState);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves state information about the innermost open parent undo unit. (IOleUndoManager.GetOpenParentState)</summary>
/// <param name="pdwState">A pointer to a variable that receives the state information. This information is a value taken from the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/ne-ocidl-uasflags">UASFLAGS</a> enumeration.</param>
/// <returns>This method returns S_OK if there is an open parent unit and its state was successfully returned or the undo manager is disabled; otherwise, S_FALSE.</returns>
/// <remarks>
/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> When checking for a normal state, use the UAS_MASK value to mask unused bits in the <i>pdwState</i> parameter to this method for future compatibility.</para>
/// <para><h3><a id="Notes_to_Implementers"></a><a id="notes_to_implementers"></a><a id="NOTES_TO_IMPLEMENTERS"></a>Notes to Implementers</h3> If there is an open parent unit, this method calls <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-getparentstate">IOleParentUndoUnit::GetParentState</a>. If the undo manager is disabled, it should fill the <i>pdwState</i> parameter with UAS_BLOCKED and return S_OK.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-getopenparentstate#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetOpenParentState(uint* pdwState)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleUndoManager*)Unsafe.AsPointer(ref this), pdwState).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT DiscardFrom(IOleUndoManager* pThis, winmdroot.System.Ole.IOleUndoUnit* pUU)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.DiscardFrom(pUU);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Instructs the undo manager to discard the specified undo unit and all undo units below it on the undo or redo stack.</summary>
/// <param name="pUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundounit">IOleUndoUnit</a> pointer to the undo unit to be discarded. This parameter can be <b>NULL</b> to discard the entire undo or redo stack. If the parameter is not <b>NULL</b> then the stack will not be discarded.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>The undo manager first searches the undo stack for the given unit, and if not found there searches the redo stack. After it has been found, the given unit and all below it on the same stack are discarded. The undo unit may be a child of a parent unit contained by the undo manager, as determined by calling <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleparentundounit-findunit">IOleParentUndoUnit::FindUnit</a>. If it is a child unit, then the root unit containing the given unit and all units below it on the appropriate stack are discarded. If there is an open parent unit and the <b>DiscardFrom</b> method is called and the <i>pUU</i> parameter is <b>NULL</b>, the undo manager should immediately release and discard the open parent unit without calling the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-close">IOleUndoManager::Close</a> first. When the object that opened the parent unit attempts to close it, <b>IOleUndoManager::Close</b> will return S_FALSE. If a parent unit is open, throw it away and discard the stack. If the parent unit is not open, just throw the stack away. If the <i>pUU</i> parameter is not <b>NULL</b>, then any open parent units should be left open.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-discardfrom#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void DiscardFrom(winmdroot.System.Ole.IOleUndoUnit* pUU)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleUndoManager*)Unsafe.AsPointer(ref this), pUU).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT UndoTo(IOleUndoManager* pThis, winmdroot.System.Ole.IOleUndoUnit* pUU)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.UndoTo(pUU);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Instructs the undo manager to invoke undo actions back through the undo stack, down to and including the specified undo unit.</summary>
/// <param name="pUU">Pointer to the top level unit to undo. If this parameter is <b>NULL</b>, the most recently added top level unit is used.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>This method calls the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundounit-do">IOleUndoUnit::Do</a> method on each top-level undo unit. Then, it releases that undo unit. Note that the specified undo unit must be a top-level unit, typically retrieved through <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-enumundoable">IOleUndoManager::EnumUndoable</a>. In case an error is returned from the undo unit, the undo manager needs to attempt to rollback the state of the document to recover from the error by performing actions on the redo stack. No matter what the success of the rollback, the undo manager should always clear both stacks before returning the error. If the undo manager has called the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundounit-do">Do</a> method on more than one top-level unit, it should only rollback the unit that returned the error. The top-level units that succeeded should not be rolled back. The undo manager must also keep track of whether units were added to the opposite stack so it won't attempt rollback if nothing was added. See the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundomanager">IOleUndoManager</a> interface for detailed description of error handling.</para>
/// <para><h3><a id="Notes_to_Callers"></a><a id="notes_to_callers"></a><a id="NOTES_TO_CALLERS"></a>Notes to Callers</h3> It is possible for an undo unit to return E_ABORT as a failure, but that has no specific meaning on <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundounit">IOleUndoUnit</a>. Because the undo manager will typically return the error code given by the failed undo unit, and E_ABORT does have a specific meaning on <b>IOleUndoManager::UndoTo</b>, the undo manager should never pass on E_ABORT because the caller will interpret that as the rollback failing when in fact it may have succeeded.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-undoto#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void UndoTo(winmdroot.System.Ole.IOleUndoUnit* pUU)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleUndoManager*)Unsafe.AsPointer(ref this), pUU).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT RedoTo(IOleUndoManager* pThis, winmdroot.System.Ole.IOleUndoUnit* pUU)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.RedoTo(pUU);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Instructs the undo manager to invoke undo actions back through the redo stack, down to and including the specified undo unit.</summary>
/// <param name="pUU">An <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundounit">IOleUndoUnit</a> pointer to the top level unit to redo. If this parameter is <b>NULL</b>, the most recently added top level unit is used.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>This method calls the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundounit-do">IOleUndoUnit::Do</a> method on each top-level undo unit. Then, it releases that undo unit. Note that the specified undo unit must be a top-level unit, typically retrieved through <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundomanager-enumredoable">IOleUndoManager::EnumRedoable</a>. In case an error is returned from the undo unit, the undo manager needs to attempt to rollback the state of the document to recover from the error by performing actions on the undo stack. No matter what the success of the rollback, the undo manager should always clear both stacks before returning the error. If the undo manager has called the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nf-ocidl-ioleundounit-do">IOleUndoUnit::Do</a> method on more than one top-level unit, it should only rollback the unit that returned the error. The top-level units that succeeded should not be rolled back. The undo manager must also keep track of whether units were added to the opposite stack so it won't attempt rollback if nothing was added. See the <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundomanager">IOleUndoManager</a> interface for detailed description of error handling.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-redoto#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void RedoTo(winmdroot.System.Ole.IOleUndoUnit* pUU)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((IOleUndoManager*)Unsafe.AsPointer(ref this), pUU).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT EnumUndoable(IOleUndoManager* pThis, winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.EnumUndoable(ppEnum);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Creates an enumerator object that the caller can use to iterate through a series of top-level undo units from the undo stack.</summary>
/// <param name="ppEnum">Address of <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ienumoleundounits">IEnumOleUndoUnits</a> pointer variable that receives the interface pointer to the enumerator object.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>A new enumerator object is created each time this method is called. If the series of enumerated items changes over time, the results of enumeration operations can vary from one call to the next. This method calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">IUnknown::AddRef</a> on the new enumerator object to increment its reference count. The caller is responsible for calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">IUnknown::Release</a> on the enumerator object when it is no longer needed.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-enumundoable#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void EnumUndoable(winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IEnumOleUndoUnits** ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((IOleUndoManager*)Unsafe.AsPointer(ref this), ppEnum).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT EnumRedoable(IOleUndoManager* pThis, winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.EnumRedoable(ppEnum);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Creates an enumerator object that the caller can use to iterate through a series of top-level undo units from the redo stack.</summary>
/// <param name="ppEnum">Address of <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ienumoleundounits">IEnumOleUndoUnits</a> pointer variable that receives the interface pointer to the enumerator object.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>A new enumerator object is created each time this method is called. If the series of enumerated items changes over time, the results of enumeration operations can vary from one call to the next. This method calls <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-addref">IUnknown::AddRef</a> on the new enumerator object to increment its reference count. The caller is responsible for calling <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">IUnknown::Release</a> on the enumerator object when it is no longer needed.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-enumredoable#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void EnumRedoable(winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IEnumOleUndoUnits** ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((IOleUndoManager*)Unsafe.AsPointer(ref this), ppEnum).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetLastUndoDescription(IOleUndoManager* pThis, winmdroot.Foundation.BSTR* pBstr)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetLastUndoDescription(pBstr);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves the description for the top-level undo unit that is on top of the undo stack.</summary>
/// <param name="pBstr">A pointer to a string that contains a description of the top-level undo unit on the undo stack.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>This method provides a convenient shortcut for the host application to add a description to its <b>Edit Undo</b> menu item. The <i>pBstr</i> parameter is a string allocated with the standard string allocator. The caller is responsible for freeing this string.</remarks>
public unsafe void GetLastUndoDescription(winmdroot.Foundation.BSTR* pBstr)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[12])((IOleUndoManager*)Unsafe.AsPointer(ref this), pBstr).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetLastRedoDescription(IOleUndoManager* pThis, winmdroot.Foundation.BSTR* pBstr)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetLastRedoDescription(pBstr);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves the description for the top-level undo unit that is on top of the redo stack.</summary>
/// <param name="pBstr">A pointer to a string that contains a description of the top-level undo unit on the redo stack.</param>
/// <returns>
/// <para>This method returns S_OK on success. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>This method provides a convenient shortcut for the host application to add a description to its <b>Edit Redo</b> menu item. The <i>pBstr</i> parameter is a string allocated with the standard string allocator. The caller is responsible for freeing this string.</remarks>
public unsafe void GetLastRedoDescription(winmdroot.Foundation.BSTR* pBstr)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[13])((IOleUndoManager*)Unsafe.AsPointer(ref this), pBstr).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Enable(IOleUndoManager* pThis, winmdroot.Foundation.BOOL fEnable)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Enable(fEnable);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Enables or disables the undo manager.</summary>
/// <param name="fEnable">Indicates whether to enable or disable the undo manager. If <b>TRUE</b>, the undo manager should be enabled. If <b>FALSE</b>, the undo manager should be disabled.</param>
/// <returns>
/// <para>This method returns S_OK if the undo manager was successfully enabled or disabled. Other possible return values include the following. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>The undo manager should clear both stacks when making the transition from enabled to disabled. If the undo manager is disabled, each method in <a href="https://docs.microsoft.com/windows/desktop/api/ocidl/nn-ocidl-ioleundomanager">IOleUndoManager</a> must behave as specified. See each method for details.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/ocidl/nf-ocidl-ioleundomanager-enable#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void Enable(winmdroot.Foundation.BOOL fEnable)
{
((delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[14])((IOleUndoManager*)Unsafe.AsPointer(ref this), fEnable).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]<IOleUndoManager*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.HRESULT> Open_4;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleParentUndoUnit* ,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> Close_5;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT> Add_6;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,uint* ,winmdroot.Foundation.HRESULT> GetOpenParentState_7;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT> DiscardFrom_8;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT> UndoTo_9;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IOleUndoUnit* ,winmdroot.Foundation.HRESULT> RedoTo_10;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IEnumOleUndoUnits** ,winmdroot.Foundation.HRESULT> EnumUndoable_11;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.System.Ole.IEnumOleUndoUnits** ,winmdroot.Foundation.HRESULT> EnumRedoable_12;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetLastUndoDescription_13;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetLastRedoDescription_14;
internal delegate *unmanaged [Stdcall]<IOleUndoManager*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> Enable_15;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->Open_4 = &Open;
vtable->Close_5 = &Close;
vtable->Add_6 = &Add;
vtable->GetOpenParentState_7 = &GetOpenParentState;
vtable->DiscardFrom_8 = &DiscardFrom;
vtable->UndoTo_9 = &UndoTo;
vtable->RedoTo_10 = &RedoTo;
vtable->EnumUndoable_11 = &EnumUndoable;
vtable->EnumRedoable_12 = &EnumRedoable;
vtable->GetLastUndoDescription_13 = &GetLastUndoDescription;
vtable->GetLastRedoDescription_14 = &GetLastRedoDescription;
vtable->Enable_15 = &Enable;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{d001f200-ef97-11ce-9bc9-00aa00608e01}</value>
internal static readonly Guid IID_Guid = new Guid(0xD001F200, 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[] {
0x00,0xF2,0x01,0xD0,0x97,0xEF,0xCE,0x11,0x9B,0xC9,0x00,0xAA,0x00,0x60,0x8E,0x01 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("D001F200-EF97-11CE-9BC9-00AA00608E01"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Open(winmdroot.System.Ole.IOleParentUndoUnit* pPUU);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Close(winmdroot.System.Ole.IOleParentUndoUnit* pPUU, winmdroot.Foundation.BOOL fCommit);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Add(winmdroot.System.Ole.IOleUndoUnit* pUU);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetOpenParentState(uint* pdwState);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT DiscardFrom(winmdroot.System.Ole.IOleUndoUnit* pUU);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT UndoTo(winmdroot.System.Ole.IOleUndoUnit* pUU);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT RedoTo(winmdroot.System.Ole.IOleUndoUnit* pUU);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT EnumUndoable(winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT EnumRedoable(winmdroot.System.Ole.IEnumOleUndoUnits** ppEnum);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetLastUndoDescription(winmdroot.Foundation.BSTR* pBstr);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetLastRedoDescription(winmdroot.Foundation.BSTR* pBstr);
[PreserveSig()]
winmdroot.Foundation.HRESULT Enable(winmdroot.Foundation.BOOL fEnable);
}
}
}
}
|