|
// ------------------------------------------------------------------------------
// <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("00000118-0000-0000-C000-000000000046")]
[SupportedOSPlatform("windows5.0")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct IOleClientSite
:IVTable<IOleClientSite,IOleClientSite.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]<IOleClientSite*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((IOleClientSite*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<IOleClientSite*,uint>)lpVtbl[1])((IOleClientSite*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<IOleClientSite*,uint>)lpVtbl[2])((IOleClientSite*)Unsafe.AsPointer(ref this));
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT SaveObject(IOleClientSite* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.SaveObject();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Saves the embedded object associated with the client site. This function is synchronous; by the time it returns, the save will be completed.</summary>
/// <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>An embedded object calls <b>SaveObject</b> to ask its container to save it to persistent storage when an end user chooses the File Update or Exit commands. The call is synchronous, meaning that by the time it returns, the save operation will be completed. Calls to <b>SaveObject</b> occur in most implementations of <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-close">IOleObject::Close</a>. Normally, when a container tells an object to close, the container passes a flag specifying whether the object should save itself before closing, prompt the user for instructions, or close without saving itself. If an object is instructed to save itself, either by its container or an end user, it calls <b>SaveObject</b> to ask the container application to save the object's contents before the object closes itself. If a container instructs an object not to save itself, the object should not call <b>SaveObject</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleclientsite-saveobject#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void SaveObject()
{
((delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.HRESULT>)lpVtbl[3])((IOleClientSite*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetMoniker(IOleClientSite* pThis, uint dwAssign, uint dwWhichMoniker, winmdroot.System.Com.IMoniker** ppmk)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetMoniker(dwAssign, dwWhichMoniker, ppmk);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves a moniker for the object's client site. An object can force the assignment of its own or its container's moniker by specifying a value for dwAssign.</summary>
/// <param name="dwAssign">Specifies whether to get a moniker only if one already exists, force assignment of a moniker, create a temporary moniker, or remove a moniker that has been assigned. In practice, you will usually request that the container force assignment of the moniker. Possible values are taken from the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-olegetmoniker">OLEGETMONIKER</a> enumeration.</param>
/// <param name="dwWhichMoniker">Specifies whether to return the container's moniker, the object's moniker relative to the container, or the object's full moniker. In practice, you will usually request the object's full moniker. Possible values are taken from the <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/ne-oleidl-olewhichmk">OLEWHICHMK</a> enumeration.</param>
/// <param name="ppmk">A pointer to an <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-imoniker">IMoniker</a> pointer variable that receives the interface pointer to the moniker for the object's client site. If an error occurs, the implementation must set <i>ppmk</i> to <b>NULL</b>. Each time a container receives a call to <b>IOleClientSite::GetMoniker</b>, it must increase the reference count on the <i>ppmk</i> pointer it returns. It is the caller's responsibility to call <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-release">Release</a> when it is finished with the pointer.</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>Containers implement <b>GetMoniker</b> as a way of passing out monikers for their embedded objects to clients that need to link to those objects. When a link is made to an embedded object or to a pseudo-object within it (a range of cells in a spreadsheet, for example), the object needs a moniker to construct the composite moniker indicating the source of the link. If the embedded object does not already have a moniker, it can call <b>GetMoniker</b> to request one. Every container that expects to contain links to embeddings should support <b>GetMoniker</b> to give out OLEWHICHMK_CONTAINER, thus enabling link tracking when the link client and link source files move, but maintain the same relative position. An object must not persistently store its full moniker or its container's moniker, because these can change while the object is not loaded. For example, either the container or the object could be renamed, in which event, storing the container's moniker or the object's full moniker would make it impossible for a client to track a link to the object. In some very specialized cases, an object may no longer need a moniker previously assigned to it and may wish to have it removed as an optimization. In such cases, the object can call <b>GetMoniker</b> with OLEGETMONIKER_UNASSIGN to have the moniker removed.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleclientsite-getmoniker#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetMoniker(uint dwAssign, uint dwWhichMoniker, winmdroot.System.Com.IMoniker** ppmk)
{
((delegate *unmanaged [Stdcall]<IOleClientSite*,uint ,uint ,winmdroot.System.Com.IMoniker** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((IOleClientSite*)Unsafe.AsPointer(ref this), dwAssign, dwWhichMoniker, ppmk).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetContainer(IOleClientSite* pThis, winmdroot.System.Ole.IOleContainer** ppContainer)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetContainer(ppContainer);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves a pointer to the object's container.</summary>
/// <param name="ppContainer">Address of <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-iolecontainer">IOleContainer</a> pointer variable that receives the interface pointer to the container object. If an error occurs, the implementation must set <i>ppContainer</i> to <b>NULL</b>.</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>If a container supports links to its embedded objects, implementing <b>GetContainer</b> enables link clients to enumerate the container's objects and recursively traverse a containment hierarchy. This method is optional but recommended for all containers that expect to support links to their embedded objects. Link clients can traverse a hierarchy of compound-document objects by recursively calling <b>GetContainer</b> to get a pointer to the link source's container; followed by <a href="https://docs.microsoft.com/windows/desktop/api/unknwn/nf-unknwn-iunknown-queryinterface(q)">QueryInterface</a> to get a pointer to the container's <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nn-oleidl-ioleobject">IOleObject</a> interface and, finally, <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-getclientsite">IOleObject::GetClientSite</a> to get the container's client site in its container. Simple containers that do not support links to their embedded objects probably do not need to implement this method. Instead, they can return E_NOINTERFACE and set <i>ppContainer</i> to <b>NULL</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleclientsite-getcontainer#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetContainer(winmdroot.System.Ole.IOleContainer** ppContainer)
{
((delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.System.Ole.IOleContainer** ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((IOleClientSite*)Unsafe.AsPointer(ref this), ppContainer).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT ShowObject(IOleClientSite* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.ShowObject();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Asks a container to display its object to the user. This method ensures that the container itself is visible and not minimized.</summary>
/// <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>After a link client binds to a link source, it commonly calls <a href="https://docs.microsoft.com/windows/desktop/api/oleidl/nf-oleidl-ioleobject-doverb">IOleObject::DoVerb</a> on the link source, usually requesting the source to perform some action requiring that it display itself to the user. As part of its implementation of <b>IOleObject::DoVerb</b>, the link source can call <b>ShowObject</b>, which forces the client to show the link source as best it can. If the link source's container is itself an embedded object, it will recursively invoke <b>ShowObject</b> on its own container. Having called the <b>ShowObject</b> method, a link source has no guarantee of being appropriately displayed because its container may not be able to do so at the time of the call. The <b>ShowObject</b> method does not guarantee visibility, only that the container will do the best it can.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/oleidl/nf-oleidl-ioleclientsite-showobject#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void ShowObject()
{
((delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.HRESULT>)lpVtbl[6])((IOleClientSite*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT OnShowWindow(IOleClientSite* pThis, winmdroot.Foundation.BOOL fShow)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.OnShowWindow(fShow);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Notifies a container when an embedded object's window is about to become visible or invisible. This method does not apply to an object that is activated in place and therefore has no window separate from that of its container.</summary>
/// <param name="fShow">Indicates whether an object's window is open (TRUE) or closed (FALSE).</param>
/// <returns>This method returns S_OK on success.</returns>
/// <remarks>An embedded object calls <b>OnShowWindow</b> to keep its container informed when the object is open in a window. This window may or may not be currently visible to the end user. The container uses this information to shade the object's client site when the object is displayed in a window, and to remove the shading when the object is not. A shaded object, having received this notification, knows that it already has an open window and therefore can respond to being double-clicked by bringing this window quickly to the top, instead of launching its application in order to obtain a new one.</remarks>
public void OnShowWindow(winmdroot.Foundation.BOOL fShow)
{
((delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((IOleClientSite*)Unsafe.AsPointer(ref this), fShow).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT RequestNewObjectLayout(IOleClientSite* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.RequestNewObjectLayout();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Asks a container to resize the display site for embedded objects.</summary>
/// <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 can either increase or decrease the space. Currently, there is no standard mechanism by which a container can negotiate how much room an object would like. When such a negotiation is defined, responding to this method will be optional for containers.</remarks>
public void RequestNewObjectLayout()
{
((delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.HRESULT>)lpVtbl[8])((IOleClientSite*)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]<IOleClientSite*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.HRESULT> SaveObject_4;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,uint ,uint ,winmdroot.System.Com.IMoniker** ,winmdroot.Foundation.HRESULT> GetMoniker_5;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.System.Ole.IOleContainer** ,winmdroot.Foundation.HRESULT> GetContainer_6;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.HRESULT> ShowObject_7;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.BOOL ,winmdroot.Foundation.HRESULT> OnShowWindow_8;
internal delegate *unmanaged [Stdcall]<IOleClientSite*,winmdroot.Foundation.HRESULT> RequestNewObjectLayout_9;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->SaveObject_4 = &SaveObject;
vtable->GetMoniker_5 = &GetMoniker;
vtable->GetContainer_6 = &GetContainer;
vtable->ShowObject_7 = &ShowObject;
vtable->OnShowWindow_8 = &OnShowWindow;
vtable->RequestNewObjectLayout_9 = &RequestNewObjectLayout;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{00000118-0000-0000-c000-000000000046}</value>
internal static readonly Guid IID_Guid = new Guid(0x00000118, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0x18,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("00000118-0000-0000-C000-000000000046"),InterfaceType(ComInterfaceType.InterfaceIsIUnknown),ComImport()]
[SupportedOSPlatform("windows5.0")]
internal interface Interface
{
[PreserveSig()]
winmdroot.Foundation.HRESULT SaveObject();
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetMoniker(uint dwAssign, uint dwWhichMoniker, winmdroot.System.Com.IMoniker** ppmk);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetContainer(winmdroot.System.Ole.IOleContainer** ppContainer);
[PreserveSig()]
winmdroot.Foundation.HRESULT ShowObject();
[PreserveSig()]
winmdroot.Foundation.HRESULT OnShowWindow(winmdroot.Foundation.BOOL fShow);
[PreserveSig()]
winmdroot.Foundation.HRESULT RequestNewObjectLayout();
}
}
}
}
|