objc2_app_kit/generated/
NSMenuToolbarItem.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
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmenutoolbaritem?language=objc)
12    #[unsafe(super(NSToolbarItem, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSToolbarItem")]
15    pub struct NSMenuToolbarItem;
16);
17
18#[cfg(feature = "NSToolbarItem")]
19extern_conformance!(
20    unsafe impl NSCopying for NSMenuToolbarItem {}
21);
22
23#[cfg(feature = "NSToolbarItem")]
24unsafe impl CopyingHelper for NSMenuToolbarItem {
25    type Result = Self;
26}
27
28#[cfg(feature = "NSToolbarItem")]
29extern_conformance!(
30    unsafe impl NSObjectProtocol for NSMenuToolbarItem {}
31);
32
33#[cfg(feature = "NSToolbarItem")]
34impl NSMenuToolbarItem {
35    extern_methods!(
36        #[cfg(feature = "NSMenu")]
37        #[unsafe(method(menu))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn menu(&self) -> Retained<NSMenu>;
40
41        #[cfg(feature = "NSMenu")]
42        /// Setter for [`menu`][Self::menu].
43        #[unsafe(method(setMenu:))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn setMenu(&self, menu: &NSMenu);
46
47        #[unsafe(method(showsIndicator))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn showsIndicator(&self) -> bool;
50
51        /// Setter for [`showsIndicator`][Self::showsIndicator].
52        #[unsafe(method(setShowsIndicator:))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn setShowsIndicator(&self, shows_indicator: bool);
55    );
56}
57
58/// Methods declared on superclass `NSToolbarItem`.
59#[cfg(feature = "NSToolbarItem")]
60impl NSMenuToolbarItem {
61    extern_methods!(
62        #[cfg(feature = "NSToolbar")]
63        /// Initialize the toolbar item with an identifier which is a development language string used by the toolbar and its delegate for identification purposes.
64        #[unsafe(method(initWithItemIdentifier:))]
65        #[unsafe(method_family = init)]
66        pub unsafe fn initWithItemIdentifier(
67            this: Allocated<Self>,
68            item_identifier: &NSToolbarItemIdentifier,
69        ) -> Retained<Self>;
70    );
71}
72
73/// Methods declared on superclass `NSObject`.
74#[cfg(feature = "NSToolbarItem")]
75impl NSMenuToolbarItem {
76    extern_methods!(
77        #[unsafe(method(init))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81        #[unsafe(method(new))]
82        #[unsafe(method_family = new)]
83        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
84    );
85}