Copy as Markdown

Other Tools

//
// DO NOT EDIT. THIS FILE IS GENERATED FROM $SRCDIR/widget/nsIWinTaskbar.idl
//
/// `interface nsIWinTaskbar : nsISupports`
///
// 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 nsIWinTaskbar {
vtable: &'static nsIWinTaskbarVTable,
/// 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 nsIWinTaskbar.
unsafe impl XpCom for nsIWinTaskbar {
const IID: nsIID = nsID(0x11751471, 0x9246, 0x4c72,
[0xa8, 0x0f, 0x0c, 0x7d, 0xf7, 0x65, 0xd6, 0x40]);
}
// 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 nsIWinTaskbar {
#[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 nsIWinTaskbar.
// 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 nsIWinTaskbarCoerce {
/// Cheaply cast a value of this type from a `nsIWinTaskbar`.
fn coerce_from(v: &nsIWinTaskbar) -> &Self;
}
// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIWinTaskbarCoerce for nsIWinTaskbar {
#[inline]
fn coerce_from(v: &nsIWinTaskbar) -> &Self {
v
}
}
impl nsIWinTaskbar {
/// Cast this `nsIWinTaskbar` to one of its base interfaces.
#[inline]
pub fn coerce<T: nsIWinTaskbarCoerce>(&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 nsIWinTaskbar {
type Target = nsISupports;
#[inline]
fn deref(&self) -> &nsISupports {
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: nsISupportsCoerce> nsIWinTaskbarCoerce for T {
#[inline]
fn coerce_from(v: &nsIWinTaskbar) -> &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 nsIWinTaskbar
// 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 nsIWinTaskbarVTable {
/// We need to include the members from the base interface's vtable at the start
/// of the VTable definition.
pub __base: nsISupportsVTable,
/* readonly attribute boolean available; */
pub GetAvailable: unsafe extern "system" fn (this: *const nsIWinTaskbar, aAvailable: *mut bool) -> ::nserror::nsresult,
/* readonly attribute AString defaultGroupId; */
pub GetDefaultGroupId: unsafe extern "system" fn (this: *const nsIWinTaskbar, aDefaultGroupId: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* readonly attribute AString defaultPrivateGroupId; */
pub GetDefaultPrivateGroupId: unsafe extern "system" fn (this: *const nsIWinTaskbar, aDefaultPrivateGroupId: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* nsITaskbarTabPreview createTaskbarTabPreview (in nsIDocShell shell, in nsITaskbarPreviewController controller); */
pub CreateTaskbarTabPreview: unsafe extern "system" fn (this: *const nsIWinTaskbar, shell: *const nsIDocShell, controller: *const nsITaskbarPreviewController, _retval: *mut*const nsITaskbarTabPreview) -> ::nserror::nsresult,
/* nsITaskbarWindowPreview getTaskbarWindowPreview (in nsIDocShell shell); */
pub GetTaskbarWindowPreview: unsafe extern "system" fn (this: *const nsIWinTaskbar, shell: *const nsIDocShell, _retval: *mut*const nsITaskbarWindowPreview) -> ::nserror::nsresult,
/* nsITaskbarProgress getTaskbarProgress (in nsIDocShell shell); */
pub GetTaskbarProgress: unsafe extern "system" fn (this: *const nsIWinTaskbar, shell: *const nsIDocShell, _retval: *mut*const nsITaskbarProgress) -> ::nserror::nsresult,
/* nsITaskbarOverlayIconController getOverlayIconController (in nsIDocShell shell); */
pub GetOverlayIconController: unsafe extern "system" fn (this: *const nsIWinTaskbar, shell: *const nsIDocShell, _retval: *mut*const nsITaskbarOverlayIconController) -> ::nserror::nsresult,
/* nsILegacyJumpListBuilder createLegacyJumpListBuilder (in boolean aPrivateBrowsing); */
pub CreateLegacyJumpListBuilder: unsafe extern "system" fn (this: *const nsIWinTaskbar, aPrivateBrowsing: bool, _retval: *mut*const nsILegacyJumpListBuilder) -> ::nserror::nsresult,
/* nsIJumpListBuilder createJumpListBuilder (in boolean aPrivateBrowsing); */
pub CreateJumpListBuilder: unsafe extern "system" fn (this: *const nsIWinTaskbar, aPrivateBrowsing: bool, _retval: *mut*const nsIJumpListBuilder) -> ::nserror::nsresult,
/* AString getGroupIdForWindow (in mozIDOMWindow aParent); */
pub GetGroupIdForWindow: unsafe extern "system" fn (this: *const nsIWinTaskbar, aParent: *const mozIDOMWindow, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult,
/* void setGroupIdForWindow (in mozIDOMWindow aParent, in AString aIdentifier); */
pub SetGroupIdForWindow: unsafe extern "system" fn (this: *const nsIWinTaskbar, aParent: *const mozIDOMWindow, aIdentifier: *const ::nsstring::nsAString) -> ::nserror::nsresult,
/* [noscript] void prepareFullScreen (in voidPtr aHWND, in boolean aFullScreen); */
pub PrepareFullScreen: unsafe extern "system" fn (this: *const nsIWinTaskbar, aHWND: *mut libc::c_void, aFullScreen: bool) -> ::nserror::nsresult,
}
// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIWinTaskbar {
/// ```text
/// /**
/// * Returns true if the operating system supports Win7+ taskbar features.
/// * This property acts as a replacement for in-place os version checking.
/// */
/// ```
///
/// `readonly attribute boolean available;`
#[inline]
pub unsafe fn GetAvailable(&self, aAvailable: *mut bool) -> ::nserror::nsresult {
((*self.vtable).GetAvailable)(self, aAvailable)
}
/// ```text
/// /**
/// * Returns the default application user model identity the application
/// * registers with the system. This id is used by the taskbar in grouping
/// * windows and in associating pinned shortcuts with running instances and
/// * jump lists.
/// */
/// ```
///
/// `readonly attribute AString defaultGroupId;`
#[inline]
pub unsafe fn GetDefaultGroupId(&self, aDefaultGroupId: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetDefaultGroupId)(self, aDefaultGroupId)
}
/// ```text
/// /**
/// * Same as above, but a different value so that Private Browsing windows
/// * can be separated in the Taskbar.
/// */
/// ```
///
/// `readonly attribute AString defaultPrivateGroupId;`
#[inline]
pub unsafe fn GetDefaultPrivateGroupId(&self, aDefaultPrivateGroupId: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetDefaultPrivateGroupId)(self, aDefaultPrivateGroupId)
}
/// ```text
/// /**
/// * Taskbar window and tab preview management
/// */
/// /**
/// * Creates a taskbar preview. The docshell should be a toplevel docshell and
/// * is used to find the toplevel window. See the documentation for
/// * nsITaskbarTabPreview for more information.
/// */
/// ```
///
/// `nsITaskbarTabPreview createTaskbarTabPreview (in nsIDocShell shell, in nsITaskbarPreviewController controller);`
#[inline]
pub unsafe fn CreateTaskbarTabPreview(&self, shell: *const nsIDocShell, controller: *const nsITaskbarPreviewController, _retval: *mut*const nsITaskbarTabPreview) -> ::nserror::nsresult {
((*self.vtable).CreateTaskbarTabPreview)(self, shell, controller, _retval)
}
/// ```text
/// /**
/// * Gets the taskbar preview for a window. The docshell is used to find the
/// * toplevel window. See the documentation for nsITaskbarTabPreview for more
/// * information.
/// *
/// * Note: to implement custom drawing or buttons, a controller is required.
/// */
/// ```
///
/// `nsITaskbarWindowPreview getTaskbarWindowPreview (in nsIDocShell shell);`
#[inline]
pub unsafe fn GetTaskbarWindowPreview(&self, shell: *const nsIDocShell, _retval: *mut*const nsITaskbarWindowPreview) -> ::nserror::nsresult {
((*self.vtable).GetTaskbarWindowPreview)(self, shell, _retval)
}
/// ```text
/// /**
/// * Taskbar icon progress indicator
/// */
/// /**
/// * Gets the taskbar progress for a window. The docshell is used to find the
/// * toplevel window. See the documentation for nsITaskbarProgress for more
/// * information.
/// */
/// ```
///
/// `nsITaskbarProgress getTaskbarProgress (in nsIDocShell shell);`
#[inline]
pub unsafe fn GetTaskbarProgress(&self, shell: *const nsIDocShell, _retval: *mut*const nsITaskbarProgress) -> ::nserror::nsresult {
((*self.vtable).GetTaskbarProgress)(self, shell, _retval)
}
/// ```text
/// /**
/// * Taskbar icon overlay
/// */
/// /**
/// * Gets the taskbar icon overlay controller for a window. The docshell is used
/// * to find the toplevel window. See the documentation in
/// * nsITaskbarOverlayIconController for more details.
/// */
/// ```
///
/// `nsITaskbarOverlayIconController getOverlayIconController (in nsIDocShell shell);`
#[inline]
pub unsafe fn GetOverlayIconController(&self, shell: *const nsIDocShell, _retval: *mut*const nsITaskbarOverlayIconController) -> ::nserror::nsresult {
((*self.vtable).GetOverlayIconController)(self, shell, _retval)
}
/// ```text
/// /**
/// * Taskbar and start menu jump list management
/// */
/// /**
/// * Retrieve a legacy taskbar jump list builder. This jump list builder backend
/// * is in the process of being phased out.
/// *
/// * Fails if a jump list build operation has already been initiated, developers
/// * should make use of a single instance of nsILegacyJumpListBuilder for building lists
/// * within an application.
/// *
/// * @throws NS_ERROR_ALREADY_INITIALIZED if an nsILegacyJumpListBuilder instance is
/// * currently building a list.
/// */
/// ```
///
/// `nsILegacyJumpListBuilder createLegacyJumpListBuilder (in boolean aPrivateBrowsing);`
#[inline]
pub unsafe fn CreateLegacyJumpListBuilder(&self, aPrivateBrowsing: bool, _retval: *mut*const nsILegacyJumpListBuilder) -> ::nserror::nsresult {
((*self.vtable).CreateLegacyJumpListBuilder)(self, aPrivateBrowsing, _retval)
}
/// ```text
/// /**
/// * Retrieves a Windows Jump List builder. This jump list builder can be used
/// * to asynchronously add, remove, and update items in the Windows Jump List.
/// *
/// * @throws NS_ERROR_UNEXPECTED if the builder failed to be created.
/// */
/// ```
///
/// `nsIJumpListBuilder createJumpListBuilder (in boolean aPrivateBrowsing);`
#[inline]
pub unsafe fn CreateJumpListBuilder(&self, aPrivateBrowsing: bool, _retval: *mut*const nsIJumpListBuilder) -> ::nserror::nsresult {
((*self.vtable).CreateJumpListBuilder)(self, aPrivateBrowsing, _retval)
}
/// ```text
/// /**
/// * Application window taskbar group settings
/// */
/// /**
/// * Get the grouping id for a window.
/// *
/// * The runtime sets a default, global grouping id for all windows on startup.
/// * getGroupIdForWindow allows finding the grouping of individual windows
/// * on the taskbar.
/// *
/// * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
/// * associated with a widget.
/// * @throw NS_ERROR_FAILURE if the property on the window could not be set.
/// * @throw NS_ERROR_UNEXPECTED for general failures.
/// */
/// ```
///
/// `AString getGroupIdForWindow (in mozIDOMWindow aParent);`
#[inline]
pub unsafe fn GetGroupIdForWindow(&self, aParent: *const mozIDOMWindow, _retval: *mut ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).GetGroupIdForWindow)(self, aParent, _retval)
}
/// ```text
/// /**
/// * Set the grouping id for a window.
/// *
/// * The runtime sets a default, global grouping id for all windows on startup.
/// * setGroupIdForWindow allows individual windows to be grouped independently
/// * on the taskbar. Ids should be unique to the app and window to insure
/// * conflicts with other pinned applications do no arise.
/// *
/// * The default group id is based on application.ini vendor, application, and
/// * version values, with a format of 'vendor.app.version'. The default can be
/// * retrieved via defaultGroupId.
/// *
/// * Note, when a window changes taskbar window stacks, it is placed at the
/// * bottom of the new stack.
/// *
/// * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
/// * associated with a widget.
/// * @throw NS_ERROR_FAILURE if the property on the window could not be set.
/// * @throw NS_ERROR_UNEXPECTED for general failures.
/// */
/// ```
///
/// `void setGroupIdForWindow (in mozIDOMWindow aParent, in AString aIdentifier);`
#[inline]
pub unsafe fn SetGroupIdForWindow(&self, aParent: *const mozIDOMWindow, aIdentifier: *const ::nsstring::nsAString) -> ::nserror::nsresult {
((*self.vtable).SetGroupIdForWindow)(self, aParent, aIdentifier)
}
/// ```text
/// /**
/// * Notify the taskbar that a window identified by its HWND is about to enter
/// * full screen mode.
/// *
/// * A Windows autohide taskbar will not behave correctly in all cases if
/// * it is not notified when full screen operations start and end.
/// *
/// * @throw NS_ERROR_INVALID_ARG if the window is not a valid top level window
/// * @throw NS_ERROR_UNEXPECTED for general failures.
/// * @throw NS_ERROR_NOT_AVAILABLE if the taskbar cannot be obtained.
/// */
/// ```
///
/// `[noscript] void prepareFullScreen (in voidPtr aHWND, in boolean aFullScreen);`
#[inline]
pub unsafe fn PrepareFullScreen(&self, aHWND: *mut libc::c_void, aFullScreen: bool) -> ::nserror::nsresult {
((*self.vtable).PrepareFullScreen)(self, aHWND, aFullScreen)
}
}