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