// ------------------------------------------------------------------------------
// <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>
// ------------------------------------------------------------------------------

namespace Win32.Graphics.DirectWrite;

/// <include file='../DirectWrite.xml' path='doc/member[@name="IDWriteFontCollection"]/*' />
/// <unmanaged>IDWriteFontCollection</unmanaged>
[Guid("a84cee02-3eea-4eee-a827-87c1a02a0fcc")]
[NativeTypeName("struct IDWriteFontCollection : IUnknown")]
[NativeInheritance("IUnknown")]
public unsafe partial struct IDWriteFontCollection : IDWriteFontCollection.Interface, INativeGuid
{
	public static ref readonly Guid IID_IDWriteFontCollection
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0x02, 0xEE, 0x4C, 0xA8,
				0xEA, 0x3E,
				0xEE, 0x4E,
				0xA8,
				0x27,
				0x87,
				0xC1,
				0xA0,
				0x2A,
				0x0F,
				0xCC
			};

			Debug.Assert(data.Length == Unsafe.SizeOf<Guid>());
			return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
		}
	}

#if NET6_0_OR_GREATER
	static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IDWriteFontCollection));
#else
	public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IDWriteFontCollection));
#endif

	public void** lpVtbl;

	/// <inheritdoc cref="IUnknown.QueryInterface" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(0)]
	public HResult QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
	{
		return ((delegate* unmanaged[Stdcall]<IDWriteFontCollection*, Guid*, void**, int>)(lpVtbl[0]))((IDWriteFontCollection*)Unsafe.AsPointer(ref this), riid, ppvObject);
	}

	/// <inheritdoc cref="IUnknown.AddRef" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(1)]
	[return: NativeTypeName("ULONG")]
	public uint AddRef()
	{
		return ((delegate* unmanaged[Stdcall]<IDWriteFontCollection*, uint>)(lpVtbl[1]))((IDWriteFontCollection*)Unsafe.AsPointer(ref this));
	}

	/// <inheritdoc cref="IUnknown.Release" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(2)]
	[return: NativeTypeName("ULONG")]
	public uint Release()
	{
		return ((delegate* unmanaged[Stdcall]<IDWriteFontCollection*, uint>)(lpVtbl[2]))((IDWriteFontCollection*)Unsafe.AsPointer(ref this));
	}

	/// <include file='../DirectWrite.xml' path='doc/member[@name="IDWriteFontCollection::GetFontFamilyCount"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(3)]
	public uint GetFontFamilyCount()
	{
		return ((delegate* unmanaged[Stdcall]<IDWriteFontCollection*, uint>)(lpVtbl[3]))((IDWriteFontCollection*)Unsafe.AsPointer(ref this));
	}

	/// <include file='../DirectWrite.xml' path='doc/member[@name="IDWriteFontCollection::GetFontFamily"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(4)]
	public HResult GetFontFamily(uint index, IDWriteFontFamily** fontFamily)
	{
		return ((delegate* unmanaged[Stdcall]<IDWriteFontCollection*, uint, IDWriteFontFamily**, int>)(lpVtbl[4]))((IDWriteFontCollection*)Unsafe.AsPointer(ref this), index, fontFamily);
	}

	/// <include file='../DirectWrite.xml' path='doc/member[@name="IDWriteFontCollection::FindFamilyName"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(5)]
	public HResult FindFamilyName(ushort* familyName, uint* index, Bool32* exists)
	{
		return ((delegate* unmanaged[Stdcall]<IDWriteFontCollection*, ushort*, uint*, Bool32*, int>)(lpVtbl[5]))((IDWriteFontCollection*)Unsafe.AsPointer(ref this), familyName, index, exists);
	}

	/// <include file='../DirectWrite.xml' path='doc/member[@name="IDWriteFontCollection::GetFontFromFontFace"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(6)]
	public HResult GetFontFromFontFace(IDWriteFontFace* fontFace, IDWriteFont** font)
	{
		return ((delegate* unmanaged[Stdcall]<IDWriteFontCollection*, IDWriteFontFace*, IDWriteFont**, int>)(lpVtbl[6]))((IDWriteFontCollection*)Unsafe.AsPointer(ref this), fontFace, font);
	}
	public interface Interface : IUnknown.Interface
	{
		[VtblIndex(3)]
		uint GetFontFamilyCount();

		[VtblIndex(4)]
		HResult GetFontFamily(uint index, IDWriteFontFamily** fontFamily);

		[VtblIndex(5)]
		HResult FindFamilyName(ushort* familyName, uint* index, Bool32* exists);

		[VtblIndex(6)]
		HResult GetFontFromFontFace(IDWriteFontFace* fontFace, IDWriteFont** font);
	}
}

