#![allow(
non_snake_case,
non_upper_case_globals,
non_camel_case_types,
dead_code,
clippy::all
)]
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, PartialEq)]
pub struct Color {
pub R: u8,
pub G: u8,
pub B: u8,
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)]
pub struct CommandResultKind(pub i32);
impl CommandResultKind {
pub const Dismiss: Self = Self(0i32);
pub const GoHome: Self = Self(1i32);
pub const GoBack: Self = Self(2i32);
pub const Hide: Self = Self(3i32);
pub const KeepOpen: Self = Self(4i32);
pub const GoToPage: Self = Self(5i32);
pub const ShowToast: Self = Self(6i32);
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)",
);
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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__)
}
}
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__))
}
}
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())
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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())
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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())
}
}
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())
}
}
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__))
}
}
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()
}
}
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()
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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())
}
}
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__))
}
}
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())
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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()
}
}
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__)
}
}
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()
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
IDetailsCommand,
IDetailsCommand_Vtbl,
0x3b0a6c65_f52c_57b3_b3e5_99e5f0678f8e
);
impl windows_core::RuntimeType for IDetailsCommand {
const SIGNATURE: windows_core::imp::ConstBuffer =
windows_core::imp::ConstBuffer::for_interface::<Self>();
}
windows_core::imp::interface_hierarchy!(
IDetailsCommand,
windows_core::IUnknown,
windows_core::IInspectable
);
windows_core::imp::required_hierarchy!(IDetailsCommand, IDetailsData);
impl IDetailsCommand {
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__))
}
}
}
impl windows_core::RuntimeName for IDetailsCommand {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IDetailsCommand";
}
#[ambassador::delegatable_trait]
pub trait IDetailsCommand_Impl: IDetailsData_Impl {
fn Command(&self) -> windows_core::Result<ICommand>;
}
impl IDetailsCommand_Vtbl {
pub const fn new<Identity: IDetailsCommand_Impl, const OFFSET: isize>() -> Self {
unsafe extern "system" fn Command<Identity: IDetailsCommand_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 IDetailsCommand_Impl::Command(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, IDetailsCommand, OFFSET>(),
Command: Command::<Identity, OFFSET>,
}
}
pub fn matches(iid: &windows_core::GUID) -> bool {
iid == &<IDetailsCommand as windows_core::Interface>::IID
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDetailsCommand_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,
}
windows_core::imp::define_interface!(
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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()
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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__))
}
}
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())
}
}
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()
}
}
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__)
}
}
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()
}
}
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__)
}
}
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()
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__))
}
}
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())
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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);
impl IFilter {
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__))
}
}
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__))
}
}
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__))
}
}
}
impl windows_core::RuntimeName for IFilter {
const NAME: &'static str = "Microsoft.CommandPalette.Extensions.IFilter";
}
#[ambassador::delegatable_trait]
pub trait IFilter_Impl: IFilterItem_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,
}
windows_core::imp::define_interface!(
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
IFilters,
IFilters_Vtbl,
0xc7f16dc1_074c_5dae_a021_e06107573698
);
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 {
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__))
}
}
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()
}
}
pub fn Filters(&self) -> windows_core::Result<windows_core::Array<IFilterItem>> {
let this = self;
unsafe {
let mut result__ = core::mem::MaybeUninit::zeroed();
(windows_core::Interface::vtable(this).Filters)(
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";
}
#[ambassador::delegatable_trait]
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 Filters(&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 Filters<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::Filters(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>,
Filters: Filters::<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 Filters: unsafe extern "system" fn(
*mut core::ffi::c_void,
*mut u32,
*mut *mut *mut core::ffi::c_void,
) -> windows_core::HRESULT,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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())
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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())
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__))
}
}
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__)
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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__))
}
}
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())
}
}
pub fn LoadMore(&self) -> windows_core::Result<()> {
let this = self;
unsafe {
(windows_core::Interface::vtable(this).LoadMore)(windows_core::Interface::as_raw(this))
.ok()
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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()
}
}
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__)
}
}
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()
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(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 {
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__))
}
}
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__)
}
}
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__)
}
}
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__))
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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__)
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__)
}
}
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__))
}
}
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__))
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(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 {
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__))
}
}
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__))
}
}
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__)
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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";
}
#[ambassador::delegatable_trait]
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,
}
windows_core::imp::define_interface!(
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 {
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__))
}
}
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())
}
}
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__)
}
}
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()
}
}
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__)
}
}
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";
}
#[ambassador::delegatable_trait]
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)]
pub struct KeyChord {
pub Modifiers: windows::System::VirtualKeyModifiers,
pub Vkey: i32,
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)]
pub struct MessageState(pub i32);
impl MessageState {
pub const Info: Self = Self(0i32);
pub const Success: Self = Self(1i32);
pub const Warning: Self = Self(2i32);
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)]
pub struct NavigationMode(pub i32);
impl NavigationMode {
pub const Push: Self = Self(0i32);
pub const GoBack: Self = Self(1i32);
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)]
pub struct OptionalColor {
pub HasValue: bool,
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)]
pub struct ProviderType(pub i32);
impl ProviderType {
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)]
pub struct StatusContext(pub i32);
impl StatusContext {
pub const Page: Self = Self(0i32);
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)",
);
}