objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumberwithdocktilepluginsupport?language=objc)
#[cfg(feature = "NSApplication")]
pub static NSAppKitVersionNumberWithDockTilePlugInSupport: NSAppKitVersion = 1001.0 as _;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocktile?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSDockTile;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSDockTile {}
);

impl NSDockTile {
    extern_methods!(
        #[unsafe(method(size))]
        #[unsafe(method_family = none)]
        pub fn size(&self) -> NSSize;

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(contentView))]
        #[unsafe(method_family = none)]
        pub fn contentView(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        /// Setter for [`contentView`][Self::contentView].
        #[unsafe(method(setContentView:))]
        #[unsafe(method_family = none)]
        pub fn setContentView(&self, content_view: Option<&NSView>);

        #[unsafe(method(display))]
        #[unsafe(method_family = none)]
        pub fn display(&self);

        #[unsafe(method(showsApplicationBadge))]
        #[unsafe(method_family = none)]
        pub fn showsApplicationBadge(&self) -> bool;

        /// Setter for [`showsApplicationBadge`][Self::showsApplicationBadge].
        #[unsafe(method(setShowsApplicationBadge:))]
        #[unsafe(method_family = none)]
        pub fn setShowsApplicationBadge(&self, shows_application_badge: bool);

        #[unsafe(method(badgeLabel))]
        #[unsafe(method_family = none)]
        pub fn badgeLabel(&self) -> Option<Retained<NSString>>;

        /// Setter for [`badgeLabel`][Self::badgeLabel].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBadgeLabel:))]
        #[unsafe(method_family = none)]
        pub fn setBadgeLabel(&self, badge_label: Option<&NSString>);

        #[unsafe(method(owner))]
        #[unsafe(method_family = none)]
        pub fn owner(&self) -> Option<Retained<AnyObject>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSDockTile {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSDockTile {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocktileplugin?language=objc)
    pub unsafe trait NSDockTilePlugIn: NSObjectProtocol {
        #[unsafe(method(setDockTile:))]
        #[unsafe(method_family = none)]
        fn setDockTile(&self, dock_tile: Option<&NSDockTile>);

        #[cfg(feature = "NSMenu")]
        #[optional]
        #[unsafe(method(dockMenu))]
        #[unsafe(method_family = none)]
        fn dockMenu(&self, mtm: MainThreadMarker) -> Option<Retained<NSMenu>>;
    }
);