#![allow(
non_snake_case,
non_upper_case_globals,
non_camel_case_types,
dead_code,
clippy::all
)]
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[doc = include_str!("./bindings_docs/Color.md")]
pub struct Color {
#[doc = include_str!("./bindings_docs/Color/R.md")]
pub R: u8,
#[doc = include_str!("./bindings_docs/Color/G.md")]
pub G: u8,
#[doc = include_str!("./bindings_docs/Color/B.md")]
pub B: u8,
#[doc = include_str!("./bindings_docs/Color/A.md")]
pub A: u8,
}
impl windows_core::TypeKind for Color {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for Color {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice(
b"struct(Microsoft.CommandPalette.Extensions.Color;u1;u1;u1;u1)",
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
#[doc = include_str!("./bindings_docs/CommandResultKind.md")]
pub struct CommandResultKind(pub i32);
impl CommandResultKind {
#[doc = include_str!("./bindings_docs/CommandResultKind/Dismiss.md")]
pub const Dismiss: Self = Self(0i32);
#[doc = include_str!("./bindings_docs/CommandResultKind/GoHome.md")]
pub const GoHome: Self = Self(1i32);
#[doc = include_str!("./bindings_docs/CommandResultKind/GoBack.md")]
pub const GoBack: Self = Self(2i32);
#[doc = include_str!("./bindings_docs/CommandResultKind/Hide.md")]
pub const Hide: Self = Self(3i32);
#[doc = include_str!("./bindings_docs/CommandResultKind/KeepOpen.md")]
pub const KeepOpen: Self = Self(4i32);
#[doc = include_str!("./bindings_docs/CommandResultKind/GoToPage.md")]
pub const GoToPage: Self = Self(5i32);
#[doc = include_str!("./bindings_docs/CommandResultKind/ShowToast.md")]
pub const ShowToast: Self = Self(6i32);
#[doc = include_str!("./bindings_docs/CommandResultKind/Confirm.md")]
pub const Confirm: Self = Self(7i32);
}
impl windows_core::TypeKind for CommandResultKind {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for CommandResultKind {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.CommandPalette.Extensions.CommandResultKind;i4)",
);
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommand,
ICommand_Vtbl,
0x6dff9c8d_930f_518d_a8ad_85b869642eae
);
impl windows_core::RuntimeType for ICommand {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommand,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(ICommand, INotifyPropChanged);
impl ICommand {
#[doc = include_str!("./bindings_docs/ICommand/Name.md")]
pub fn Name(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Name)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommand/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommand/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommand/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommand/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for ICommand {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommand";
}
pub trait ICommand_Impl: INotifyPropChanged_Impl {
fn Name(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Id(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Icon(&self) -> windows_core::Result<IIconInfo>;
}
impl ICommand_Vtbl {
pub const fn new<Identity: ICommand_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Name<Identity: ICommand_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommand_Impl::Name(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Id<Identity: ICommand_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommand_Impl::Id(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Icon<Identity: ICommand_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommand_Impl::Icon(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommand, OFFSET>(),
Name: Name::<Identity, OFFSET>,
Id: Id::<Identity, OFFSET>,
Icon: Icon::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommand as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommand_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Name: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Id: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Icon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommandContextItem,
ICommandContextItem_Vtbl,
0xf470783d_ce7c_52fe_9b6c_899294ec6e1e
);
impl windows_core::RuntimeType for ICommandContextItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommandContextItem,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(
ICommandContextItem,
ICommandItem,
IContextItem,
INotifyPropChanged
);
impl ICommandContextItem {
#[doc = include_str!("./bindings_docs/ICommandContextItem/IsCritical.md")]
pub fn IsCritical(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsCritical)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/RequestedShortcut.md")]
pub fn RequestedShortcut(&self) -> windows_core::Result<KeyChord> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).RequestedShortcut)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/Command.md")]
pub fn Command(&self) -> windows_core::Result<ICommand> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Command)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/MoreCommands.md")]
pub fn MoreCommands(&self) -> windows_core::Result<windows_core::Array<IContextItem>> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).MoreCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IContextItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/Subtitle.md")]
pub fn Subtitle(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Subtitle)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandContextItem/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for ICommandContextItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommandContextItem";
}
pub trait ICommandContextItem_Impl:
ICommandItem_Impl + IContextItem_Impl + INotifyPropChanged_Impl
{
fn IsCritical(&self) -> windows_core::Result<bool>;
fn RequestedShortcut(&self) -> windows_core::Result<KeyChord>;
}
impl ICommandContextItem_Vtbl {
pub const fn new<Identity: ICommandContextItem_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn IsCritical<
Identity: ICommandContextItem_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandContextItem_Impl::IsCritical(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn RequestedShortcut<
Identity: ICommandContextItem_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut KeyChord,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandContextItem_Impl::RequestedShortcut(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommandContextItem, OFFSET>(),
IsCritical: IsCritical::<Identity, OFFSET>,
RequestedShortcut: RequestedShortcut::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommandContextItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommandContextItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub IsCritical:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub RequestedShortcut:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut KeyChord) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommandItem,
ICommandItem_Vtbl,
0x42800e8e_d48a_59df_810d_6e82bf1837fa
);
impl windows_core::RuntimeType for ICommandItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommandItem,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(ICommandItem, INotifyPropChanged);
impl ICommandItem {
#[doc = include_str!("./bindings_docs/ICommandItem/Command.md")]
pub fn Command(&self) -> windows_core::Result<ICommand> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Command)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandItem/MoreCommands.md")]
pub fn MoreCommands(&self) -> windows_core::Result<windows_core::Array<IContextItem>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).MoreCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IContextItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ICommandItem/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandItem/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandItem/Subtitle.md")]
pub fn Subtitle(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Subtitle)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandItem/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandItem/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for ICommandItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommandItem";
}
pub trait ICommandItem_Impl: INotifyPropChanged_Impl {
fn Command(&self) -> windows_core::Result<ICommand>;
fn MoreCommands(&self) -> windows_core::Result<windows_core::Array<IContextItem>>;
fn Icon(&self) -> windows_core::Result<IIconInfo>;
fn Title(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Subtitle(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl ICommandItem_Vtbl {
pub const fn new<Identity: ICommandItem_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Command<Identity: ICommandItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandItem_Impl::Command(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn MoreCommands<Identity: ICommandItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandItem_Impl::MoreCommands(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Icon<Identity: ICommandItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandItem_Impl::Icon(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Title<Identity: ICommandItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandItem_Impl::Title(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Subtitle<Identity: ICommandItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandItem_Impl::Subtitle(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommandItem, OFFSET>(),
Command: Command::<Identity, OFFSET>,
MoreCommands: MoreCommands::<Identity, OFFSET>,
Icon: Icon::<Identity, OFFSET>,
Title: Title::<Identity, OFFSET>,
Subtitle: Subtitle::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommandItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommandItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Command: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub MoreCommands: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Icon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Title: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Subtitle: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommandProvider,
ICommandProvider_Vtbl,
0x59aad2e7_347a_5a94_b576_69bda7cbecc5
);
impl windows_core::RuntimeType for ICommandProvider {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommandProvider,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(
ICommandProvider,
windows::Foundation::IClosable,
INotifyItemsChanged
);
impl ICommandProvider {
#[doc = include_str!("./bindings_docs/ICommandProvider/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/DisplayName.md")]
pub fn DisplayName(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DisplayName)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/Settings.md")]
pub fn Settings(&self) -> windows_core::Result<ICommandSettings> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Settings)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/Frozen.md")]
pub fn Frozen(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Frozen)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/TopLevelCommands.md")]
pub fn TopLevelCommands(&self) -> windows_core::Result<windows_core::Array<ICommandItem>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).TopLevelCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<ICommandItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/FallbackCommands.md")]
pub fn FallbackCommands(
&self,
) -> windows_core::Result<windows_core::Array<IFallbackCommandItem>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).FallbackCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IFallbackCommandItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/GetCommand.md")]
pub fn GetCommand(&self, id: &windows_core::HSTRING) -> windows_core::Result<ICommand> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetCommand)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(id),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/InitializeWithHost.md")]
pub fn InitializeWithHost<P0>(&self, host: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<IExtensionHost>,
{
let this = self;
unsafe {
(windows_core::Interface::vtable(this).InitializeWithHost)(
windows_core::Interface::as_raw(this),
host.param().abi(),
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/Close.md")]
pub fn Close(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<windows::Foundation::IClosable>(self)?;
unsafe {
(windows_core::Interface::vtable(this).Close)(windows_core::Interface::as_raw(this))
.ok()
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/ItemsChanged.md")]
pub fn ItemsChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ItemsChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider/RemoveItemsChanged.md")]
pub fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveItemsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for ICommandProvider {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommandProvider";
}
pub trait ICommandProvider_Impl:
windows::Foundation::IClosable_Impl + INotifyItemsChanged_Impl
{
fn Id(&self) -> windows_core::Result<windows_core::HSTRING>;
fn DisplayName(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Icon(&self) -> windows_core::Result<IIconInfo>;
fn Settings(&self) -> windows_core::Result<ICommandSettings>;
fn Frozen(&self) -> windows_core::Result<bool>;
fn TopLevelCommands(&self) -> windows_core::Result<windows_core::Array<ICommandItem>>;
fn FallbackCommands(&self) -> windows_core::Result<windows_core::Array<IFallbackCommandItem>>;
fn GetCommand(&self, id: &windows_core::HSTRING) -> windows_core::Result<ICommand>;
fn InitializeWithHost(
&self,
host: windows_core::Ref<'_, IExtensionHost>,
) -> windows_core::Result<()>;
}
impl ICommandProvider_Vtbl {
pub const fn new<Identity: ICommandProvider_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Id<Identity: ICommandProvider_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::Id(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn DisplayName<
Identity: ICommandProvider_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::DisplayName(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Icon<Identity: ICommandProvider_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::Icon(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Settings<Identity: ICommandProvider_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::Settings(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Frozen<Identity: ICommandProvider_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::Frozen(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn TopLevelCommands<
Identity: ICommandProvider_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::TopLevelCommands(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn FallbackCommands<
Identity: ICommandProvider_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::FallbackCommands(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn GetCommand<
Identity: ICommandProvider_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
id: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider_Impl::GetCommand(this, core::mem::transmute(&id)) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn InitializeWithHost<
Identity: ICommandProvider_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
host: *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
ICommandProvider_Impl::InitializeWithHost(this, core::mem::transmute_copy(&host))
.into()
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommandProvider, OFFSET>(),
Id: Id::<Identity, OFFSET>,
DisplayName: DisplayName::<Identity, OFFSET>,
Icon: Icon::<Identity, OFFSET>,
Settings: Settings::<Identity, OFFSET>,
Frozen: Frozen::<Identity, OFFSET>,
TopLevelCommands: TopLevelCommands::<Identity, OFFSET>,
FallbackCommands: FallbackCommands::<Identity, OFFSET>,
GetCommand: GetCommand::<Identity, OFFSET>,
InitializeWithHost: InitializeWithHost::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommandProvider as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommandProvider_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Id: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub DisplayName: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Icon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Settings: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Frozen:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub TopLevelCommands: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub FallbackCommands: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub GetCommand: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub InitializeWithHost: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommandProvider2,
ICommandProvider2_Vtbl,
0xcc965e1c_1b49_5ab7_8abf_0a59c36a5e19
);
impl windows_core::RuntimeType for ICommandProvider2 {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommandProvider2,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(
ICommandProvider2,
windows::Foundation::IClosable,
ICommandProvider,
INotifyItemsChanged
);
impl ICommandProvider2 {
#[doc = include_str!("./bindings_docs/ICommandProvider2/GetApiExtensionStubs.md")]
pub fn GetApiExtensionStubs(
&self,
) -> windows_core::Result<windows_core::Array<windows_core::IInspectable>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).GetApiExtensionStubs)(
windows_core::Interface::as_raw(this),
windows_core::Array::<windows_core::IInspectable>::set_abi_len(
core::mem::transmute(&mut result__),
),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/Close.md")]
pub fn Close(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<windows::Foundation::IClosable>(self)?;
unsafe {
(windows_core::Interface::vtable(this).Close)(windows_core::Interface::as_raw(this))
.ok()
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/DisplayName.md")]
pub fn DisplayName(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DisplayName)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/Settings.md")]
pub fn Settings(&self) -> windows_core::Result<ICommandSettings> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Settings)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/Frozen.md")]
pub fn Frozen(&self) -> windows_core::Result<bool> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Frozen)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/TopLevelCommands.md")]
pub fn TopLevelCommands(&self) -> windows_core::Result<windows_core::Array<ICommandItem>> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).TopLevelCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<ICommandItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/FallbackCommands.md")]
pub fn FallbackCommands(
&self,
) -> windows_core::Result<windows_core::Array<IFallbackCommandItem>> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).FallbackCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IFallbackCommandItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/GetCommand.md")]
pub fn GetCommand(&self, id: &windows_core::HSTRING) -> windows_core::Result<ICommand> {
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetCommand)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(id),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/InitializeWithHost.md")]
pub fn InitializeWithHost<P0>(&self, host: P0) -> windows_core::Result<()>
where
P0: windows_core::Param<IExtensionHost>,
{
let this = &windows_core::Interface::cast::<ICommandProvider>(self)?;
unsafe {
(windows_core::Interface::vtable(this).InitializeWithHost)(
windows_core::Interface::as_raw(this),
host.param().abi(),
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/ItemsChanged.md")]
pub fn ItemsChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ItemsChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandProvider2/RemoveItemsChanged.md")]
pub fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveItemsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for ICommandProvider2 {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommandProvider2";
}
pub trait ICommandProvider2_Impl:
windows::Foundation::IClosable_Impl + ICommandProvider_Impl + INotifyItemsChanged_Impl
{
fn GetApiExtensionStubs(
&self,
) -> windows_core::Result<windows_core::Array<windows_core::IInspectable>>;
}
impl ICommandProvider2_Vtbl {
pub const fn new<Identity: ICommandProvider2_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn GetApiExtensionStubs<
Identity: ICommandProvider2_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandProvider2_Impl::GetApiExtensionStubs(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommandProvider2, OFFSET>(),
GetApiExtensionStubs: GetApiExtensionStubs::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommandProvider2 as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommandProvider2_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetApiExtensionStubs: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommandResult,
ICommandResult_Vtbl,
0xedd5f9d0_eea0_51e3_a3b9_b6ee73e57d91
);
impl windows_core::RuntimeType for ICommandResult {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommandResult,
windows_core::IUnknown,
windows_core::IInspectable
);
impl ICommandResult {
#[doc = include_str!("./bindings_docs/ICommandResult/Kind.md")]
pub fn Kind(&self) -> windows_core::Result<CommandResultKind> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Kind)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ICommandResult/Args.md")]
pub fn Args(&self) -> windows_core::Result<ICommandResultArgs> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Args)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for ICommandResult {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommandResult";
}
pub trait ICommandResult_Impl: windows_core::IUnknownImpl {
fn Kind(&self) -> windows_core::Result<CommandResultKind>;
fn Args(&self) -> windows_core::Result<ICommandResultArgs>;
}
impl ICommandResult_Vtbl {
pub const fn new<Identity: ICommandResult_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Kind<Identity: ICommandResult_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut CommandResultKind,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandResult_Impl::Kind(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Args<Identity: ICommandResult_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandResult_Impl::Args(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommandResult, OFFSET>(),
Kind: Kind::<Identity, OFFSET>,
Args: Args::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommandResult as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommandResult_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Kind: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut CommandResultKind,
) -> windows_core::HRESULT,
pub Args: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommandResultArgs,
ICommandResultArgs_Vtbl,
0xf9d6423b_bd5e_44bb_a204_2f5c77a72396
);
impl windows_core::RuntimeType for ICommandResultArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommandResultArgs,
windows_core::IUnknown,
windows_core::IInspectable
);
impl windows_core::RuntimeName for ICommandResultArgs {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommandResultArgs";
}
pub trait ICommandResultArgs_Impl: windows_core::IUnknownImpl {}
impl ICommandResultArgs_Vtbl {
pub const fn new<Identity: ICommandResultArgs_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommandResultArgs, OFFSET>(),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommandResultArgs as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommandResultArgs_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ICommandSettings,
ICommandSettings_Vtbl,
0xf1a5bc67_9267_5de8_afbe_742ec201754a
);
impl windows_core::RuntimeType for ICommandSettings {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ICommandSettings,
windows_core::IUnknown,
windows_core::IInspectable
);
impl ICommandSettings {
#[doc = include_str!("./bindings_docs/ICommandSettings/SettingsPage.md")]
pub fn SettingsPage(&self) -> windows_core::Result<IContentPage> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).SettingsPage)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for ICommandSettings {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ICommandSettings";
}
pub trait ICommandSettings_Impl: windows_core::IUnknownImpl {
fn SettingsPage(&self) -> windows_core::Result<IContentPage>;
}
impl ICommandSettings_Vtbl {
pub const fn new<Identity: ICommandSettings_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn SettingsPage<
Identity: ICommandSettings_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ICommandSettings_Impl::SettingsPage(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ICommandSettings, OFFSET>(),
SettingsPage: SettingsPage::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ICommandSettings as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ICommandSettings_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub SettingsPage: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IConfirmationArgs,
IConfirmationArgs_Vtbl,
0xddeaa3a3_02b8_58e2_98fd_69c50d49469f
);
impl windows_core::RuntimeType for IConfirmationArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IConfirmationArgs,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IConfirmationArgs, ICommandResultArgs);
impl IConfirmationArgs {
#[doc = include_str!("./bindings_docs/IConfirmationArgs/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IConfirmationArgs/Description.md")]
pub fn Description(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Description)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IConfirmationArgs/PrimaryCommand.md")]
pub fn PrimaryCommand(&self) -> windows_core::Result<ICommand> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PrimaryCommand)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IConfirmationArgs/IsPrimaryCommandCritical.md")]
pub fn IsPrimaryCommandCritical(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsPrimaryCommandCritical)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeName for IConfirmationArgs {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IConfirmationArgs";
}
pub trait IConfirmationArgs_Impl: ICommandResultArgs_Impl {
fn Title(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Description(&self) -> windows_core::Result<windows_core::HSTRING>;
fn PrimaryCommand(&self) -> windows_core::Result<ICommand>;
fn IsPrimaryCommandCritical(&self) -> windows_core::Result<bool>;
}
impl IConfirmationArgs_Vtbl {
pub const fn new<Identity: IConfirmationArgs_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Title<Identity: IConfirmationArgs_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IConfirmationArgs_Impl::Title(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Description<
Identity: IConfirmationArgs_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IConfirmationArgs_Impl::Description(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn PrimaryCommand<
Identity: IConfirmationArgs_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IConfirmationArgs_Impl::PrimaryCommand(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsPrimaryCommandCritical<
Identity: IConfirmationArgs_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IConfirmationArgs_Impl::IsPrimaryCommandCritical(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IConfirmationArgs, OFFSET>(),
Title: Title::<Identity, OFFSET>,
Description: Description::<Identity, OFFSET>,
PrimaryCommand: PrimaryCommand::<Identity, OFFSET>,
IsPrimaryCommandCritical: IsPrimaryCommandCritical::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IConfirmationArgs as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IConfirmationArgs_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Title: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Description: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub PrimaryCommand: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub IsPrimaryCommandCritical:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IContent,
IContent_Vtbl,
0xb64def0f_8911_4afa_8f8f_042bd778d088
);
impl windows_core::RuntimeType for IContent {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IContent,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IContent, INotifyPropChanged);
impl IContent {
#[doc = include_str!("./bindings_docs/IContent/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IContent/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IContent {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IContent";
}
pub trait IContent_Impl: INotifyPropChanged_Impl {}
impl IContent_Vtbl {
pub const fn new<Identity: IContent_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IContent, OFFSET>(),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IContent as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IContent_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IContentPage,
IContentPage_Vtbl,
0xd010f4f9_45f4_5f33_8477_e00e56a780d6
);
impl windows_core::RuntimeType for IContentPage {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IContentPage,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(
IContentPage,
ICommand,
INotifyItemsChanged,
INotifyPropChanged,
IPage
);
impl IContentPage {
#[doc = include_str!("./bindings_docs/IContentPage/GetContent.md")]
pub fn GetContent(&self) -> windows_core::Result<windows_core::Array<IContent>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).GetContent)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IContent>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/IContentPage/Details.md")]
pub fn Details(&self) -> windows_core::Result<IDetails> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Details)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IContentPage/Commands.md")]
pub fn Commands(&self) -> windows_core::Result<windows_core::Array<IContextItem>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).Commands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IContextItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/IContentPage/Name.md")]
pub fn Name(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Name)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IContentPage/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IContentPage/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IContentPage/ItemsChanged.md")]
pub fn ItemsChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ItemsChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IContentPage/RemoveItemsChanged.md")]
pub fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveItemsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IContentPage/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IContentPage/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IContentPage/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IContentPage/IsLoading.md")]
pub fn IsLoading(&self) -> windows_core::Result<bool> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsLoading)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IContentPage/AccentColor.md")]
pub fn AccentColor(&self) -> windows_core::Result<OptionalColor> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).AccentColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeName for IContentPage {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IContentPage";
}
pub trait IContentPage_Impl:
ICommand_Impl + INotifyItemsChanged_Impl + INotifyPropChanged_Impl + IPage_Impl
{
fn GetContent(&self) -> windows_core::Result<windows_core::Array<IContent>>;
fn Details(&self) -> windows_core::Result<IDetails>;
fn Commands(&self) -> windows_core::Result<windows_core::Array<IContextItem>>;
}
impl IContentPage_Vtbl {
pub const fn new<Identity: IContentPage_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn GetContent<Identity: IContentPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IContentPage_Impl::GetContent(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Details<Identity: IContentPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IContentPage_Impl::Details(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Commands<Identity: IContentPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IContentPage_Impl::Commands(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IContentPage, OFFSET>(),
GetContent: GetContent::<Identity, OFFSET>,
Details: Details::<Identity, OFFSET>,
Commands: Commands::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IContentPage as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IContentPage_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetContent: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Details: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Commands: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IContextItem,
IContextItem_Vtbl,
0xc78b9851_e76b_43ee_8f76_da5ba14e69a4
);
impl windows_core::RuntimeType for IContextItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IContextItem,
windows_core::IUnknown,
windows_core::IInspectable
);
impl windows_core::RuntimeName for IContextItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IContextItem";
}
pub trait IContextItem_Impl: windows_core::IUnknownImpl {}
impl IContextItem_Vtbl {
pub const fn new<Identity: IContextItem_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IContextItem, OFFSET>(),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IContextItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IContextItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDetails,
IDetails_Vtbl,
0xb3cddfa4_3dce_58de_aa6b_f03f01a8702f
);
impl windows_core::RuntimeType for IDetails {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetails,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IDetails {
#[doc = include_str!("./bindings_docs/IDetails/HeroImage.md")]
pub fn HeroImage(&self) -> windows_core::Result<IIconInfo> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).HeroImage)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IDetails/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDetails/Body.md")]
pub fn Body(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Body)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDetails/Metadata.md")]
pub fn Metadata(&self) -> windows_core::Result<windows_core::Array<IDetailsElement>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).Metadata)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IDetailsElement>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
}
impl windows_core::RuntimeName for IDetails {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetails";
}
pub trait IDetails_Impl: windows_core::IUnknownImpl {
fn HeroImage(&self) -> windows_core::Result<IIconInfo>;
fn Title(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Body(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Metadata(&self) -> windows_core::Result<windows_core::Array<IDetailsElement>>;
}
impl IDetails_Vtbl {
pub const fn new<Identity: IDetails_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn HeroImage<Identity: IDetails_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetails_Impl::HeroImage(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Title<Identity: IDetails_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetails_Impl::Title(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Body<Identity: IDetails_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetails_Impl::Body(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Metadata<Identity: IDetails_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetails_Impl::Metadata(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDetails, OFFSET>(),
HeroImage: HeroImage::<Identity, OFFSET>,
Title: Title::<Identity, OFFSET>,
Body: Body::<Identity, OFFSET>,
Metadata: Metadata::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetails as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetails_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub HeroImage: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Title: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Body: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Metadata: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDetailsCommands,
IDetailsCommands_Vtbl,
0xb1f3ddcc_a47c_5480_9495_4f7ec06fc781
);
impl windows_core::RuntimeType for IDetailsCommands {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetailsCommands,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IDetailsCommands, IDetailsData);
impl IDetailsCommands {
#[doc = include_str!("./bindings_docs/IDetailsCommands/Commands.md")]
pub fn Commands(&self) -> windows_core::Result<windows_core::Array<ICommand>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).Commands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<ICommand>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
}
impl windows_core::RuntimeName for IDetailsCommands {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetailsCommands";
}
pub trait IDetailsCommands_Impl: IDetailsData_Impl {
fn Commands(&self) -> windows_core::Result<windows_core::Array<ICommand>>;
}
impl IDetailsCommands_Vtbl {
pub const fn new<Identity: IDetailsCommands_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Commands<Identity: IDetailsCommands_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetailsCommands_Impl::Commands(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDetailsCommands, OFFSET>(),
Commands: Commands::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetailsCommands as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetailsCommands_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Commands: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDetailsData,
IDetailsData_Vtbl,
0x6a6dd345_37a3_4a1e_914d_4f658a4d583d
);
impl windows_core::RuntimeType for IDetailsData {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetailsData,
windows_core::IUnknown,
windows_core::IInspectable
);
impl windows_core::RuntimeName for IDetailsData {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetailsData";
}
pub trait IDetailsData_Impl: windows_core::IUnknownImpl {}
impl IDetailsData_Vtbl {
pub const fn new<Identity: IDetailsData_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDetailsData, OFFSET>(),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetailsData as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetailsData_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDetailsElement,
IDetailsElement_Vtbl,
0x88c2560d_0986_5450_97ca_eab16bfb1da5
);
impl windows_core::RuntimeType for IDetailsElement {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetailsElement,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IDetailsElement {
#[doc = include_str!("./bindings_docs/IDetailsElement/Key.md")]
pub fn Key(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Key)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDetailsElement/Data.md")]
pub fn Data(&self) -> windows_core::Result<IDetailsData> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Data)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for IDetailsElement {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetailsElement";
}
pub trait IDetailsElement_Impl: windows_core::IUnknownImpl {
fn Key(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Data(&self) -> windows_core::Result<IDetailsData>;
}
impl IDetailsElement_Vtbl {
pub const fn new<Identity: IDetailsElement_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Key<Identity: IDetailsElement_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetailsElement_Impl::Key(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Data<Identity: IDetailsElement_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetailsElement_Impl::Data(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDetailsElement, OFFSET>(),
Key: Key::<Identity, OFFSET>,
Data: Data::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetailsElement as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetailsElement_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Key: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Data: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDetailsLink,
IDetailsLink_Vtbl,
0xc4b963e6_dbbc_5129_b9c2_b922362f86ea
);
impl windows_core::RuntimeType for IDetailsLink {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetailsLink,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IDetailsLink, IDetailsData);
impl IDetailsLink {
#[doc = include_str!("./bindings_docs/IDetailsLink/Link.md")]
pub fn Link(&self) -> windows_core::Result<windows::Foundation::Uri> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Link)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IDetailsLink/Text.md")]
pub fn Text(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Text)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
}
impl windows_core::RuntimeName for IDetailsLink {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetailsLink";
}
pub trait IDetailsLink_Impl: IDetailsData_Impl {
fn Link(&self) -> windows_core::Result<windows::Foundation::Uri>;
fn Text(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl IDetailsLink_Vtbl {
pub const fn new<Identity: IDetailsLink_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Link<Identity: IDetailsLink_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetailsLink_Impl::Link(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Text<Identity: IDetailsLink_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetailsLink_Impl::Text(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDetailsLink, OFFSET>(),
Link: Link::<Identity, OFFSET>,
Text: Text::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetailsLink as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetailsLink_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Link: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Text: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDetailsSeparator,
IDetailsSeparator_Vtbl,
0x58070392_02bb_4e89_9beb_47ceb8c3d741
);
impl windows_core::RuntimeType for IDetailsSeparator {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetailsSeparator,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IDetailsSeparator, IDetailsData);
impl windows_core::RuntimeName for IDetailsSeparator {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetailsSeparator";
}
pub trait IDetailsSeparator_Impl: IDetailsData_Impl {}
impl IDetailsSeparator_Vtbl {
pub const fn new<Identity: IDetailsSeparator_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDetailsSeparator, OFFSET>(),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetailsSeparator as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetailsSeparator_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDetailsTags,
IDetailsTags_Vtbl,
0x65e9de79_3397_5025_873e_71bbbbc2a593
);
impl windows_core::RuntimeType for IDetailsTags {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetailsTags,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IDetailsTags, IDetailsData);
impl IDetailsTags {
#[doc = include_str!("./bindings_docs/IDetailsTags/Tags.md")]
pub fn Tags(&self) -> windows_core::Result<windows_core::Array<ITag>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).Tags)(
windows_core::Interface::as_raw(this),
windows_core::Array::<ITag>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
}
impl windows_core::RuntimeName for IDetailsTags {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetailsTags";
}
pub trait IDetailsTags_Impl: IDetailsData_Impl {
fn Tags(&self) -> windows_core::Result<windows_core::Array<ITag>>;
}
impl IDetailsTags_Vtbl {
pub const fn new<Identity: IDetailsTags_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Tags<Identity: IDetailsTags_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IDetailsTags_Impl::Tags(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDetailsTags, OFFSET>(),
Tags: Tags::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetailsTags as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetailsTags_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Tags: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IDynamicListPage,
IDynamicListPage_Vtbl,
0x147bbfd4_6b4c_51db_af17_88b585a0e6e2
);
impl windows_core::RuntimeType for IDynamicListPage {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDynamicListPage,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(
IDynamicListPage,
ICommand,
IListPage,
INotifyItemsChanged,
INotifyPropChanged,
IPage
);
impl IDynamicListPage {
#[doc = include_str!("./bindings_docs/IDynamicListPage/SetSearchText.md")]
pub fn SetSearchText(&self, value: &windows_core::HSTRING) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetSearchText)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(value),
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/Name.md")]
pub fn Name(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Name)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/SearchText.md")]
pub fn SearchText(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).SearchText)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/PlaceholderText.md")]
pub fn PlaceholderText(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PlaceholderText)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/ShowDetails.md")]
pub fn ShowDetails(&self) -> windows_core::Result<bool> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ShowDetails)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/Filters.md")]
pub fn Filters(&self) -> windows_core::Result<IFilters> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Filters)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/GridProperties.md")]
pub fn GridProperties(&self) -> windows_core::Result<IGridProperties> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GridProperties)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/HasMoreItems.md")]
pub fn HasMoreItems(&self) -> windows_core::Result<bool> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).HasMoreItems)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/EmptyContent.md")]
pub fn EmptyContent(&self) -> windows_core::Result<ICommandItem> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).EmptyContent)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/GetItems.md")]
pub fn GetItems(&self) -> windows_core::Result<windows_core::Array<IListItem>> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).GetItems)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IListItem>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/LoadMore.md")]
pub fn LoadMore(&self) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<IListPage>(self)?;
unsafe {
(windows_core::Interface::vtable(this).LoadMore)(windows_core::Interface::as_raw(this))
.ok()
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/ItemsChanged.md")]
pub fn ItemsChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ItemsChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/RemoveItemsChanged.md")]
pub fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveItemsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/IsLoading.md")]
pub fn IsLoading(&self) -> windows_core::Result<bool> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsLoading)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IDynamicListPage/AccentColor.md")]
pub fn AccentColor(&self) -> windows_core::Result<OptionalColor> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).AccentColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeName for IDynamicListPage {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDynamicListPage";
}
pub trait IDynamicListPage_Impl:
ICommand_Impl + IListPage_Impl + INotifyItemsChanged_Impl + INotifyPropChanged_Impl + IPage_Impl
{
fn SetSearchText(&self, value: &windows_core::HSTRING) -> windows_core::Result<()>;
}
impl IDynamicListPage_Vtbl {
pub const fn new<Identity: IDynamicListPage_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn SetSearchText<
Identity: IDynamicListPage_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
value: *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IDynamicListPage_Impl::SetSearchText(this, core::mem::transmute(&value)).into()
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IDynamicListPage, OFFSET>(),
SetSearchText: SetSearchText::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDynamicListPage as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDynamicListPage_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub SetSearchText: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IExtendedAttributesProvider,
IExtendedAttributesProvider_Vtbl,
0xf9677ab1_9cc8_5a19_9c49_5ddea4bfd04f
);
impl windows_core::RuntimeType for IExtendedAttributesProvider {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IExtendedAttributesProvider,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IExtendedAttributesProvider {
#[doc = include_str!("./bindings_docs/IExtendedAttributesProvider/GetProperties.md")]
pub fn GetProperties(
&self,
) -> windows_core::Result<
windows_collections::IMap<windows_core::HSTRING, windows_core::IInspectable>,
> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetProperties)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for IExtendedAttributesProvider {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IExtendedAttributesProvider";
}
pub trait IExtendedAttributesProvider_Impl: windows_core::IUnknownImpl {
fn GetProperties(
&self,
) -> windows_core::Result<
windows_collections::IMap<windows_core::HSTRING, windows_core::IInspectable>,
>;
}
impl IExtendedAttributesProvider_Vtbl {
pub const fn new<Identity: IExtendedAttributesProvider_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn GetProperties<
Identity: IExtendedAttributesProvider_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IExtendedAttributesProvider_Impl::GetProperties(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<
Identity,
IExtendedAttributesProvider,
OFFSET,
>(),
GetProperties: GetProperties::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IExtendedAttributesProvider as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IExtendedAttributesProvider_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetProperties: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IExtension,
IExtension_Vtbl,
0xd5f951d9_661b_51e0_9cb8_d83bef0098e4
);
impl windows_core::RuntimeType for IExtension {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IExtension,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IExtension {
#[doc = include_str!("./bindings_docs/IExtension/GetProvider.md")]
pub fn GetProvider(
&self,
providertype: ProviderType,
) -> windows_core::Result<windows_core::IInspectable> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GetProvider)(
windows_core::Interface::as_raw(this),
providertype,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IExtension/Dispose.md")]
pub fn Dispose(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).Dispose)(windows_core::Interface::as_raw(this))
.ok()
}
}
}
impl windows_core::RuntimeName for IExtension {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IExtension";
}
pub trait IExtension_Impl: windows_core::IUnknownImpl {
fn GetProvider(
&self,
providerType: ProviderType,
) -> windows_core::Result<windows_core::IInspectable>;
fn Dispose(&self) -> windows_core::Result<()>;
}
impl IExtension_Vtbl {
pub const fn new<Identity: IExtension_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn GetProvider<Identity: IExtension_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
providertype: ProviderType,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IExtension_Impl::GetProvider(this, providertype) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Dispose<Identity: IExtension_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IExtension_Impl::Dispose(this).into()
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IExtension, OFFSET>(),
GetProvider: GetProvider::<Identity, OFFSET>,
Dispose: Dispose::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IExtension as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IExtension_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub GetProvider: unsafe extern "system" fn(
*mut core::ffi::c_void,
ProviderType,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Dispose: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IExtensionHost,
IExtensionHost_Vtbl,
0xf5c20246_317f_55f7_b3e2_d06815d752d7
);
impl windows_core::RuntimeType for IExtensionHost {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IExtensionHost,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IExtensionHost {
#[doc = include_str!("./bindings_docs/IExtensionHost/ShowStatus.md")]
pub fn ShowStatus<P0>(
&self,
message: P0,
context: StatusContext,
) -> windows_core::Result<windows_future::IAsyncAction>
where
P0: windows_core::Param<IStatusMessage>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ShowStatus)(
windows_core::Interface::as_raw(this),
message.param().abi(),
context,
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IExtensionHost/HideStatus.md")]
pub fn HideStatus<P0>(&self, message: P0) -> windows_core::Result<windows_future::IAsyncAction>
where
P0: windows_core::Param<IStatusMessage>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).HideStatus)(
windows_core::Interface::as_raw(this),
message.param().abi(),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IExtensionHost/LogMessage.md")]
pub fn LogMessage<P0>(&self, message: P0) -> windows_core::Result<windows_future::IAsyncAction>
where
P0: windows_core::Param<ILogMessage>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).LogMessage)(
windows_core::Interface::as_raw(this),
message.param().abi(),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for IExtensionHost {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IExtensionHost";
}
pub trait IExtensionHost_Impl: windows_core::IUnknownImpl {
fn ShowStatus(
&self,
message: windows_core::Ref<'_, IStatusMessage>,
context: StatusContext,
) -> windows_core::Result<windows_future::IAsyncAction>;
fn HideStatus(
&self,
message: windows_core::Ref<'_, IStatusMessage>,
) -> windows_core::Result<windows_future::IAsyncAction>;
fn LogMessage(
&self,
message: windows_core::Ref<'_, ILogMessage>,
) -> windows_core::Result<windows_future::IAsyncAction>;
}
impl IExtensionHost_Vtbl {
pub const fn new<Identity: IExtensionHost_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn ShowStatus<Identity: IExtensionHost_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
message: *mut core::ffi::c_void,
context: StatusContext,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IExtensionHost_Impl::ShowStatus(
this,
core::mem::transmute_copy(&message),
context,
) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn HideStatus<Identity: IExtensionHost_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
message: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IExtensionHost_Impl::HideStatus(this, core::mem::transmute_copy(&message)) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn LogMessage<Identity: IExtensionHost_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
message: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IExtensionHost_Impl::LogMessage(this, core::mem::transmute_copy(&message)) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IExtensionHost, OFFSET>(),
ShowStatus: ShowStatus::<Identity, OFFSET>,
HideStatus: HideStatus::<Identity, OFFSET>,
LogMessage: LogMessage::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IExtensionHost as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IExtensionHost_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub ShowStatus: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
StatusContext,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub HideStatus: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub LogMessage: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IFallbackCommandItem,
IFallbackCommandItem_Vtbl,
0xd86771e2_c6ee_59ec_8fdc_9abe5dce2d1e
);
impl windows_core::RuntimeType for IFallbackCommandItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IFallbackCommandItem,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IFallbackCommandItem, ICommandItem, INotifyPropChanged);
impl IFallbackCommandItem {
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/FallbackHandler.md")]
pub fn FallbackHandler(&self) -> windows_core::Result<IFallbackHandler> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).FallbackHandler)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/DisplayTitle.md")]
pub fn DisplayTitle(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DisplayTitle)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/Command.md")]
pub fn Command(&self) -> windows_core::Result<ICommand> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Command)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/MoreCommands.md")]
pub fn MoreCommands(&self) -> windows_core::Result<windows_core::Array<IContextItem>> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).MoreCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IContextItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/Subtitle.md")]
pub fn Subtitle(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Subtitle)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IFallbackCommandItem/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IFallbackCommandItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IFallbackCommandItem";
}
pub trait IFallbackCommandItem_Impl: ICommandItem_Impl + INotifyPropChanged_Impl {
fn FallbackHandler(&self) -> windows_core::Result<IFallbackHandler>;
fn DisplayTitle(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl IFallbackCommandItem_Vtbl {
pub const fn new<Identity: IFallbackCommandItem_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn FallbackHandler<
Identity: IFallbackCommandItem_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFallbackCommandItem_Impl::FallbackHandler(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn DisplayTitle<
Identity: IFallbackCommandItem_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFallbackCommandItem_Impl::DisplayTitle(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IFallbackCommandItem, OFFSET>(
),
FallbackHandler: FallbackHandler::<Identity, OFFSET>,
DisplayTitle: DisplayTitle::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IFallbackCommandItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IFallbackCommandItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub FallbackHandler: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub DisplayTitle: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IFallbackHandler,
IFallbackHandler_Vtbl,
0xa8b5a17b_0590_57a8_ae81_05df2224139a
);
impl windows_core::RuntimeType for IFallbackHandler {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IFallbackHandler,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IFallbackHandler {
#[doc = include_str!("./bindings_docs/IFallbackHandler/UpdateQuery.md")]
pub fn UpdateQuery(&self, query: &windows_core::HSTRING) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).UpdateQuery)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(query),
)
.ok()
}
}
}
impl windows_core::RuntimeName for IFallbackHandler {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IFallbackHandler";
}
pub trait IFallbackHandler_Impl: windows_core::IUnknownImpl {
fn UpdateQuery(&self, query: &windows_core::HSTRING) -> windows_core::Result<()>;
}
impl IFallbackHandler_Vtbl {
pub const fn new<Identity: IFallbackHandler_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn UpdateQuery<
Identity: IFallbackHandler_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
query: *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IFallbackHandler_Impl::UpdateQuery(this, core::mem::transmute(&query)).into()
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IFallbackHandler, OFFSET>(),
UpdateQuery: UpdateQuery::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IFallbackHandler as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IFallbackHandler_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub UpdateQuery: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IFilter,
IFilter_Vtbl,
0x5c61322c_0344_53f5_a178_7701be429195
);
impl windows_core::RuntimeType for IFilter {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IFilter,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IFilter, IFilterItem, INotifyPropChanged);
impl IFilter {
#[doc = include_str!("./bindings_docs/IFilter/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFilter/Name.md")]
pub fn Name(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Name)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFilter/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IFilter/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IFilter/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IFilter {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IFilter";
}
pub trait IFilter_Impl: IFilterItem_Impl + INotifyPropChanged_Impl {
fn Id(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Name(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Icon(&self) -> windows_core::Result<IIconInfo>;
}
impl IFilter_Vtbl {
pub const fn new<Identity: IFilter_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Id<Identity: IFilter_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFilter_Impl::Id(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Name<Identity: IFilter_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFilter_Impl::Name(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Icon<Identity: IFilter_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFilter_Impl::Icon(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IFilter, OFFSET>(),
Id: Id::<Identity, OFFSET>,
Name: Name::<Identity, OFFSET>,
Icon: Icon::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IFilter as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IFilter_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Id: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Name: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Icon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IFilterItem,
IFilterItem_Vtbl,
0xef5db50c_d26b_4aee_9343_9f98739ab411
);
impl windows_core::RuntimeType for IFilterItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IFilterItem,
windows_core::IUnknown,
windows_core::IInspectable
);
impl windows_core::RuntimeName for IFilterItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IFilterItem";
}
pub trait IFilterItem_Impl: windows_core::IUnknownImpl {}
impl IFilterItem_Vtbl {
pub const fn new<Identity: IFilterItem_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IFilterItem, OFFSET>(),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IFilterItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IFilterItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IFilters,
IFilters_Vtbl,
0x3fd88fb7_9930_570f_bb43_6216bd571166
);
impl windows_core::RuntimeType for IFilters {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IFilters,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IFilters {
#[doc = include_str!("./bindings_docs/IFilters/CurrentFilterId.md")]
pub fn CurrentFilterId(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).CurrentFilterId)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFilters/SetCurrentFilterId.md")]
pub fn SetCurrentFilterId(&self, value: &windows_core::HSTRING) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).SetCurrentFilterId)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(value),
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IFilters/GetFilters.md")]
pub fn GetFilters(&self) -> windows_core::Result<windows_core::Array<IFilterItem>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).GetFilters)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IFilterItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
}
impl windows_core::RuntimeName for IFilters {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IFilters";
}
pub trait IFilters_Impl: windows_core::IUnknownImpl {
fn CurrentFilterId(&self) -> windows_core::Result<windows_core::HSTRING>;
fn SetCurrentFilterId(&self, value: &windows_core::HSTRING) -> windows_core::Result<()>;
fn GetFilters(&self) -> windows_core::Result<windows_core::Array<IFilterItem>>;
}
impl IFilters_Vtbl {
pub const fn new<Identity: IFilters_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn CurrentFilterId<Identity: IFilters_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFilters_Impl::CurrentFilterId(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn SetCurrentFilterId<
Identity: IFilters_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
value: *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IFilters_Impl::SetCurrentFilterId(this, core::mem::transmute(&value)).into()
}
}
unsafe extern "system" fn GetFilters<Identity: IFilters_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFilters_Impl::GetFilters(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IFilters, OFFSET>(),
CurrentFilterId: CurrentFilterId::<Identity, OFFSET>,
SetCurrentFilterId: SetCurrentFilterId::<Identity, OFFSET>,
GetFilters: GetFilters::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IFilters as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IFilters_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub CurrentFilterId: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub SetCurrentFilterId: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub GetFilters: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IFormContent,
IFormContent_Vtbl,
0x8303ba47_2fdf_50ab_b8b5_5bbf75a7b32d
);
impl windows_core::RuntimeType for IFormContent {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IFormContent,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IFormContent, IContent, INotifyPropChanged);
impl IFormContent {
#[doc = include_str!("./bindings_docs/IFormContent/TemplateJson.md")]
pub fn TemplateJson(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TemplateJson)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFormContent/DataJson.md")]
pub fn DataJson(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).DataJson)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFormContent/StateJson.md")]
pub fn StateJson(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).StateJson)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IFormContent/SubmitForm.md")]
pub fn SubmitForm(
&self,
inputs: &windows_core::HSTRING,
data: &windows_core::HSTRING,
) -> windows_core::Result<ICommandResult> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).SubmitForm)(
windows_core::Interface::as_raw(this),
core::mem::transmute_copy(inputs),
core::mem::transmute_copy(data),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IFormContent/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IFormContent/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IFormContent {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IFormContent";
}
pub trait IFormContent_Impl: IContent_Impl + INotifyPropChanged_Impl {
fn TemplateJson(&self) -> windows_core::Result<windows_core::HSTRING>;
fn DataJson(&self) -> windows_core::Result<windows_core::HSTRING>;
fn StateJson(&self) -> windows_core::Result<windows_core::HSTRING>;
fn SubmitForm(
&self,
inputs: &windows_core::HSTRING,
data: &windows_core::HSTRING,
) -> windows_core::Result<ICommandResult>;
}
impl IFormContent_Vtbl {
pub const fn new<Identity: IFormContent_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn TemplateJson<Identity: IFormContent_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFormContent_Impl::TemplateJson(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn DataJson<Identity: IFormContent_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFormContent_Impl::DataJson(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn StateJson<Identity: IFormContent_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFormContent_Impl::StateJson(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn SubmitForm<Identity: IFormContent_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
inputs: *mut core::ffi::c_void,
data: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IFormContent_Impl::SubmitForm(
this,
core::mem::transmute(&inputs),
core::mem::transmute(&data),
) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IFormContent, OFFSET>(),
TemplateJson: TemplateJson::<Identity, OFFSET>,
DataJson: DataJson::<Identity, OFFSET>,
StateJson: StateJson::<Identity, OFFSET>,
SubmitForm: SubmitForm::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IFormContent as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IFormContent_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub TemplateJson: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub DataJson: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub StateJson: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub SubmitForm: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IGoToPageArgs,
IGoToPageArgs_Vtbl,
0xabddda87_5db9_5aff_82a7_ac8bb0ae00d5
);
impl windows_core::RuntimeType for IGoToPageArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IGoToPageArgs,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IGoToPageArgs, ICommandResultArgs);
impl IGoToPageArgs {
#[doc = include_str!("./bindings_docs/IGoToPageArgs/PageId.md")]
pub fn PageId(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PageId)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IGoToPageArgs/NavigationMode.md")]
pub fn NavigationMode(&self) -> windows_core::Result<NavigationMode> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).NavigationMode)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeName for IGoToPageArgs {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IGoToPageArgs";
}
pub trait IGoToPageArgs_Impl: ICommandResultArgs_Impl {
fn PageId(&self) -> windows_core::Result<windows_core::HSTRING>;
fn NavigationMode(&self) -> windows_core::Result<NavigationMode>;
}
impl IGoToPageArgs_Vtbl {
pub const fn new<Identity: IGoToPageArgs_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn PageId<Identity: IGoToPageArgs_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IGoToPageArgs_Impl::PageId(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn NavigationMode<
Identity: IGoToPageArgs_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut NavigationMode,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IGoToPageArgs_Impl::NavigationMode(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IGoToPageArgs, OFFSET>(),
PageId: PageId::<Identity, OFFSET>,
NavigationMode: NavigationMode::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IGoToPageArgs as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IGoToPageArgs_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub PageId: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub NavigationMode: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut NavigationMode,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IGridProperties,
IGridProperties_Vtbl,
0xbca5dfac_69a1_56bd_984b_1fe2aebc9945
);
impl windows_core::RuntimeType for IGridProperties {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IGridProperties,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IGridProperties {
#[doc = include_str!("./bindings_docs/IGridProperties/TileSize.md")]
pub fn TileSize(&self) -> windows_core::Result<windows::Foundation::Size> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TileSize)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeName for IGridProperties {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IGridProperties";
}
pub trait IGridProperties_Impl: windows_core::IUnknownImpl {
fn TileSize(&self) -> windows_core::Result<windows::Foundation::Size>;
}
impl IGridProperties_Vtbl {
pub const fn new<Identity: IGridProperties_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn TileSize<Identity: IGridProperties_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut windows::Foundation::Size,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IGridProperties_Impl::TileSize(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IGridProperties, OFFSET>(),
TileSize: TileSize::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IGridProperties as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IGridProperties_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub TileSize: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut windows::Foundation::Size,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IIconData,
IIconData_Vtbl,
0xc1471dd4_de50_5aca_bca0_d295afd1e0f4
);
impl windows_core::RuntimeType for IIconData {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IIconData,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IIconData {
#[doc = include_str!("./bindings_docs/IIconData/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IIconData/Data.md")]
pub fn Data(
&self,
) -> windows_core::Result<windows::Storage::Streams::IRandomAccessStreamReference> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Data)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for IIconData {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IIconData";
}
pub trait IIconData_Impl: windows_core::IUnknownImpl {
fn Icon(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Data(&self)
-> windows_core::Result<windows::Storage::Streams::IRandomAccessStreamReference>;
}
impl IIconData_Vtbl {
pub const fn new<Identity: IIconData_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Icon<Identity: IIconData_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IIconData_Impl::Icon(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Data<Identity: IIconData_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IIconData_Impl::Data(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IIconData, OFFSET>(),
Icon: Icon::<Identity, OFFSET>,
Data: Data::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IIconData as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IIconData_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Icon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Data: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IIconInfo,
IIconInfo_Vtbl,
0xcc825dbb_c9b0_551d_9506_ba67bf4f96f0
);
impl windows_core::RuntimeType for IIconInfo {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IIconInfo,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IIconInfo {
#[doc = include_str!("./bindings_docs/IIconInfo/Light.md")]
pub fn Light(&self) -> windows_core::Result<IIconData> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Light)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IIconInfo/Dark.md")]
pub fn Dark(&self) -> windows_core::Result<IIconData> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Dark)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for IIconInfo {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IIconInfo";
}
pub trait IIconInfo_Impl: windows_core::IUnknownImpl {
fn Light(&self) -> windows_core::Result<IIconData>;
fn Dark(&self) -> windows_core::Result<IIconData>;
}
impl IIconInfo_Vtbl {
pub const fn new<Identity: IIconInfo_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Light<Identity: IIconInfo_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IIconInfo_Impl::Light(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Dark<Identity: IIconInfo_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IIconInfo_Impl::Dark(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IIconInfo, OFFSET>(),
Light: Light::<Identity, OFFSET>,
Dark: Dark::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IIconInfo as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IIconInfo_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Light: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Dark: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IInvokableCommand,
IInvokableCommand_Vtbl,
0xead3d30b_3ec3_50ab_b1ec_b026cc7fd240
);
impl windows_core::RuntimeType for IInvokableCommand {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IInvokableCommand,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IInvokableCommand, ICommand, INotifyPropChanged);
impl IInvokableCommand {
#[doc = include_str!("./bindings_docs/IInvokableCommand/Invoke.md")]
pub fn Invoke<P0>(&self, sender: P0) -> windows_core::Result<ICommandResult>
where
P0: windows_core::Param<windows_core::IInspectable>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Invoke)(
windows_core::Interface::as_raw(this),
sender.param().abi(),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IInvokableCommand/Name.md")]
pub fn Name(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Name)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IInvokableCommand/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IInvokableCommand/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IInvokableCommand/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IInvokableCommand/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IInvokableCommand {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IInvokableCommand";
}
pub trait IInvokableCommand_Impl: ICommand_Impl + INotifyPropChanged_Impl {
fn Invoke(
&self,
sender: windows_core::Ref<'_, windows_core::IInspectable>,
) -> windows_core::Result<ICommandResult>;
}
impl IInvokableCommand_Vtbl {
pub const fn new<Identity: IInvokableCommand_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Invoke<Identity: IInvokableCommand_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
sender: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IInvokableCommand_Impl::Invoke(this, core::mem::transmute_copy(&sender)) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IInvokableCommand, OFFSET>(),
Invoke: Invoke::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IInvokableCommand as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IInvokableCommand_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Invoke: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IItemsChangedEventArgs,
IItemsChangedEventArgs_Vtbl,
0x423141b0_0987_5f7e_be8a_3d75c4c8db3c
);
impl windows_core::RuntimeType for IItemsChangedEventArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IItemsChangedEventArgs,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IItemsChangedEventArgs {
#[doc = include_str!("./bindings_docs/IItemsChangedEventArgs/TotalItems.md")]
pub fn TotalItems(&self) -> windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TotalItems)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeName for IItemsChangedEventArgs {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IItemsChangedEventArgs";
}
pub trait IItemsChangedEventArgs_Impl: windows_core::IUnknownImpl {
fn TotalItems(&self) -> windows_core::Result<i32>;
}
impl IItemsChangedEventArgs_Vtbl {
pub const fn new<Identity: IItemsChangedEventArgs_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn TotalItems<
Identity: IItemsChangedEventArgs_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut i32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IItemsChangedEventArgs_Impl::TotalItems(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IItemsChangedEventArgs, OFFSET>(
),
TotalItems: TotalItems::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IItemsChangedEventArgs as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IItemsChangedEventArgs_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub TotalItems:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut i32) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IListItem,
IListItem_Vtbl,
0xf285c8e4_011f_506d_ac39_0e831d06787d
);
impl windows_core::RuntimeType for IListItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IListItem,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IListItem, ICommandItem, INotifyPropChanged);
impl IListItem {
#[doc = include_str!("./bindings_docs/IListItem/Tags.md")]
pub fn Tags(&self) -> windows_core::Result<windows_core::Array<ITag>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).Tags)(
windows_core::Interface::as_raw(this),
windows_core::Array::<ITag>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/IListItem/Details.md")]
pub fn Details(&self) -> windows_core::Result<IDetails> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Details)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IListItem/Section.md")]
pub fn Section(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Section)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListItem/TextToSuggest.md")]
pub fn TextToSuggest(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).TextToSuggest)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListItem/Command.md")]
pub fn Command(&self) -> windows_core::Result<ICommand> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Command)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IListItem/MoreCommands.md")]
pub fn MoreCommands(&self) -> windows_core::Result<windows_core::Array<IContextItem>> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).MoreCommands)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IContextItem>::set_abi_len(core::mem::transmute(
&mut result__,
)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/IListItem/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IListItem/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListItem/Subtitle.md")]
pub fn Subtitle(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommandItem>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Subtitle)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListItem/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IListItem/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IListItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IListItem";
}
pub trait IListItem_Impl: ICommandItem_Impl + INotifyPropChanged_Impl {
fn Tags(&self) -> windows_core::Result<windows_core::Array<ITag>>;
fn Details(&self) -> windows_core::Result<IDetails>;
fn Section(&self) -> windows_core::Result<windows_core::HSTRING>;
fn TextToSuggest(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl IListItem_Vtbl {
pub const fn new<Identity: IListItem_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Tags<Identity: IListItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListItem_Impl::Tags(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Details<Identity: IListItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListItem_Impl::Details(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Section<Identity: IListItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListItem_Impl::Section(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn TextToSuggest<Identity: IListItem_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListItem_Impl::TextToSuggest(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IListItem, OFFSET>(),
Tags: Tags::<Identity, OFFSET>,
Details: Details::<Identity, OFFSET>,
Section: Section::<Identity, OFFSET>,
TextToSuggest: TextToSuggest::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IListItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IListItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Tags: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Details: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Section: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub TextToSuggest: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IListPage,
IListPage_Vtbl,
0xf5245402_f543_5753_bbc5_fe1fbac8e55a
);
impl windows_core::RuntimeType for IListPage {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IListPage,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(
IListPage,
ICommand,
INotifyItemsChanged,
INotifyPropChanged,
IPage
);
impl IListPage {
#[doc = include_str!("./bindings_docs/IListPage/SearchText.md")]
pub fn SearchText(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).SearchText)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/PlaceholderText.md")]
pub fn PlaceholderText(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PlaceholderText)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/ShowDetails.md")]
pub fn ShowDetails(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ShowDetails)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IListPage/Filters.md")]
pub fn Filters(&self) -> windows_core::Result<IFilters> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Filters)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/GridProperties.md")]
pub fn GridProperties(&self) -> windows_core::Result<IGridProperties> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).GridProperties)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/HasMoreItems.md")]
pub fn HasMoreItems(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).HasMoreItems)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IListPage/EmptyContent.md")]
pub fn EmptyContent(&self) -> windows_core::Result<ICommandItem> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).EmptyContent)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/GetItems.md")]
pub fn GetItems(&self) -> windows_core::Result<windows_core::Array<IListItem>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).GetItems)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IListItem>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/IListPage/LoadMore.md")]
pub fn LoadMore(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).LoadMore)(windows_core::Interface::as_raw(this))
.ok()
}
}
#[doc = include_str!("./bindings_docs/IListPage/Name.md")]
pub fn Name(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Name)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/ItemsChanged.md")]
pub fn ItemsChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ItemsChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IListPage/RemoveItemsChanged.md")]
pub fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveItemsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IListPage/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IListPage/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/IListPage/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IListPage/IsLoading.md")]
pub fn IsLoading(&self) -> windows_core::Result<bool> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsLoading)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IListPage/AccentColor.md")]
pub fn AccentColor(&self) -> windows_core::Result<OptionalColor> {
let this = &windows_core::Interface::cast::<IPage>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).AccentColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
}
impl windows_core::RuntimeName for IListPage {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IListPage";
}
pub trait IListPage_Impl:
ICommand_Impl + INotifyItemsChanged_Impl + INotifyPropChanged_Impl + IPage_Impl
{
fn SearchText(&self) -> windows_core::Result<windows_core::HSTRING>;
fn PlaceholderText(&self) -> windows_core::Result<windows_core::HSTRING>;
fn ShowDetails(&self) -> windows_core::Result<bool>;
fn Filters(&self) -> windows_core::Result<IFilters>;
fn GridProperties(&self) -> windows_core::Result<IGridProperties>;
fn HasMoreItems(&self) -> windows_core::Result<bool>;
fn EmptyContent(&self) -> windows_core::Result<ICommandItem>;
fn GetItems(&self) -> windows_core::Result<windows_core::Array<IListItem>>;
fn LoadMore(&self) -> windows_core::Result<()>;
}
impl IListPage_Vtbl {
pub const fn new<Identity: IListPage_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn SearchText<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::SearchText(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn PlaceholderText<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::PlaceholderText(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn ShowDetails<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::ShowDetails(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Filters<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::Filters(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn GridProperties<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::GridProperties(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn HasMoreItems<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::HasMoreItems(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn EmptyContent<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::EmptyContent(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn GetItems<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IListPage_Impl::GetItems(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn LoadMore<Identity: IListPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
IListPage_Impl::LoadMore(this).into()
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IListPage, OFFSET>(),
SearchText: SearchText::<Identity, OFFSET>,
PlaceholderText: PlaceholderText::<Identity, OFFSET>,
ShowDetails: ShowDetails::<Identity, OFFSET>,
Filters: Filters::<Identity, OFFSET>,
GridProperties: GridProperties::<Identity, OFFSET>,
HasMoreItems: HasMoreItems::<Identity, OFFSET>,
EmptyContent: EmptyContent::<Identity, OFFSET>,
GetItems: GetItems::<Identity, OFFSET>,
LoadMore: LoadMore::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IListPage as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IListPage_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub SearchText: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub PlaceholderText: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub ShowDetails:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub Filters: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub GridProperties: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub HasMoreItems:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub EmptyContent: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub GetItems: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub LoadMore: unsafe extern "system" fn(*mut core::ffi::c_void) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ILogMessage,
ILogMessage_Vtbl,
0xb42639d0_3aed_5e2a_a06a_ccfec292e28d
);
impl windows_core::RuntimeType for ILogMessage {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ILogMessage,
windows_core::IUnknown,
windows_core::IInspectable
);
impl ILogMessage {
#[doc = include_str!("./bindings_docs/ILogMessage/State.md")]
pub fn State(&self) -> windows_core::Result<MessageState> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).State)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ILogMessage/Message.md")]
pub fn Message(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Message)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
}
impl windows_core::RuntimeName for ILogMessage {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ILogMessage";
}
pub trait ILogMessage_Impl: windows_core::IUnknownImpl {
fn State(&self) -> windows_core::Result<MessageState>;
fn Message(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl ILogMessage_Vtbl {
pub const fn new<Identity: ILogMessage_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn State<Identity: ILogMessage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut MessageState,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ILogMessage_Impl::State(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Message<Identity: ILogMessage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ILogMessage_Impl::Message(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ILogMessage, OFFSET>(),
State: State::<Identity, OFFSET>,
Message: Message::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ILogMessage as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ILogMessage_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub State: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut MessageState,
) -> windows_core::HRESULT,
pub Message: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IMarkdownContent,
IMarkdownContent_Vtbl,
0x39523366_2952_56f7_801d_968783ba01a8
);
impl windows_core::RuntimeType for IMarkdownContent {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IMarkdownContent,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IMarkdownContent, IContent, INotifyPropChanged);
impl IMarkdownContent {
#[doc = include_str!("./bindings_docs/IMarkdownContent/Body.md")]
pub fn Body(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Body)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IMarkdownContent/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IMarkdownContent/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IMarkdownContent {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IMarkdownContent";
}
pub trait IMarkdownContent_Impl: IContent_Impl + INotifyPropChanged_Impl {
fn Body(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl IMarkdownContent_Vtbl {
pub const fn new<Identity: IMarkdownContent_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Body<Identity: IMarkdownContent_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IMarkdownContent_Impl::Body(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IMarkdownContent, OFFSET>(),
Body: Body::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IMarkdownContent as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IMarkdownContent_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Body: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
INotifyItemsChanged,
INotifyItemsChanged_Vtbl,
0x8957a585_f74f_5f15_a812_d4453d13e78d
);
impl windows_core::RuntimeType for INotifyItemsChanged {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
INotifyItemsChanged,
windows_core::IUnknown,
windows_core::IInspectable
);
impl INotifyItemsChanged {
#[doc = include_str!("./bindings_docs/INotifyItemsChanged/ItemsChanged.md")]
pub fn ItemsChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ItemsChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/INotifyItemsChanged/RemoveItemsChanged.md")]
pub fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemoveItemsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for INotifyItemsChanged {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.INotifyItemsChanged";
}
pub trait INotifyItemsChanged_Impl: windows_core::IUnknownImpl {
fn ItemsChanged(
&self,
handler: windows_core::Ref<
'_,
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
) -> windows_core::Result<i64>;
fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()>;
}
impl INotifyItemsChanged_Vtbl {
pub const fn new<Identity: INotifyItemsChanged_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn ItemsChanged<
Identity: INotifyItemsChanged_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
handler: *mut core::ffi::c_void,
result__: *mut i64,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match INotifyItemsChanged_Impl::ItemsChanged(
this,
core::mem::transmute_copy(&handler),
) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn RemoveItemsChanged<
Identity: INotifyItemsChanged_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
token: i64,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
INotifyItemsChanged_Impl::RemoveItemsChanged(this, token).into()
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, INotifyItemsChanged, OFFSET>(),
ItemsChanged: ItemsChanged::<Identity, OFFSET>,
RemoveItemsChanged: RemoveItemsChanged::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<INotifyItemsChanged as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct INotifyItemsChanged_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub ItemsChanged: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
) -> windows_core::HRESULT,
pub RemoveItemsChanged:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
INotifyPropChanged,
INotifyPropChanged_Vtbl,
0x4cd51ea8_4ff2_5de9_aa19_3293997c9131
);
impl windows_core::RuntimeType for INotifyPropChanged {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
INotifyPropChanged,
windows_core::IUnknown,
windows_core::IInspectable
);
impl INotifyPropChanged {
#[doc = include_str!("./bindings_docs/INotifyPropChanged/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/INotifyPropChanged/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for INotifyPropChanged {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.INotifyPropChanged";
}
pub trait INotifyPropChanged_Impl: windows_core::IUnknownImpl {
fn PropChanged(
&self,
handler: windows_core::Ref<
'_,
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
) -> windows_core::Result<i64>;
fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()>;
}
impl INotifyPropChanged_Vtbl {
pub const fn new<Identity: INotifyPropChanged_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn PropChanged<
Identity: INotifyPropChanged_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
handler: *mut core::ffi::c_void,
result__: *mut i64,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match INotifyPropChanged_Impl::PropChanged(
this,
core::mem::transmute_copy(&handler),
) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn RemovePropChanged<
Identity: INotifyPropChanged_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
token: i64,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
INotifyPropChanged_Impl::RemovePropChanged(this, token).into()
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, INotifyPropChanged, OFFSET>(),
PropChanged: PropChanged::<Identity, OFFSET>,
RemovePropChanged: RemovePropChanged::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<INotifyPropChanged as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct INotifyPropChanged_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub PropChanged: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut core::ffi::c_void,
*mut i64,
) -> windows_core::HRESULT,
pub RemovePropChanged:
unsafe extern "system" fn(*mut core::ffi::c_void, i64) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IPage,
IPage_Vtbl,
0x6ce8b297_a600_57da_8656_32e950813546
);
impl windows_core::RuntimeType for IPage {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(IPage, windows_core::IUnknown, windows_core::IInspectable);
windows_core::imp::required_hierarchy!(IPage, ICommand, INotifyPropChanged);
impl IPage {
#[doc = include_str!("./bindings_docs/IPage/Title.md")]
pub fn Title(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Title)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IPage/IsLoading.md")]
pub fn IsLoading(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsLoading)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IPage/AccentColor.md")]
pub fn AccentColor(&self) -> windows_core::Result<OptionalColor> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).AccentColor)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IPage/Name.md")]
pub fn Name(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Name)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IPage/Id.md")]
pub fn Id(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Id)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IPage/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = &windows_core::Interface::cast::<ICommand>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IPage/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IPage/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IPage {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IPage";
}
pub trait IPage_Impl: ICommand_Impl + INotifyPropChanged_Impl {
fn Title(&self) -> windows_core::Result<windows_core::HSTRING>;
fn IsLoading(&self) -> windows_core::Result<bool>;
fn AccentColor(&self) -> windows_core::Result<OptionalColor>;
}
impl IPage_Vtbl {
pub const fn new<Identity: IPage_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Title<Identity: IPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPage_Impl::Title(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn IsLoading<Identity: IPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPage_Impl::IsLoading(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn AccentColor<Identity: IPage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut OptionalColor,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPage_Impl::AccentColor(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IPage, OFFSET>(),
Title: Title::<Identity, OFFSET>,
IsLoading: IsLoading::<Identity, OFFSET>,
AccentColor: AccentColor::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IPage as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IPage_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Title: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub IsLoading:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub AccentColor: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut OptionalColor,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IProgressState,
IProgressState_Vtbl,
0xb2460bc0_f693_50dd_8716_0a3455f9274d
);
impl windows_core::RuntimeType for IProgressState {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IProgressState,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IProgressState, INotifyPropChanged);
impl IProgressState {
#[doc = include_str!("./bindings_docs/IProgressState/IsIndeterminate.md")]
pub fn IsIndeterminate(&self) -> windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).IsIndeterminate)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IProgressState/ProgressPercent.md")]
pub fn ProgressPercent(&self) -> windows_core::Result<u32> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ProgressPercent)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IProgressState/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IProgressState/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IProgressState {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IProgressState";
}
pub trait IProgressState_Impl: INotifyPropChanged_Impl {
fn IsIndeterminate(&self) -> windows_core::Result<bool>;
fn ProgressPercent(&self) -> windows_core::Result<u32>;
}
impl IProgressState_Vtbl {
pub const fn new<Identity: IProgressState_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn IsIndeterminate<
Identity: IProgressState_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut bool,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IProgressState_Impl::IsIndeterminate(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn ProgressPercent<
Identity: IProgressState_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut u32,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IProgressState_Impl::ProgressPercent(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IProgressState, OFFSET>(),
IsIndeterminate: IsIndeterminate::<Identity, OFFSET>,
ProgressPercent: ProgressPercent::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IProgressState as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IProgressState_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub IsIndeterminate:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut bool) -> windows_core::HRESULT,
pub ProgressPercent:
unsafe extern "system" fn(*mut core::ffi::c_void, *mut u32) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IPropChangedEventArgs,
IPropChangedEventArgs_Vtbl,
0xbe8d0ccb_ec4b_5003_b564_1977dccd4938
);
impl windows_core::RuntimeType for IPropChangedEventArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IPropChangedEventArgs,
windows_core::IUnknown,
windows_core::IInspectable
);
impl IPropChangedEventArgs {
#[doc = include_str!("./bindings_docs/IPropChangedEventArgs/PropertyName.md")]
pub fn PropertyName(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropertyName)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
}
impl windows_core::RuntimeName for IPropChangedEventArgs {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IPropChangedEventArgs";
}
pub trait IPropChangedEventArgs_Impl: windows_core::IUnknownImpl {
fn PropertyName(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl IPropChangedEventArgs_Vtbl {
pub const fn new<Identity: IPropChangedEventArgs_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn PropertyName<
Identity: IPropChangedEventArgs_Impl,
const OFFSET: isize,
>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IPropChangedEventArgs_Impl::PropertyName(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IPropChangedEventArgs, OFFSET>(
),
PropertyName: PropertyName::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IPropChangedEventArgs as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IPropChangedEventArgs_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub PropertyName: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ISeparatorContextItem,
ISeparatorContextItem_Vtbl,
0x924a87fc_32fe_4471_9156_84b3b30275a6
);
impl windows_core::RuntimeType for ISeparatorContextItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ISeparatorContextItem,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(ISeparatorContextItem, IContextItem);
impl windows_core::RuntimeName for ISeparatorContextItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ISeparatorContextItem";
}
pub trait ISeparatorContextItem_Impl: IContextItem_Impl {}
impl ISeparatorContextItem_Vtbl {
pub const fn new<Identity: ISeparatorContextItem_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ISeparatorContextItem, OFFSET>(
),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ISeparatorContextItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ISeparatorContextItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ISeparatorFilterItem,
ISeparatorFilterItem_Vtbl,
0x0a923c7f_5b7b_431d_9898_3c8c841d02ed
);
impl windows_core::RuntimeType for ISeparatorFilterItem {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ISeparatorFilterItem,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(ISeparatorFilterItem, IFilterItem);
impl windows_core::RuntimeName for ISeparatorFilterItem {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ISeparatorFilterItem";
}
pub trait ISeparatorFilterItem_Impl: IFilterItem_Impl {}
impl ISeparatorFilterItem_Vtbl {
pub const fn new<Identity: ISeparatorFilterItem_Impl, const OFFSET: isize>() -> Self {
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ISeparatorFilterItem, OFFSET>(
),
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ISeparatorFilterItem as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ISeparatorFilterItem_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IStatusMessage,
IStatusMessage_Vtbl,
0x503f6730_5d75_5932_90e1_c48565e1243c
);
impl windows_core::RuntimeType for IStatusMessage {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IStatusMessage,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IStatusMessage, INotifyPropChanged);
impl IStatusMessage {
#[doc = include_str!("./bindings_docs/IStatusMessage/State.md")]
pub fn State(&self) -> windows_core::Result<MessageState> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).State)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IStatusMessage/Progress.md")]
pub fn Progress(&self) -> windows_core::Result<IProgressState> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Progress)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/IStatusMessage/Message.md")]
pub fn Message(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Message)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IStatusMessage/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/IStatusMessage/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for IStatusMessage {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IStatusMessage";
}
pub trait IStatusMessage_Impl: INotifyPropChanged_Impl {
fn State(&self) -> windows_core::Result<MessageState>;
fn Progress(&self) -> windows_core::Result<IProgressState>;
fn Message(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl IStatusMessage_Vtbl {
pub const fn new<Identity: IStatusMessage_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn State<Identity: IStatusMessage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut MessageState,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IStatusMessage_Impl::State(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Progress<Identity: IStatusMessage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IStatusMessage_Impl::Progress(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Message<Identity: IStatusMessage_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IStatusMessage_Impl::Message(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IStatusMessage, OFFSET>(),
State: State::<Identity, OFFSET>,
Progress: Progress::<Identity, OFFSET>,
Message: Message::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IStatusMessage as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IStatusMessage_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub State: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut MessageState,
) -> windows_core::HRESULT,
pub Progress: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Message: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ITag,
ITag_Vtbl,
0x580386ef_4197_5ff0_99f7_fdf82d5748ec
);
impl windows_core::RuntimeType for ITag {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(ITag, windows_core::IUnknown, windows_core::IInspectable);
impl ITag {
#[doc = include_str!("./bindings_docs/ITag/Icon.md")]
pub fn Icon(&self) -> windows_core::Result<IIconInfo> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Icon)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ITag/Text.md")]
pub fn Text(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Text)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/ITag/Foreground.md")]
pub fn Foreground(&self) -> windows_core::Result<OptionalColor> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Foreground)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ITag/Background.md")]
pub fn Background(&self) -> windows_core::Result<OptionalColor> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Background)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ITag/ToolTip.md")]
pub fn ToolTip(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ToolTip)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
}
impl windows_core::RuntimeName for ITag {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ITag";
}
pub trait ITag_Impl: windows_core::IUnknownImpl {
fn Icon(&self) -> windows_core::Result<IIconInfo>;
fn Text(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Foreground(&self) -> windows_core::Result<OptionalColor>;
fn Background(&self) -> windows_core::Result<OptionalColor>;
fn ToolTip(&self) -> windows_core::Result<windows_core::HSTRING>;
}
impl ITag_Vtbl {
pub const fn new<Identity: ITag_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Icon<Identity: ITag_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ITag_Impl::Icon(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Text<Identity: ITag_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ITag_Impl::Text(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Foreground<Identity: ITag_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut OptionalColor,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ITag_Impl::Foreground(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Background<Identity: ITag_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut OptionalColor,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ITag_Impl::Background(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn ToolTip<Identity: ITag_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ITag_Impl::ToolTip(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ITag, OFFSET>(),
Icon: Icon::<Identity, OFFSET>,
Text: Text::<Identity, OFFSET>,
Foreground: Foreground::<Identity, OFFSET>,
Background: Background::<Identity, OFFSET>,
ToolTip: ToolTip::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ITag as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ITag_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Icon: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Text: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Foreground: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut OptionalColor,
) -> windows_core::HRESULT,
pub Background: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut OptionalColor,
) -> windows_core::HRESULT,
pub ToolTip: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
IToastArgs,
IToastArgs_Vtbl,
0xfd301069_8386_52f5_a56c_6c7ce453b34e
);
impl windows_core::RuntimeType for IToastArgs {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IToastArgs,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IToastArgs, ICommandResultArgs);
impl IToastArgs {
#[doc = include_str!("./bindings_docs/IToastArgs/Message.md")]
pub fn Message(&self) -> windows_core::Result<windows_core::HSTRING> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Message)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.map(|| core::mem::transmute(result__))
}
}
#[doc = include_str!("./bindings_docs/IToastArgs/Result.md")]
pub fn Result(&self) -> windows_core::Result<ICommandResult> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).Result)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
}
impl windows_core::RuntimeName for IToastArgs {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IToastArgs";
}
pub trait IToastArgs_Impl: ICommandResultArgs_Impl {
fn Message(&self) -> windows_core::Result<windows_core::HSTRING>;
fn Result(&self) -> windows_core::Result<ICommandResult>;
}
impl IToastArgs_Vtbl {
pub const fn new<Identity: IToastArgs_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Message<Identity: IToastArgs_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IToastArgs_Impl::Message(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn Result<Identity: IToastArgs_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match IToastArgs_Impl::Result(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, IToastArgs, OFFSET>(),
Message: Message::<Identity, OFFSET>,
Result: Result::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IToastArgs as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IToastArgs_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub Message: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub Result: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
crate::_define_windows_core_interface_with_bindings_docs!(
ITreeContent,
ITreeContent_Vtbl,
0xf08d59c3_1ed8_5e9b_85df_1798ce4be423
);
impl windows_core::RuntimeType for ITreeContent {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
ITreeContent,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(
ITreeContent,
IContent,
INotifyItemsChanged,
INotifyPropChanged
);
impl ITreeContent {
#[doc = include_str!("./bindings_docs/ITreeContent/RootContent.md")]
pub fn RootContent(&self) -> windows_core::Result<IContent> {
let this = self;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).RootContent)(
windows_core::Interface::as_raw(this),
&mut result__,
)
.and_then(|| windows_core::Type::from_abi(result__))
}
}
#[doc = include_str!("./bindings_docs/ITreeContent/GetChildren.md")]
pub fn GetChildren(&self) -> windows_core::Result<windows_core::Array<IContent>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).GetChildren)(
windows_core::Interface::as_raw(this),
windows_core::Array::<IContent>::set_abi_len(core::mem::transmute(&mut result__)),
result__.as_mut_ptr() as *mut _ as _,
)
.map(|| result__.assume_init())
}
}
#[doc = include_str!("./bindings_docs/ITreeContent/ItemsChanged.md")]
pub fn ItemsChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IItemsChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).ItemsChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ITreeContent/RemoveItemsChanged.md")]
pub fn RemoveItemsChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyItemsChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemoveItemsChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
#[doc = include_str!("./bindings_docs/ITreeContent/PropChanged.md")]
pub fn PropChanged<P0>(&self, handler: P0) -> windows_core::Result<i64>
where
P0: windows_core::Param<
windows::Foundation::TypedEventHandler<
windows_core::IInspectable,
IPropChangedEventArgs,
>,
>,
{
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
let mut result__ = core::mem::zeroed();
(windows_core::Interface::vtable(this).PropChanged)(
windows_core::Interface::as_raw(this),
handler.param().abi(),
&mut result__,
)
.map(|| result__)
}
}
#[doc = include_str!("./bindings_docs/ITreeContent/RemovePropChanged.md")]
pub fn RemovePropChanged(&self, token: i64) -> windows_core::Result<()> {
let this = &windows_core::Interface::cast::<INotifyPropChanged>(self)?;
unsafe {
(windows_core::Interface::vtable(this).RemovePropChanged)(
windows_core::Interface::as_raw(this),
token,
)
.ok()
}
}
}
impl windows_core::RuntimeName for ITreeContent {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.ITreeContent";
}
pub trait ITreeContent_Impl:
IContent_Impl + INotifyItemsChanged_Impl + INotifyPropChanged_Impl
{
fn RootContent(&self) -> windows_core::Result<IContent>;
fn GetChildren(&self) -> windows_core::Result<windows_core::Array<IContent>>;
}
impl ITreeContent_Vtbl {
pub const fn new<Identity: ITreeContent_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn RootContent<Identity: ITreeContent_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result__: *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ITreeContent_Impl::RootContent(this) {
Ok(ok__) => {
result__.write(core::mem::transmute_copy(&ok__));
core::mem::forget(ok__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
unsafe extern "system" fn GetChildren<Identity: ITreeContent_Impl, const OFFSET: isize>(
this: *mut core::ffi::c_void,
result_size__: *mut u32,
result__: *mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT {
unsafe {
let this: &Identity =
&*((this as *const *const ()).offset(OFFSET) as *const Identity);
match ITreeContent_Impl::GetChildren(this) {
Ok(ok__) => {
let (ok_data__, ok_data_len__) = ok__.into_abi();
result__.write(core::mem::transmute(ok_data__));
result_size__.write(ok_data_len__);
windows_core::HRESULT(0)
}
Err(err) => err.into(),
}
}
}
Self {
base__: windows_core::IInspectable_Vtbl::new::<Identity, ITreeContent, OFFSET>(),
RootContent: RootContent::<Identity, OFFSET>,
GetChildren: GetChildren::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<ITreeContent as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct ITreeContent_Vtbl {
pub base__: windows_core::IInspectable_Vtbl,
pub RootContent: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
pub GetChildren: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[doc = include_str!("./bindings_docs/KeyChord.md")]
pub struct KeyChord {
#[doc = include_str!("./bindings_docs/KeyChord/Modifiers.md")]
pub Modifiers: windows::System::VirtualKeyModifiers,
#[doc = include_str!("./bindings_docs/KeyChord/Vkey.md")]
pub Vkey: i32,
#[doc = include_str!("./bindings_docs/KeyChord/ScanCode.md")]
pub ScanCode: i32,
}
impl windows_core::TypeKind for KeyChord {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for KeyChord {
const SIGNATURE :windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice ( b"struct(Microsoft.CommandPalette.Extensions.KeyChord;enum(Windows.System.VirtualKeyModifiers;u4);i4;i4)" ) ;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
#[doc = include_str!("./bindings_docs/MessageState.md")]
pub struct MessageState(pub i32);
impl MessageState {
#[doc = include_str!("./bindings_docs/MessageState/Info.md")]
pub const Info: Self = Self(0i32);
#[doc = include_str!("./bindings_docs/MessageState/Success.md")]
pub const Success: Self = Self(1i32);
#[doc = include_str!("./bindings_docs/MessageState/Warning.md")]
pub const Warning: Self = Self(2i32);
#[doc = include_str!("./bindings_docs/MessageState/Error.md")]
pub const Error: Self = Self(3i32);
}
impl windows_core::TypeKind for MessageState {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for MessageState {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.CommandPalette.Extensions.MessageState;i4)",
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
#[doc = include_str!("./bindings_docs/NavigationMode.md")]
pub struct NavigationMode(pub i32);
impl NavigationMode {
#[doc = include_str!("./bindings_docs/NavigationMode/Push.md")]
pub const Push: Self = Self(0i32);
#[doc = include_str!("./bindings_docs/NavigationMode/GoBack.md")]
pub const GoBack: Self = Self(1i32);
#[doc = include_str!("./bindings_docs/NavigationMode/GoHome.md")]
pub const GoHome: Self = Self(2i32);
}
impl windows_core::TypeKind for NavigationMode {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for NavigationMode {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.CommandPalette.Extensions.NavigationMode;i4)",
);
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
#[doc = include_str!("./bindings_docs/OptionalColor.md")]
pub struct OptionalColor {
#[doc = include_str!("./bindings_docs/OptionalColor/HasValue.md")]
pub HasValue: bool,
#[doc = include_str!("./bindings_docs/OptionalColor/Color.md")]
pub Color: Color,
}
impl windows_core::TypeKind for OptionalColor {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for OptionalColor {
const SIGNATURE :windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice ( b"struct(Microsoft.CommandPalette.Extensions.OptionalColor;b1;struct(Microsoft.CommandPalette.Extensions.Color;u1;u1;u1;u1))" ) ;
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
#[doc = include_str!("./bindings_docs/ProviderType.md")]
pub struct ProviderType(pub i32);
impl ProviderType {
#[doc = include_str!("./bindings_docs/ProviderType/Commands.md")]
pub const Commands: Self = Self(0i32);
}
impl windows_core::TypeKind for ProviderType {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for ProviderType {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.CommandPalette.Extensions.ProviderType;i4)",
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
#[doc = include_str!("./bindings_docs/StatusContext.md")]
pub struct StatusContext(pub i32);
impl StatusContext {
#[doc = include_str!("./bindings_docs/StatusContext/Page.md")]
pub const Page: Self = Self(0i32);
#[doc = include_str!("./bindings_docs/StatusContext/Extension.md")]
pub const Extension: Self = Self(1i32);
}
impl windows_core::TypeKind for StatusContext {
type TypeKind = windows_core::CopyType;
}
impl windows_core::RuntimeType for StatusContext {
const SIGNATURE: windows_core::imp::ConstBuffer = windows_core::imp::ConstBuffer::from_slice(
b"enum(Microsoft.CommandPalette.Extensions.StatusContext;i4)",
);
}