objc2_app_kit/generated/
NSDockTile.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsappkitversionnumberwithdocktilepluginsupport?language=objc)
11#[cfg(feature = "NSApplication")]
12pub static NSAppKitVersionNumberWithDockTilePlugInSupport: NSAppKitVersion = 1001.0 as _;
13
14extern_class!(
15    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocktile?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct NSDockTile;
19);
20
21extern_conformance!(
22    unsafe impl NSObjectProtocol for NSDockTile {}
23);
24
25impl NSDockTile {
26    extern_methods!(
27        #[unsafe(method(size))]
28        #[unsafe(method_family = none)]
29        pub fn size(&self) -> NSSize;
30
31        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
32        #[unsafe(method(contentView))]
33        #[unsafe(method_family = none)]
34        pub fn contentView(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
35
36        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
37        /// Setter for [`contentView`][Self::contentView].
38        #[unsafe(method(setContentView:))]
39        #[unsafe(method_family = none)]
40        pub fn setContentView(&self, content_view: Option<&NSView>);
41
42        #[unsafe(method(display))]
43        #[unsafe(method_family = none)]
44        pub fn display(&self);
45
46        #[unsafe(method(showsApplicationBadge))]
47        #[unsafe(method_family = none)]
48        pub fn showsApplicationBadge(&self) -> bool;
49
50        /// Setter for [`showsApplicationBadge`][Self::showsApplicationBadge].
51        #[unsafe(method(setShowsApplicationBadge:))]
52        #[unsafe(method_family = none)]
53        pub fn setShowsApplicationBadge(&self, shows_application_badge: bool);
54
55        #[unsafe(method(badgeLabel))]
56        #[unsafe(method_family = none)]
57        pub fn badgeLabel(&self) -> Option<Retained<NSString>>;
58
59        /// Setter for [`badgeLabel`][Self::badgeLabel].
60        ///
61        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
62        #[unsafe(method(setBadgeLabel:))]
63        #[unsafe(method_family = none)]
64        pub fn setBadgeLabel(&self, badge_label: Option<&NSString>);
65
66        #[unsafe(method(owner))]
67        #[unsafe(method_family = none)]
68        pub fn owner(&self) -> Option<Retained<AnyObject>>;
69    );
70}
71
72/// Methods declared on superclass `NSObject`.
73impl NSDockTile {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        #[unsafe(method(new))]
80        #[unsafe(method_family = new)]
81        pub fn new() -> Retained<Self>;
82    );
83}
84
85impl DefaultRetained for NSDockTile {
86    #[inline]
87    fn default_retained() -> Retained<Self> {
88        Self::new()
89    }
90}
91
92extern_protocol!(
93    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsdocktileplugin?language=objc)
94    pub unsafe trait NSDockTilePlugIn: NSObjectProtocol {
95        #[unsafe(method(setDockTile:))]
96        #[unsafe(method_family = none)]
97        fn setDockTile(&self, dock_tile: Option<&NSDockTile>);
98
99        #[cfg(feature = "NSMenu")]
100        #[optional]
101        #[unsafe(method(dockMenu))]
102        #[unsafe(method_family = none)]
103        fn dockMenu(&self, mtm: MainThreadMarker) -> Option<Retained<NSMenu>>;
104    }
105);