|
// ------------------------------------------------------------------------------
// <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.Controls.RichEdit
{
[Guid("8CC497C0-A1DF-11CE-8098-00AA0047BE5D")]
[SupportedOSPlatform("windows6.0.6000")]
[global::System.CodeDom.Compiler.GeneratedCode("Microsoft.Windows.CsWin32", "0.3.151+58e949951d.RR")]
internal unsafe partial struct ITextDocument
:IVTable<ITextDocument,ITextDocument.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]<ITextDocument*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT>)lpVtbl[0])((ITextDocument*)Unsafe.AsPointer(ref this), riid, ppvObject);
}
public uint AddRef()
{
return ((delegate *unmanaged [Stdcall]<ITextDocument*,uint>)lpVtbl[1])((ITextDocument*)Unsafe.AsPointer(ref this));
}
public uint Release()
{
return ((delegate *unmanaged [Stdcall]<ITextDocument*,uint>)lpVtbl[2])((ITextDocument*)Unsafe.AsPointer(ref this));
}
/// <inheritdoc cref="GetTypeInfoCount(uint*)"/>
internal unsafe void GetTypeInfoCount(out uint pctinfo)
{
fixed (uint* pctinfoLocal = &pctinfo)
{
this.GetTypeInfoCount(pctinfoLocal);
}
}
public unsafe void GetTypeInfoCount(uint* pctinfo)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[3])((ITextDocument*)Unsafe.AsPointer(ref this), pctinfo).ThrowOnFailure();
}
public unsafe void GetTypeInfo(uint iTInfo, uint lcid, winmdroot.System.Com.ITypeInfo** ppTInfo)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,uint ,uint ,winmdroot.System.Com.ITypeInfo** ,winmdroot.Foundation.HRESULT>)lpVtbl[4])((ITextDocument*)Unsafe.AsPointer(ref this), iTInfo, lcid, ppTInfo).ThrowOnFailure();
}
/// <inheritdoc cref="GetIDsOfNames(global::System.Guid*, winmdroot.Foundation.PWSTR*, uint, uint, int*)"/>
internal unsafe void GetIDsOfNames(in global::System.Guid riid, ReadOnlySpan<winmdroot.Foundation.PWSTR> rgszNames, uint lcid, Span<int> rgDispId)
{
fixed (int* rgDispIdLocal = rgDispId)
{
fixed (winmdroot.Foundation.PWSTR* rgszNamesLocal = rgszNames)
{
fixed (global::System.Guid* riidLocal = &riid)
{
if (rgszNames.Length != rgDispId.Length) throw new ArgumentException();
this.GetIDsOfNames(riidLocal, rgszNamesLocal, (uint )rgDispId.Length, lcid, rgDispIdLocal);
}
}
}
}
public unsafe void GetIDsOfNames(global::System.Guid* riid, winmdroot.Foundation.PWSTR* rgszNames, uint cNames, uint lcid, int* rgDispId)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,global::System.Guid* ,winmdroot.Foundation.PWSTR* ,uint ,uint ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[5])((ITextDocument*)Unsafe.AsPointer(ref this), riid, rgszNames, cNames, lcid, rgDispId).ThrowOnFailure();
}
/// <inheritdoc cref="Invoke(int, global::System.Guid*, uint, winmdroot.System.Com.DISPATCH_FLAGS, winmdroot.System.Com.DISPPARAMS*, winmdroot.System.Variant.VARIANT*, winmdroot.System.Com.EXCEPINFO*, uint*)"/>
internal unsafe void Invoke(int dispIdMember, in global::System.Guid riid, uint lcid, winmdroot.System.Com.DISPATCH_FLAGS wFlags, in winmdroot.System.Com.DISPPARAMS pDispParams, winmdroot.System.Variant.VARIANT* pVarResult, winmdroot.System.Com.EXCEPINFO* pExcepInfo, uint* puArgErr)
{
fixed (winmdroot.System.Com.DISPPARAMS* pDispParamsLocal = &pDispParams)
{
fixed (global::System.Guid* riidLocal = &riid)
{
this.Invoke(dispIdMember, riidLocal, lcid, wFlags, pDispParamsLocal, pVarResult, pExcepInfo, puArgErr);
}
}
}
public unsafe void Invoke(int dispIdMember, global::System.Guid* riid, uint lcid, winmdroot.System.Com.DISPATCH_FLAGS wFlags, winmdroot.System.Com.DISPPARAMS* pDispParams, [Optional] winmdroot.System.Variant.VARIANT* pVarResult, [Optional] winmdroot.System.Com.EXCEPINFO* pExcepInfo, [Optional] uint* puArgErr)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int ,global::System.Guid* ,uint ,winmdroot.System.Com.DISPATCH_FLAGS ,winmdroot.System.Com.DISPPARAMS* ,winmdroot.System.Variant.VARIANT* ,winmdroot.System.Com.EXCEPINFO* ,uint* ,winmdroot.Foundation.HRESULT>)lpVtbl[6])((ITextDocument*)Unsafe.AsPointer(ref this), dispIdMember, riid, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetName(ITextDocument* pThis, winmdroot.Foundation.BSTR* pName)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetName(pName);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Gets the file name of this document. This is the ITextDocument default property.</summary>
/// <param name="pName">
/// <para>Type: <b>BSTR*</b> The file name.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getname#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns one of the following COM error codes. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getname">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetName(winmdroot.Foundation.BSTR* pName)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT>)lpVtbl[7])((ITextDocument*)Unsafe.AsPointer(ref this), pName).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetSelection(ITextDocument* pThis, winmdroot.UI.Controls.RichEdit.ITextSelection** ppSel)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetSelection(ppSel);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Gets the active selection. (ITextDocument.GetSelection)</summary>
/// <param name="ppSel">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextselection">ITextSelection</a>**</b> The active selection.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getselection#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns one of the following COM error codes. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getselection">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetSelection(winmdroot.UI.Controls.RichEdit.ITextSelection** ppSel)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.UI.Controls.RichEdit.ITextSelection** ,winmdroot.Foundation.HRESULT>)lpVtbl[8])((ITextDocument*)Unsafe.AsPointer(ref this), ppSel).ThrowOnFailure();
}
/// <inheritdoc cref="GetStoryCount(int*)"/>
internal unsafe void GetStoryCount(out int pCount)
{
fixed (int* pCountLocal = &pCount)
{
this.GetStoryCount(pCountLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetStoryCount(ITextDocument* pThis, int* pCount)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetStoryCount(pCount);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Gets the count of stories in this document.</summary>
/// <param name="pCount">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/WinProg/windows-data-types">LONG</a>*</b> The number of stories in the document.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getstorycount#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns the following COM error code. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>Rich edit controls have only one story and do not implement the <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-getstoryranges">ITextDocument::GetStoryRanges</a> method. To avoid getting an error when there is only one story, use <b>ITextDocument::GetStoryCount</b> to check the story count. If the story count is greater than one, then call <b>ITextDocument::GetStoryRanges</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getstorycount#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void GetStoryCount(int* pCount)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[9])((ITextDocument*)Unsafe.AsPointer(ref this), pCount).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetStoryRanges(ITextDocument* pThis, winmdroot.UI.Controls.RichEdit.ITextStoryRanges** ppStories)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetStoryRanges(ppStories);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Gets the story collection object used to enumerate the stories in a document.</summary>
/// <param name="ppStories">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextstoryranges">ITextStoryRanges</a>**</b> The <a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextstoryranges">ITextStoryRanges</a> pointer.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getstoryranges#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns the following COM error code. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>Invoke this method only if <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-getstorycount">ITextDocument::GetStoryCount</a> returns a value greater than 1.</remarks>
public unsafe void GetStoryRanges(winmdroot.UI.Controls.RichEdit.ITextStoryRanges** ppStories)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.UI.Controls.RichEdit.ITextStoryRanges** ,winmdroot.Foundation.HRESULT>)lpVtbl[10])((ITextDocument*)Unsafe.AsPointer(ref this), ppStories).ThrowOnFailure();
}
/// <inheritdoc cref="GetSaved(int*)"/>
internal unsafe void GetSaved(out int pValue)
{
fixed (int* pValueLocal = &pValue)
{
this.GetSaved(pValueLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetSaved(ITextDocument* pThis, int* pValue)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetSaved(pValue);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Gets a value that indicates whether changes have been made since the file was last saved.</summary>
/// <param name="pValue">
/// <para>Type: <b>long*</b> The value <b>tomTrue</b> if no changes have been made since the file was last saved, or the value <b>tomFalse</b> if there are unsaved changes.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getsaved#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns the following COM error code. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>To set the saved property, call the <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-setsaved">ITextDocument::SetSaved</a> method.</remarks>
public unsafe void GetSaved(int* pValue)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[11])((ITextDocument*)Unsafe.AsPointer(ref this), pValue).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT SetSaved(ITextDocument* pThis, winmdroot.UI.Controls.RichEdit.tomConstants Value)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.SetSaved(Value);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Sets the document Saved property.</summary>
/// <param name="Value">
/// <para>Type: <b>long</b> New value of the</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-setsaved#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> The return value is <b>S_OK</b>.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-setsaved">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public void SetSaved(winmdroot.UI.Controls.RichEdit.tomConstants Value)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.UI.Controls.RichEdit.tomConstants ,winmdroot.Foundation.HRESULT>)lpVtbl[12])((ITextDocument*)Unsafe.AsPointer(ref this), Value).ThrowOnFailure();
}
/// <inheritdoc cref="GetDefaultTabStop(float*)"/>
internal unsafe void GetDefaultTabStop(out float pValue)
{
fixed (float* pValueLocal = &pValue)
{
this.GetDefaultTabStop(pValueLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT GetDefaultTabStop(ITextDocument* pThis, float* pValue)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.GetDefaultTabStop(pValue);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Gets the default tab width.</summary>
/// <param name="pValue">
/// <para>Type: <b>float*</b> The default tab width.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-getdefaulttabstop#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If <i>pValue</i> is <b>NULL</b>, the method fails and it returns <b>E_INVALIDARG</b>. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>.</para>
/// </returns>
/// <remarks>The default tab width is used whenever no tab exists beyond the current display position. The default width is given in floating-point points.</remarks>
public unsafe void GetDefaultTabStop(float* pValue)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,float* ,winmdroot.Foundation.HRESULT>)lpVtbl[13])((ITextDocument*)Unsafe.AsPointer(ref this), pValue).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT SetDefaultTabStop(ITextDocument* pThis, float Value)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.SetDefaultTabStop(Value);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Sets the default tab stop, which is used when no tab exists beyond the current display position.</summary>
/// <param name="Value">
/// <para>Type: <b>float</b> New default tab setting, in floating-point points. Default value is 36.0 points, that is, 0.5 inches.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-setdefaulttabstop#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds it returns <b>S_OK</b>. If the method fails, it returns one of the following COM error codes. For more information on COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-setdefaulttabstop">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public void SetDefaultTabStop(float Value)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,float ,winmdroot.Foundation.HRESULT>)lpVtbl[14])((ITextDocument*)Unsafe.AsPointer(ref this), Value).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT New(ITextDocument* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.New();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Opens a new document.</summary>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the <b>ITextDocument::New</b> method succeeds, it returns <b>S_OK</b>.</para>
/// </returns>
/// <remarks>If another document is open, this method saves any current changes and closes the current document before opening a new one.</remarks>
public void New()
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.HRESULT>)lpVtbl[15])((ITextDocument*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
}
/// <inheritdoc cref="Open(winmdroot.System.Variant.VARIANT*, winmdroot.UI.Controls.RichEdit.tomConstants, int)"/>
internal unsafe void Open(in winmdroot.System.Variant.VARIANT pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage)
{
fixed (winmdroot.System.Variant.VARIANT* pVarLocal = &pVar)
{
this.Open(pVarLocal, Flags, CodePage);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Open(ITextDocument* pThis, winmdroot.System.Variant.VARIANT* pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Open(pVar, Flags, CodePage);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Opens a specified document. There are parameters to specify access and sharing privileges, creation and conversion of the file, as well as the code page for the file.</summary>
/// <param name="pVar">
/// <para>Type: <b>VARIANT*</b> A <b>VARIANT</b> that specifies the name of the file to open.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-open#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="Flags">
/// <para>Type: <b>long</b> The file creation, open, share, and conversion flags. Default value is zero, which gives read/write access and read/write sharing, open always, and automatic recognition of the file format (unrecognized file formats are treated as text). Other values are defined in the following groups.</para>
/// <para>Any combination of these values may be used.</para>
/// <para><a id="tomReadOnly"></a> <a id="tomreadonly"></a> <a id="TOMREADONLY"></a></para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-open#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="CodePage">
/// <para>Type: <b>long</b> The code page to use for the file. Zero (the default value) means <b>CP_ACP</b> (ANSI code page) unless the file begins with a Unicode BOM 0xfeff, in which case the file is considered to be Unicode. Note that code page 1200 is Unicode, <b>CP_UTF8</b> is UTF-8.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-open#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> The return value can be an <b>HRESULT</b> value that corresponds to a system error or COM error code, including one of the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>If a document is created with the <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-new">ITextDocument::New</a> method and the zero values are used, then the Text Object Model (TOM) engine has to choose which flags and code page to use. UTF-8 Rich Text Format (RTF) (defined below) is an attractive default. Microsoft Rich Edit 3.0 defines a control word, \urtf8, which should be used instead of \rtf1. This means the file is encoded in UTF-8. On input, RTF files contain the relevant code-page information, but this can be changed for saving purposes, thereby allowing one version to be translated to another. If the tomPasteFile flag is not set in the <i>Flags</i> parameter, the method first closes the current document after saving any unsaved changes. A file is recognized as a Unicode text file if it starts with the Unicode BOM 0xfeff. The <b>ITextDocument::Open</b> method strips off this Unicode BOM on input and <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-save">ITextDocument::Save</a> applies it on output. See the comments on the <b>ITextDocument::Save</b> method, which discuss putting the Unicode BOM at the beginning of Unicode plain-text files. The conversion values <b>tomRTF</b>, <b>tomHTML</b>, and <b>tomWordDocument</b> are used primarily for the <b>ITextDocument::Save</b> method, since these formats are easily recognized on input. Errors are reported by negative values, but because file operations have many kinds of errors, you may not need all of the error information provided. In particular, you may not care (or you may already know) which file facility is used, namely Windows (<c>pVar.vt = VT_BSTR</c>) or OLE storage for <a href="https://docs.microsoft.com/windows/desktop/api/objidl/nn-objidl-istorage">IStorage</a>. By masking off bit 18 of an <b>HRESULT</b> value, you can ignore the difference and compare to its <b>STG_E_xxx</b> value. For example:</para>
/// <para></para>
/// <para>This doc was truncated.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-open#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Open(winmdroot.System.Variant.VARIANT* pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.System.Variant.VARIANT* ,winmdroot.UI.Controls.RichEdit.tomConstants ,int ,winmdroot.Foundation.HRESULT>)lpVtbl[16])((ITextDocument*)Unsafe.AsPointer(ref this), pVar, Flags, CodePage).ThrowOnFailure();
}
/// <inheritdoc cref="Save(winmdroot.System.Variant.VARIANT*, winmdroot.UI.Controls.RichEdit.tomConstants, int)"/>
internal unsafe void Save(in winmdroot.System.Variant.VARIANT pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage)
{
fixed (winmdroot.System.Variant.VARIANT* pVarLocal = &pVar)
{
this.Save(pVarLocal, Flags, CodePage);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Save(ITextDocument* pThis, winmdroot.System.Variant.VARIANT* pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Save(pVar, Flags, CodePage);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Saves the document.</summary>
/// <param name="pVar">
/// <para>Type: <b>VARIANT*</b> The save target. This parameter is a <b>VARIANT</b>, which can be a file name, or <b>NULL</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-save#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="Flags">
/// <para>Type: <b>long</b> File creation, open, share, and conversion flags. For a list of possible values, see <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-open">ITextDocument::Open</a>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-save#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="CodePage">
/// <para>Type: <b>long</b> The specified code page. Common values are CP_ACP (zero: system ANSI code page), 1200 (Unicode), and 1208 (UTF-8).</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-save#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> The return value can be an <b>HRESULT</b> value that corresponds to a system error code or a COM error code, including one of the following values. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>To use the parameters that were specified for opening the file, use zero values for the parameters. If <i>pVar</i> is null or missing, the file name given by this document's name is used. If both of these are missing or null, the method fails. If <i>pVar</i> specifies a file name, that name should replace the current Name property. Similarly, the <i>Flags</i> and <i>CodePage</i> arguments can overrule those supplied in the <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-open">ITextDocument::Open</a> method and define the values to use for files created with the <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-new">ITextDocument::New</a> method. Unicode plain-text files should be saved with the Unicode byte-order mark (0xFEFF) as the first character. This character should be removed when the file is read in; that is, it is only used for import/export to identify the plain text as Unicode and to identify the byte order of that text. Microsoft Notepad adopted this convention, which is now recommended by the Unicode standard.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-save#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Save(winmdroot.System.Variant.VARIANT* pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.System.Variant.VARIANT* ,winmdroot.UI.Controls.RichEdit.tomConstants ,int ,winmdroot.Foundation.HRESULT>)lpVtbl[17])((ITextDocument*)Unsafe.AsPointer(ref this), pVar, Flags, CodePage).ThrowOnFailure();
}
/// <inheritdoc cref="Freeze(int*)"/>
internal unsafe void Freeze(out int pCount)
{
fixed (int* pCountLocal = &pCount)
{
this.Freeze(pCountLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Freeze(ITextDocument* pThis, int* pCount)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Freeze(pCount);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Increments the freeze count.</summary>
/// <param name="pCount">
/// <para>Type: <b>long*</b> The updated freeze count.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-freeze#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the <b>ITextDocument::Freeze</b> count is nonzero, it returns <b>S_OK</b>. If the <b>ITextDocument::Freeze</b> count is zero, it returns <b>FALSE</b>.</para>
/// </returns>
/// <remarks>If the freeze count is nonzero, screen updating is disabled. This allows a sequence of editing operations to be performed without the performance loss and flicker of screen updating. To decrement the freeze count, call the <a href="https://docs.microsoft.com/windows/desktop/api/tom/nf-tom-itextdocument-unfreeze">ITextDocument::Unfreeze</a> method.</remarks>
public unsafe void Freeze(int* pCount)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[18])((ITextDocument*)Unsafe.AsPointer(ref this), pCount).ThrowOnFailure();
}
/// <inheritdoc cref="Unfreeze(int*)"/>
internal unsafe void Unfreeze(out int pCount)
{
fixed (int* pCountLocal = &pCount)
{
this.Unfreeze(pCountLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Unfreeze(ITextDocument* pThis, int* pCount)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Unfreeze(pCount);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Decrements the freeze count.</summary>
/// <param name="pCount">
/// <para>Type: <b>long*</b> The updated freeze count.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-unfreeze#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the freeze count is zero, the method returns <b>S_OK</b>. If the method fails, it returns <b>S_FALSE</b>, indicating that the freeze count is nonzero. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>.</para>
/// </returns>
/// <remarks>
/// <para>If the freeze count goes to zero, screen updating is enabled. This method cannot decrement the count below zero, and no error occurs if it is executed with a zero freeze count. Note, if edit collection is active, screen updating is suppressed, even if the freeze count is zero.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-unfreeze#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Unfreeze(int* pCount)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[19])((ITextDocument*)Unsafe.AsPointer(ref this), pCount).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT BeginEditCollection(ITextDocument* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.BeginEditCollection();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Turns on edit collection (also called undo grouping).</summary>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns one of the following COM error codes. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para>A single <b>Undo</b> command undoes all changes made while edit collection is turned on.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-begineditcollection#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
public void BeginEditCollection()
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.HRESULT>)lpVtbl[20])((ITextDocument*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT EndEditCollection(ITextDocument* pThis)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.EndEditCollection();
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Turns off edit collection (also called undo grouping).</summary>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns the following COM error code. For more information about COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>The screen is unfrozen unless the freeze count is nonzero.</remarks>
public void EndEditCollection()
{
((delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.HRESULT>)lpVtbl[21])((ITextDocument*)Unsafe.AsPointer(ref this)).ThrowOnFailure();
}
/// <inheritdoc cref="Undo(int, int*)"/>
internal unsafe void Undo(int Count, out int pCount)
{
fixed (int* pCountLocal = &pCount)
{
this.Undo(Count, pCountLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Undo(ITextDocument* pThis, int Count, int* pCount)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Undo(Count, pCount);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Performs a specified number of undo operations.</summary>
/// <param name="Count">
/// <para>Type: <b>long</b> The specified number of undo operations. If the value of this parameter is <b>tomFalse</b>, undo processing is suspended. If this parameter is <b>tomTrue</b>, undo processing is restored.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-undo#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="pCount">
/// <para>Type: <b>long*</b> The actual count of undo operations performed. This parameter can be <b>NULL</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-undo#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If all of the <i>Count</i> undo operations were performed, it returns <b>S_OK</b>. If the method fails, it returns <b>S_FALSE</b>, indicating that less than <i>Count</i> undo operations were performed. For more information on COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-undo">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Undo(int Count, int* pCount)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[22])((ITextDocument*)Unsafe.AsPointer(ref this), Count, pCount).ThrowOnFailure();
}
/// <inheritdoc cref="Redo(int, int*)"/>
internal unsafe void Redo(int Count, out int pCount)
{
fixed (int* pCountLocal = &pCount)
{
this.Redo(Count, pCountLocal);
}
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Redo(ITextDocument* pThis, int Count, int* pCount)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Redo(Count, pCount);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Performs a specified number of redo operations.</summary>
/// <param name="Count">
/// <para>Type: <b>long</b> The number of redo operations specified.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-redo#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="pCount">
/// <para>Type: <b>long*</b> The actual count of redo operations performed. This parameter can be <b>NULL</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-redo#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds it returns <b>S_OK</b>. If the method fails, it returns the following COM error code. For more information on COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-redo">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void Redo(int Count, int* pCount)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int ,int* ,winmdroot.Foundation.HRESULT>)lpVtbl[23])((ITextDocument*)Unsafe.AsPointer(ref this), Count, pCount).ThrowOnFailure();
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT Range(ITextDocument* pThis, int cpActive, int cpAnchor, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.Range(cpActive, cpAnchor, ppRange);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves a text range object for a specified range of content in the active story of the document.</summary>
/// <param name="cpActive">
/// <para>Type: <b>long</b> The start position of new range. The default value is zero, which represents the start of the document.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-range#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="cpAnchor">
/// <para>Type: <b>long</b> The end position of new range. The default value is zero.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-range#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="ppRange">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextrange">ITextRange</a>**</b> Address of a pointer to a variable of type <a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextrange">ITextRange</a> that receives a pointer to the specified text range.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-range#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns one of the following COM error codes. For more information on COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-range">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe winmdroot.Foundation.HRESULT Range(int cpActive, int cpAnchor, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange)
{
return ((delegate *unmanaged [Stdcall]<ITextDocument*,int ,int ,winmdroot.UI.Controls.RichEdit.ITextRange** ,winmdroot.Foundation.HRESULT>)lpVtbl[24])((ITextDocument*)Unsafe.AsPointer(ref this), cpActive, cpAnchor, ppRange);
}
[UnmanagedCallersOnly(CallConvs = new []{
typeof(CallConvStdcall)}
)]
private static winmdroot.Foundation.HRESULT RangeFromPoint(ITextDocument* pThis, int x, int y, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange)
{
try
{
winmdroot.Foundation.HRESULT __hr = ComHelpers.UnwrapCCW(pThis, out Interface __object);
if (__hr.Failed)
{
return __hr;
}
return __object.RangeFromPoint(x, y, ppRange);
}
catch (Exception ex)
{
return (winmdroot.Foundation.HRESULT)ex.HResult;
}
}
/// <summary>Retrieves a range for the content at or nearest to the specified point on the screen.</summary>
/// <param name="x">
/// <para>Type: <b>long</b> The horizontal coordinate of the specified point, in screen coordinates.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-rangefrompoint#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="y">
/// <para>Type: <b>long</b> The vertical coordinate of the specified point, in screen coordinates.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-rangefrompoint#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="ppRange">
/// <para>Type: <b><a href="https://docs.microsoft.com/windows/desktop/api/tom/nn-tom-itextrange">ITextRange</a>**</b> The text range that corresponds to the specified point.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-rangefrompoint#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <returns>
/// <para>Type: <b>HRESULT</b> If the method succeeds, it returns <b>S_OK</b>. If the method fails, it returns one of the following COM error codes. For more information on COM error codes, see <a href="https://docs.microsoft.com/windows/desktop/com/error-handling-in-com">Error Handling in COM</a>. </para>
/// <para>This doc was truncated.</para>
/// </returns>
/// <remarks>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/tom/nf-tom-itextdocument-rangefrompoint">Learn more about this API from docs.microsoft.com</see>.</para>
/// </remarks>
public unsafe void RangeFromPoint(int x, int y, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange)
{
((delegate *unmanaged [Stdcall]<ITextDocument*,int ,int ,winmdroot.UI.Controls.RichEdit.ITextRange** ,winmdroot.Foundation.HRESULT>)lpVtbl[25])((ITextDocument*)Unsafe.AsPointer(ref this), x, y, ppRange).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]<ITextDocument*,global::System.Guid* ,void** ,winmdroot.Foundation.HRESULT> QueryInterface_1;
internal delegate *unmanaged [Stdcall]<ITextDocument*,uint> AddRef_2;
internal delegate *unmanaged [Stdcall]<ITextDocument*,uint> Release_3;
internal delegate *unmanaged [Stdcall]<ITextDocument*,uint* ,winmdroot.Foundation.HRESULT> GetTypeInfoCount_4;
internal delegate *unmanaged [Stdcall]<ITextDocument*,uint ,uint ,winmdroot.System.Com.ITypeInfo** ,winmdroot.Foundation.HRESULT> GetTypeInfo_5;
internal delegate *unmanaged [Stdcall]<ITextDocument*,global::System.Guid* ,winmdroot.Foundation.PWSTR* ,uint ,uint ,int* ,winmdroot.Foundation.HRESULT> GetIDsOfNames_6;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int ,global::System.Guid* ,uint ,winmdroot.System.Com.DISPATCH_FLAGS ,winmdroot.System.Com.DISPPARAMS* ,winmdroot.System.Variant.VARIANT* ,winmdroot.System.Com.EXCEPINFO* ,uint* ,winmdroot.Foundation.HRESULT> Invoke_7;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.BSTR* ,winmdroot.Foundation.HRESULT> GetName_8;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.UI.Controls.RichEdit.ITextSelection** ,winmdroot.Foundation.HRESULT> GetSelection_9;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT> GetStoryCount_10;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.UI.Controls.RichEdit.ITextStoryRanges** ,winmdroot.Foundation.HRESULT> GetStoryRanges_11;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT> GetSaved_12;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.UI.Controls.RichEdit.tomConstants ,winmdroot.Foundation.HRESULT> SetSaved_13;
internal delegate *unmanaged [Stdcall]<ITextDocument*,float* ,winmdroot.Foundation.HRESULT> GetDefaultTabStop_14;
internal delegate *unmanaged [Stdcall]<ITextDocument*,float ,winmdroot.Foundation.HRESULT> SetDefaultTabStop_15;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.HRESULT> New_16;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.System.Variant.VARIANT* ,winmdroot.UI.Controls.RichEdit.tomConstants ,int ,winmdroot.Foundation.HRESULT> Open_17;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.System.Variant.VARIANT* ,winmdroot.UI.Controls.RichEdit.tomConstants ,int ,winmdroot.Foundation.HRESULT> Save_18;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT> Freeze_19;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int* ,winmdroot.Foundation.HRESULT> Unfreeze_20;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.HRESULT> BeginEditCollection_21;
internal delegate *unmanaged [Stdcall]<ITextDocument*,winmdroot.Foundation.HRESULT> EndEditCollection_22;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int ,int* ,winmdroot.Foundation.HRESULT> Undo_23;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int ,int* ,winmdroot.Foundation.HRESULT> Redo_24;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int ,int ,winmdroot.UI.Controls.RichEdit.ITextRange** ,winmdroot.Foundation.HRESULT> Range_25;
internal delegate *unmanaged [Stdcall]<ITextDocument*,int ,int ,winmdroot.UI.Controls.RichEdit.ITextRange** ,winmdroot.Foundation.HRESULT> RangeFromPoint_26;
}
public static void PopulateVTable(Vtbl* vtable)
{
vtable->GetName_8 = &GetName;
vtable->GetSelection_9 = &GetSelection;
vtable->GetStoryCount_10 = &GetStoryCount;
vtable->GetStoryRanges_11 = &GetStoryRanges;
vtable->GetSaved_12 = &GetSaved;
vtable->SetSaved_13 = &SetSaved;
vtable->GetDefaultTabStop_14 = &GetDefaultTabStop;
vtable->SetDefaultTabStop_15 = &SetDefaultTabStop;
vtable->New_16 = &New;
vtable->Open_17 = &Open;
vtable->Save_18 = &Save;
vtable->Freeze_19 = &Freeze;
vtable->Unfreeze_20 = &Unfreeze;
vtable->BeginEditCollection_21 = &BeginEditCollection;
vtable->EndEditCollection_22 = &EndEditCollection;
vtable->Undo_23 = &Undo;
vtable->Redo_24 = &Redo;
vtable->Range_25 = &Range;
vtable->RangeFromPoint_26 = &RangeFromPoint;
}
private void** lpVtbl;
/// <summary>The IID guid for this interface.</summary>
/// <value>{8cc497c0-a1df-11ce-8098-00aa0047be5d}</value>
internal static readonly Guid IID_Guid = new Guid(0x8CC497C0, 0xA1DF, 0x11CE, 0x80, 0x98, 0x00, 0xAA, 0x00, 0x47, 0xBE, 0x5D);
static ref readonly Guid IComIID.Guid {
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data = new byte[] {
0xC0,0x97,0xC4,0x8C,0xDF,0xA1,0xCE,0x11,0x80,0x98,0x00,0xAA,0x00,0x47,0xBE,0x5D };
return ref Unsafe.As<byte,Guid>(ref MemoryMarshal.GetReference(data));
}
}
[Guid("8CC497C0-A1DF-11CE-8098-00AA0047BE5D"),InterfaceType(ComInterfaceType.InterfaceIsDual),ComImport()]
[SupportedOSPlatform("windows6.0.6000")]
internal interface Interface
{
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetName(winmdroot.Foundation.BSTR* pName);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetSelection(winmdroot.UI.Controls.RichEdit.ITextSelection** ppSel);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetStoryCount(int* pCount);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetStoryRanges(winmdroot.UI.Controls.RichEdit.ITextStoryRanges** ppStories);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetSaved(int* pValue);
[PreserveSig()]
winmdroot.Foundation.HRESULT SetSaved(winmdroot.UI.Controls.RichEdit.tomConstants Value);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT GetDefaultTabStop(float* pValue);
[PreserveSig()]
winmdroot.Foundation.HRESULT SetDefaultTabStop(float Value);
[PreserveSig()]
winmdroot.Foundation.HRESULT New();
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Open(winmdroot.System.Variant.VARIANT* pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Save(winmdroot.System.Variant.VARIANT* pVar, winmdroot.UI.Controls.RichEdit.tomConstants Flags, int CodePage);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Freeze(int* pCount);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Unfreeze(int* pCount);
[PreserveSig()]
winmdroot.Foundation.HRESULT BeginEditCollection();
[PreserveSig()]
winmdroot.Foundation.HRESULT EndEditCollection();
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Undo(int Count, int* pCount);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Redo(int Count, int* pCount);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT Range(int cpActive, int cpAnchor, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange);
[PreserveSig()]
unsafe winmdroot.Foundation.HRESULT RangeFromPoint(int x, int y, winmdroot.UI.Controls.RichEdit.ITextRange** ppRange);
}
}
}
}
|