Generated file

Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/browser/components/shell/nsIWindowsShellService.idl
//
/// `interface nsIWindowsShellService : nsIShellService`
///
// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.
#[repr(C)]
pub struct nsIWindowsShellService {
vtable: &'static nsIWindowsShellServiceVTable,
/// This field is a phantomdata to ensure that the VTable type and any
/// struct containing it is not safe to send across threads by default, as
/// XPCOM is generally not threadsafe.
///
/// If this type is marked as [rust_sync], there will be explicit `Send` and
/// `Sync` implementations on this type, which will override the inherited
/// negative impls from `Rc`.
__nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
// Make the rust compiler aware that there might be interior mutability
// in what actually implements the interface. This works around UB
// that a rust lint would make blatantly obvious, but doesn't exist.
// This prevents optimizations, but those optimizations weren't available
// before rustc switched to LLVM 16, and they now cause problems because
// of the UB.
// Until there's a lint available to find all our UB, it's simpler to
// avoid the UB in the first place, at the cost of preventing optimizations
// in places that don't cause UB. But again, those optimizations weren't
// available before.
__maybe_interior_mutability: ::std::cell::UnsafeCell<[u8; 0]>,
}
// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIWindowsShellService.
unsafe impl XpCom for nsIWindowsShellService {
const IID: nsIID = nsID(0xfb9b59db, 0x5a91, 0x4e67,
[0x92, 0xb6, 0x35, 0xe7, 0xd6, 0xe6, 0xd3, 0xfd]);
}
// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIWindowsShellService {
#[inline]
unsafe fn addref(&self) {
self.AddRef();
}
#[inline]
unsafe fn release(&self) {
self.Release();
}
}
// This trait is implemented on all types which can be coerced to from nsIWindowsShellService.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIWindowsShellServiceCoerce {
/// Cheaply cast a value of this type from a `nsIWindowsShellService`.
fn coerce_from(v: &nsIWindowsShellService) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIWindowsShellServiceCoerce for nsIWindowsShellService {
#[inline]
fn coerce_from(v: &nsIWindowsShellService) -> &Self {
v
}
}
impl nsIWindowsShellService {
/// Cast this `nsIWindowsShellService` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIWindowsShellServiceCoerce>(&self) -> &T {
T::coerce_from(self)
}
}
// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIWindowsShellService {
type Target = nsIShellService;
#[inline]
fn deref(&self) -> &nsIShellService {
unsafe {
::std::mem::transmute(self)
}
}
}
// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsIShellServiceCoerce> nsIWindowsShellServiceCoerce for T {
#[inline]
fn coerce_from(v: &nsIWindowsShellService) -> &Self {
T::coerce_from(v)
}
}
// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIWindowsShellService
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIWindowsShellServiceVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsIShellServiceVTable,
/* [implicit_jscontext] Promise createShortcut (in nsIFile aBinary, in Array<AString> aArguments, in AString aDescription, in nsIFile aIconFile, in unsigned short aIconIndex, in AString aAppUserModelId, in AString aShortcutFolder, in AString aShortcutRelativePath); */
/// Unable to generate binding because `jscontext is unsupported`
pub CreateShortcut: *const ::libc::c_void,
/* [implicit_jscontext] Promise deleteShortcut (in AString aShortcutFolder, in AString aShortcutRelativePath); */
/// Unable to generate binding because `jscontext is unsupported`
pub DeleteShortcut: *const ::libc::c_void,
/* Array<AString> getLaunchOnLoginShortcuts (); */
pub GetLaunchOnLoginShortcuts: unsafe extern "system" fn (this: *const nsIWindowsShellService, _retval: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult,
/* [implicit_jscontext] Promise pinCurrentAppToStartMenu (); */
/// Unable to generate binding because `jscontext is unsupported`
pub PinCurrentAppToStartMenu: *const ::libc::c_void,
/* [implicit_jscontext] Promise isCurrentAppPinnedToStartMenu (); */
/// Unable to generate binding because `jscontext is unsupported`
pub IsCurrentAppPinnedToStartMenu: *const ::libc::c_void,
/* [implicit_jscontext] Promise enableLaunchOnLoginMSIX (in AString aTaskId); */
/// Unable to generate binding because `jscontext is unsupported`
pub EnableLaunchOnLoginMSIX: *const ::libc::c_void,
/* [implicit_jscontext] Promise disableLaunchOnLoginMSIX (in AString aTaskId); */
/// Unable to generate binding because `jscontext is unsupported`
pub DisableLaunchOnLoginMSIX: *const ::libc::c_void,
/* [implicit_jscontext] Promise getLaunchOnLoginEnabledMSIX (in AString aTaskId); */
/// Unable to generate binding because `jscontext is unsupported`
pub GetLaunchOnLoginEnabledMSIX: *const ::libc::c_void,
/* [implicit_jscontext] Promise pinCurrentAppToTaskbar (in boolean aPrivateBrowsing, [optional] in boolean aFireAndForget); */
/// Unable to generate binding because `jscontext is unsupported`
pub PinCurrentAppToTaskbar: *const ::libc::c_void,
/* void canPinToTaskbar (); */
pub CanPinToTaskbar: unsafe extern "system" fn (this: *const nsIWindowsShellService) -> ::nserror::nsresult,
/* [implicit_jscontext] Promise isCurrentAppPinnedToTaskbar (in AString aumid); */
/// Unable to generate binding because `jscontext is unsupported`
pub IsCurrentAppPinnedToTaskbar: *const ::libc::c_void,
/* [implicit_jscontext] Promise pinShortcutToTaskbar (in AString aAppUserModelId, in AString aShortcutFolder, in AString aShortcutRelativePath); */
/// Unable to generate binding because `jscontext is unsupported`
pub PinShortcutToTaskbar: *const ::libc::c_void,
/* void unpinShortcutFromTaskbar (in AString aShortcutFolder, in AString aShortcutRelativePath); */
pub UnpinShortcutFromTaskbar: unsafe extern "system" fn (this: *const nsIWindowsShellService, aShortcutFolder: *const ::nsstring::nsAString, aShortcutRelativePath: *const ::nsstring::nsAString) -> ::nserror::nsresult,
/* void launchSetDefaultAppPicker (in AString aTarget, in long aFlags); */
pub LaunchSetDefaultAppPicker: unsafe extern "system" fn (this: *const nsIWindowsShellService, aTarget: *const ::nsstring::nsAString, aFlags: i32) -> ::nserror::nsresult,
/* void launchModernSettingsDialogDefaultApps (); */
pub LaunchModernSettingsDialogDefaultApps: unsafe extern "system" fn (this: *const nsIWindowsShellService) -> ::nserror::nsresult,
/* AString classifyShortcut (in AString aPath); */
pub ClassifyShortcut: unsafe extern "system" fn (this: *const nsIWindowsShellService, aPath: *const ::nsstring::nsAString, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* [implicit_jscontext] Promise hasPinnableShortcut (in AString aAUMID, in boolean aPrivateBrowsing); */
/// Unable to generate binding because `jscontext is unsupported`
pub HasPinnableShortcut: *const ::libc::c_void,
/* boolean canSetDefaultBrowserUserChoice (); */
pub CanSetDefaultBrowserUserChoice: unsafe extern "system" fn (this: *const nsIWindowsShellService, _retval: *mut bool) -> ::nserror::nsresult,
/* boolean checkAllProgIDsExist (); */
pub CheckAllProgIDsExist: unsafe extern "system" fn (this: *const nsIWindowsShellService, _retval: *mut bool) -> ::nserror::nsresult,
/* boolean checkBrowserUserChoiceHashes (); */
pub CheckBrowserUserChoiceHashes: unsafe extern "system" fn (this: *const nsIWindowsShellService, _retval: *mut bool) -> ::nserror::nsresult,
/* boolean isUserChoiceProtectionDriverRunning (); */
pub IsUserChoiceProtectionDriverRunning: unsafe extern "system" fn (this: *const nsIWindowsShellService, _retval: *mut bool) -> ::nserror::nsresult,
/* boolean canRenameUserChoiceAssociationKey (in AString aAssociation); */
pub CanRenameUserChoiceAssociationKey: unsafe extern "system" fn (this: *const nsIWindowsShellService, aAssociation: *const ::nsstring::nsAString, _retval: *mut bool) -> ::nserror::nsresult,
/* AString checkCurrentProcessAUMIDForTesting (); */
pub CheckCurrentProcessAUMIDForTesting: unsafe extern "system" fn (this: *const nsIWindowsShellService, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* boolean isDefaultHandlerFor (in AString aFileExtensionOrProtocol); */
pub IsDefaultHandlerFor: unsafe extern "system" fn (this: *const nsIWindowsShellService, aFileExtensionOrProtocol: *const ::nsstring::nsAString, _retval: *mut bool) -> ::nserror::nsresult,
/* AString queryCurrentDefaultHandlerFor (in AString aFileExtensionOrProtocol); */
pub QueryCurrentDefaultHandlerFor: unsafe extern "system" fn (this: *const nsIWindowsShellService, aFileExtensionOrProtocol: *const ::nsstring::nsAString, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* [implicit_jscontext] Promise setShortcutsIcon (in Array<AString> aShortcutPaths, in AString aIconPath, in unsigned short aIconResourceId); */
/// Unable to generate binding because `jscontext is unsupported`
pub SetShortcutsIcon: *const ::libc::c_void,
/* [implicit_jscontext] Promise enumerateInstallShortcuts (in AString aAppUserModelId); */
/// Unable to generate binding because `jscontext is unsupported`
pub EnumerateInstallShortcuts: *const ::libc::c_void,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIWindowsShellService {
pub const OPEN_WITH_SUPPRESS_OPEN: i32 = 4;
pub const OPEN_WITH_PROTOCOL_MESSAGING: i32 = 8;
pub const OPEN_WITH_OPEN_ONCE: i32 = 64;
pub const OPEN_WITH_SET_HANDLER: i32 = 128;
pub const OPEN_WITH_SET_HANDLER_WIN10: i32 = 8192;
pub const LAUNCH_ON_LOGIN_DISABLED_BY_SETTINGS: u8 = 0;
pub const LAUNCH_ON_LOGIN_DISABLED: u8 = 1;
pub const LAUNCH_ON_LOGIN_ENABLED: u8 = 2;
pub const LAUNCH_ON_LOGIN_ENABLED_BY_POLICY: u8 = 3;
pub const PINNED: u8 = 0;
pub const REJECTED: u8 = 1;
pub const UNKNOWN: u8 = 2;
/// `[implicit_jscontext] Promise createShortcut (in nsIFile aBinary, in Array<AString> aArguments, in AString aDescription, in nsIFile aIconFile, in unsigned short aIconIndex, in AString aAppUserModelId, in AString aShortcutFolder, in AString aShortcutRelativePath);`
const _CreateShortcut: () = ();
/// `[implicit_jscontext] Promise deleteShortcut (in AString aShortcutFolder, in AString aShortcutRelativePath);`
const _DeleteShortcut: () = ();
/// `Array<AString> getLaunchOnLoginShortcuts ();`
#[inline]
pub unsafe fn GetLaunchOnLoginShortcuts(&self, _retval: *mut thin_vec::ThinVec<::nsstring::nsString>) -> ::nserror::nsresult {
((*self.vtable).GetLaunchOnLoginShortcuts)(self, _retval)
}
/// `[implicit_jscontext] Promise pinCurrentAppToStartMenu ();`
const _PinCurrentAppToStartMenu: () = ();
/// `[implicit_jscontext] Promise isCurrentAppPinnedToStartMenu ();`
const _IsCurrentAppPinnedToStartMenu: () = ();
/// `[implicit_jscontext] Promise enableLaunchOnLoginMSIX (in AString aTaskId);`
const _EnableLaunchOnLoginMSIX: () = ();
/// `[implicit_jscontext] Promise disableLaunchOnLoginMSIX (in AString aTaskId);`
const _DisableLaunchOnLoginMSIX: () = ();
/// `[implicit_jscontext] Promise getLaunchOnLoginEnabledMSIX (in AString aTaskId);`
const _GetLaunchOnLoginEnabledMSIX: () = ();
/// `[implicit_jscontext] Promise pinCurrentAppToTaskbar (in boolean aPrivateBrowsing, [optional] in boolean aFireAndForget);`
const _PinCurrentAppToTaskbar: () = ();
/// `void canPinToTaskbar ();`
#[inline]
pub unsafe fn CanPinToTaskbar(&self, ) -> ::nserror::nsresult {
((*self.vtable).CanPinToTaskbar)(self, )
}
/// `[implicit_jscontext] Promise isCurrentAppPinnedToTaskbar (in AString aumid);`
const _IsCurrentAppPinnedToTaskbar: () = ();
/// `[implicit_jscontext] Promise pinShortcutToTaskbar (in AString aAppUserModelId, in AString aShortcutFolder, in AString aShortcutRelativePath);`
const _PinShortcutToTaskbar: () = ();
/// `void unpinShortcutFromTaskbar (in AString aShortcutFolder, in AString aShortcutRelativePath);`
#[inline]
pub unsafe fn UnpinShortcutFromTaskbar(&self, aShortcutFolder: *const ::nsstring::nsAString, aShortcutRelativePath: *const ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).UnpinShortcutFromTaskbar)(self, aShortcutFolder, aShortcutRelativePath)
}
/// `void launchSetDefaultAppPicker (in AString aTarget, in long aFlags);`
#[inline]
pub unsafe fn LaunchSetDefaultAppPicker(&self, aTarget: *const ::nsstring::nsAString, aFlags: i32) -> ::nserror::nsresult {
((*self.vtable).LaunchSetDefaultAppPicker)(self, aTarget, aFlags)
}
/// `void launchModernSettingsDialogDefaultApps ();`
#[inline]
pub unsafe fn LaunchModernSettingsDialogDefaultApps(&self, ) -> ::nserror::nsresult {
((*self.vtable).LaunchModernSettingsDialogDefaultApps)(self, )
}
/// `AString classifyShortcut (in AString aPath);`
#[inline]
pub unsafe fn ClassifyShortcut(&self, aPath: *const ::nsstring::nsAString, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).ClassifyShortcut)(self, aPath, _retval)
}
/// `[implicit_jscontext] Promise hasPinnableShortcut (in AString aAUMID, in boolean aPrivateBrowsing);`
const _HasPinnableShortcut: () = ();
/// `boolean canSetDefaultBrowserUserChoice ();`
#[inline]
pub unsafe fn CanSetDefaultBrowserUserChoice(&self, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).CanSetDefaultBrowserUserChoice)(self, _retval)
}
/// `boolean checkAllProgIDsExist ();`
#[inline]
pub unsafe fn CheckAllProgIDsExist(&self, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).CheckAllProgIDsExist)(self, _retval)
}
/// `boolean checkBrowserUserChoiceHashes ();`
#[inline]
pub unsafe fn CheckBrowserUserChoiceHashes(&self, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).CheckBrowserUserChoiceHashes)(self, _retval)
}
/// `boolean isUserChoiceProtectionDriverRunning ();`
#[inline]
pub unsafe fn IsUserChoiceProtectionDriverRunning(&self, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).IsUserChoiceProtectionDriverRunning)(self, _retval)
}
/// `boolean canRenameUserChoiceAssociationKey (in AString aAssociation);`
#[inline]
pub unsafe fn CanRenameUserChoiceAssociationKey(&self, aAssociation: *const ::nsstring::nsAString, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).CanRenameUserChoiceAssociationKey)(self, aAssociation, _retval)
}
/// `AString checkCurrentProcessAUMIDForTesting ();`
#[inline]
pub unsafe fn CheckCurrentProcessAUMIDForTesting(&self, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).CheckCurrentProcessAUMIDForTesting)(self, _retval)
}
/// `boolean isDefaultHandlerFor (in AString aFileExtensionOrProtocol);`
#[inline]
pub unsafe fn IsDefaultHandlerFor(&self, aFileExtensionOrProtocol: *const ::nsstring::nsAString, _retval: *mut bool) -> ::nserror::nsresult {
((*self.vtable).IsDefaultHandlerFor)(self, aFileExtensionOrProtocol, _retval)
}
/// `AString queryCurrentDefaultHandlerFor (in AString aFileExtensionOrProtocol);`
#[inline]
pub unsafe fn QueryCurrentDefaultHandlerFor(&self, aFileExtensionOrProtocol: *const ::nsstring::nsAString, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).QueryCurrentDefaultHandlerFor)(self, aFileExtensionOrProtocol, _retval)
}
/// `[implicit_jscontext] Promise setShortcutsIcon (in Array<AString> aShortcutPaths, in AString aIconPath, in unsigned short aIconResourceId);`
const _SetShortcutsIcon: () = ();
/// `[implicit_jscontext] Promise enumerateInstallShortcuts (in AString aAppUserModelId);`
const _EnumerateInstallShortcuts: () = ();
}