icrate 0.0.1

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::CoreData::*;
use crate::Foundation::*;

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSToolbarItemGroupSelectionMode {
        NSToolbarItemGroupSelectionModeSelectOne = 0,
        NSToolbarItemGroupSelectionModeSelectAny = 1,
        NSToolbarItemGroupSelectionModeMomentary = 2,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSToolbarItemGroupControlRepresentation {
        NSToolbarItemGroupControlRepresentationAutomatic = 0,
        NSToolbarItemGroupControlRepresentationExpanded = 1,
        NSToolbarItemGroupControlRepresentationCollapsed = 2,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSToolbarItemGroup;

    unsafe impl ClassType for NSToolbarItemGroup {
        #[inherits(NSObject)]
        type Super = NSToolbarItem;
    }
);

extern_methods!(
    unsafe impl NSToolbarItemGroup {
        #[method_id(@__retain_semantics Other groupWithItemIdentifier:titles:selectionMode:labels:target:action:)]
        pub unsafe fn groupWithItemIdentifier_titles_selectionMode_labels_target_action(
            itemIdentifier: &NSToolbarItemIdentifier,
            titles: &NSArray<NSString>,
            selectionMode: NSToolbarItemGroupSelectionMode,
            labels: Option<&NSArray<NSString>>,
            target: Option<&Object>,
            action: Option<Sel>,
        ) -> Id<Self, Shared>;

        #[method_id(@__retain_semantics Other groupWithItemIdentifier:images:selectionMode:labels:target:action:)]
        pub unsafe fn groupWithItemIdentifier_images_selectionMode_labels_target_action(
            itemIdentifier: &NSToolbarItemIdentifier,
            images: &NSArray<NSImage>,
            selectionMode: NSToolbarItemGroupSelectionMode,
            labels: Option<&NSArray<NSString>>,
            target: Option<&Object>,
            action: Option<Sel>,
        ) -> Id<Self, Shared>;

        #[method_id(@__retain_semantics Other subitems)]
        pub unsafe fn subitems(&self) -> Id<NSArray<NSToolbarItem>, Shared>;

        #[method(setSubitems:)]
        pub unsafe fn setSubitems(&self, subitems: &NSArray<NSToolbarItem>);

        #[method(controlRepresentation)]
        pub unsafe fn controlRepresentation(&self) -> NSToolbarItemGroupControlRepresentation;

        #[method(setControlRepresentation:)]
        pub unsafe fn setControlRepresentation(
            &self,
            controlRepresentation: NSToolbarItemGroupControlRepresentation,
        );

        #[method(selectionMode)]
        pub unsafe fn selectionMode(&self) -> NSToolbarItemGroupSelectionMode;

        #[method(setSelectionMode:)]
        pub unsafe fn setSelectionMode(&self, selectionMode: NSToolbarItemGroupSelectionMode);

        #[method(selectedIndex)]
        pub unsafe fn selectedIndex(&self) -> NSInteger;

        #[method(setSelectedIndex:)]
        pub unsafe fn setSelectedIndex(&self, selectedIndex: NSInteger);

        #[method(setSelected:atIndex:)]
        pub unsafe fn setSelected_atIndex(&self, selected: bool, index: NSInteger);

        #[method(isSelectedAtIndex:)]
        pub unsafe fn isSelectedAtIndex(&self, index: NSInteger) -> bool;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSToolbarItem`
    unsafe impl NSToolbarItemGroup {
        #[method_id(@__retain_semantics Init initWithItemIdentifier:)]
        pub unsafe fn initWithItemIdentifier(
            this: Option<Allocated<Self>>,
            itemIdentifier: &NSToolbarItemIdentifier,
        ) -> Id<Self, Shared>;
    }
);