objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstrackingseparatortoolbaritem?language=objc)
    #[unsafe(super(NSToolbarItem, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSToolbarItem")]
    pub struct NSTrackingSeparatorToolbarItem;
);

#[cfg(feature = "NSToolbarItem")]
extern_conformance!(
    unsafe impl NSCopying for NSTrackingSeparatorToolbarItem {}
);

#[cfg(feature = "NSToolbarItem")]
unsafe impl CopyingHelper for NSTrackingSeparatorToolbarItem {
    type Result = Self;
}

#[cfg(feature = "NSToolbarItem")]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSTrackingSeparatorToolbarItem {}
);

#[cfg(feature = "NSToolbarItem")]
impl NSTrackingSeparatorToolbarItem {
    extern_methods!(
        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitView",
            feature = "NSToolbar",
            feature = "NSView"
        ))]
        /// Creates a new `NSTrackingSeparatorToolbarItem` and configures it to attempt to visually align with the specified divider of the `splitView`.
        /// The `splitView` must be in the same window as the toolbar containing this item by the time the toolbar is shown.
        /// Only vertical `splitViews` are supported.
        #[unsafe(method(trackingSeparatorToolbarItemWithIdentifier:splitView:dividerIndex:))]
        #[unsafe(method_family = none)]
        pub fn trackingSeparatorToolbarItemWithIdentifier_splitView_dividerIndex(
            identifier: &NSToolbarItemIdentifier,
            split_view: &NSSplitView,
            divider_index: NSInteger,
        ) -> Retained<Self>;

        #[cfg(all(feature = "NSResponder", feature = "NSSplitView", feature = "NSView"))]
        /// The `splitView` must be in the same window as the toolbar containing this item by the time the toolbar is shown.
        /// Only vertical `splitViews` are supported.
        #[unsafe(method(splitView))]
        #[unsafe(method_family = none)]
        pub fn splitView(&self) -> Retained<NSSplitView>;

        #[cfg(all(feature = "NSResponder", feature = "NSSplitView", feature = "NSView"))]
        /// Setter for [`splitView`][Self::splitView].
        #[unsafe(method(setSplitView:))]
        #[unsafe(method_family = none)]
        pub fn setSplitView(&self, split_view: &NSSplitView);

        /// The specific divider of the `splitView` which will be tracked.
        #[unsafe(method(dividerIndex))]
        #[unsafe(method_family = none)]
        pub fn dividerIndex(&self) -> NSInteger;

        /// Setter for [`dividerIndex`][Self::dividerIndex].
        #[unsafe(method(setDividerIndex:))]
        #[unsafe(method_family = none)]
        pub fn setDividerIndex(&self, divider_index: NSInteger);
    );
}

/// Methods declared on superclass `NSToolbarItem`.
#[cfg(feature = "NSToolbarItem")]
impl NSTrackingSeparatorToolbarItem {
    extern_methods!(
        #[cfg(feature = "NSToolbar")]
        /// Initialize the toolbar item with an identifier which is a development language string used by the toolbar and its delegate for identification purposes.
        #[unsafe(method(initWithItemIdentifier:))]
        #[unsafe(method_family = init)]
        pub fn initWithItemIdentifier(
            this: Allocated<Self>,
            item_identifier: &NSToolbarItemIdentifier,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "NSToolbarItem")]
impl NSTrackingSeparatorToolbarItem {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}