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