objc2_app_kit/generated/
NSTrackingSeparatorToolbarItem.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/nstrackingseparatortoolbaritem?language=objc)
12    #[unsafe(super(NSToolbarItem, NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    #[cfg(feature = "NSToolbarItem")]
15    pub struct NSTrackingSeparatorToolbarItem;
16);
17
18#[cfg(feature = "NSToolbarItem")]
19unsafe impl NSCopying for NSTrackingSeparatorToolbarItem {}
20
21#[cfg(feature = "NSToolbarItem")]
22unsafe impl CopyingHelper for NSTrackingSeparatorToolbarItem {
23    type Result = Self;
24}
25
26#[cfg(feature = "NSToolbarItem")]
27unsafe impl NSObjectProtocol for NSTrackingSeparatorToolbarItem {}
28
29#[cfg(feature = "NSToolbarItem")]
30impl NSTrackingSeparatorToolbarItem {
31    extern_methods!(
32        #[cfg(all(
33            feature = "NSResponder",
34            feature = "NSSplitView",
35            feature = "NSToolbar",
36            feature = "NSView"
37        ))]
38        /// Creates a new `NSTrackingSeparatorToolbarItem` and configures it to attempt to visually align with the specified divider of the `splitView`.
39        /// The `splitView` must be in the same window as the toolbar containing this item by the time the toolbar is shown.
40        /// Only vertical `splitViews` are supported.
41        #[unsafe(method(trackingSeparatorToolbarItemWithIdentifier:splitView:dividerIndex:))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn trackingSeparatorToolbarItemWithIdentifier_splitView_dividerIndex(
44            identifier: &NSToolbarItemIdentifier,
45            split_view: &NSSplitView,
46            divider_index: NSInteger,
47        ) -> Retained<Self>;
48
49        #[cfg(all(feature = "NSResponder", feature = "NSSplitView", feature = "NSView"))]
50        /// The `splitView` must be in the same window as the toolbar containing this item by the time the toolbar is shown.
51        /// Only vertical `splitViews` are supported.
52        #[unsafe(method(splitView))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn splitView(&self) -> Retained<NSSplitView>;
55
56        #[cfg(all(feature = "NSResponder", feature = "NSSplitView", feature = "NSView"))]
57        /// Setter for [`splitView`][Self::splitView].
58        #[unsafe(method(setSplitView:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setSplitView(&self, split_view: &NSSplitView);
61
62        /// The specific divider of the `splitView` which will be tracked.
63        #[unsafe(method(dividerIndex))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn dividerIndex(&self) -> NSInteger;
66
67        /// Setter for [`dividerIndex`][Self::dividerIndex].
68        #[unsafe(method(setDividerIndex:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setDividerIndex(&self, divider_index: NSInteger);
71    );
72}
73
74/// Methods declared on superclass `NSToolbarItem`.
75#[cfg(feature = "NSToolbarItem")]
76impl NSTrackingSeparatorToolbarItem {
77    extern_methods!(
78        #[cfg(feature = "NSToolbar")]
79        /// Initialize the toolbar item with an identifier which is a development language string used by the toolbar and its delegate for identification purposes.
80        #[unsafe(method(initWithItemIdentifier:))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn initWithItemIdentifier(
83            this: Allocated<Self>,
84            item_identifier: &NSToolbarItemIdentifier,
85        ) -> Retained<Self>;
86    );
87}
88
89/// Methods declared on superclass `NSObject`.
90#[cfg(feature = "NSToolbarItem")]
91impl NSTrackingSeparatorToolbarItem {
92    extern_methods!(
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96
97        #[unsafe(method(new))]
98        #[unsafe(method_family = new)]
99        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
100    );
101}