icrate/generated/AppKit/
NSToolbarItemGroup.rs1use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8ns_enum!(
9 #[underlying(NSInteger)]
10 pub enum NSToolbarItemGroupSelectionMode {
11 NSToolbarItemGroupSelectionModeSelectOne = 0,
12 NSToolbarItemGroupSelectionModeSelectAny = 1,
13 NSToolbarItemGroupSelectionModeMomentary = 2,
14 }
15);
16
17ns_enum!(
18 #[underlying(NSInteger)]
19 pub enum NSToolbarItemGroupControlRepresentation {
20 NSToolbarItemGroupControlRepresentationAutomatic = 0,
21 NSToolbarItemGroupControlRepresentationExpanded = 1,
22 NSToolbarItemGroupControlRepresentationCollapsed = 2,
23 }
24);
25
26extern_class!(
27 #[derive(Debug, PartialEq, Eq, Hash)]
28 #[cfg(feature = "AppKit_NSToolbarItemGroup")]
29 pub struct NSToolbarItemGroup;
30
31 #[cfg(feature = "AppKit_NSToolbarItemGroup")]
32 unsafe impl ClassType for NSToolbarItemGroup {
33 #[inherits(NSObject)]
34 type Super = NSToolbarItem;
35 type Mutability = MainThreadOnly;
36 }
37);
38
39#[cfg(feature = "AppKit_NSToolbarItemGroup")]
40unsafe impl NSCopying for NSToolbarItemGroup {}
41
42#[cfg(feature = "AppKit_NSToolbarItemGroup")]
43unsafe impl NSObjectProtocol for NSToolbarItemGroup {}
44
45extern_methods!(
46 #[cfg(feature = "AppKit_NSToolbarItemGroup")]
47 unsafe impl NSToolbarItemGroup {
48 #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
49 #[method_id(@__retain_semantics Other groupWithItemIdentifier:titles:selectionMode:labels:target:action:)]
50 pub unsafe fn groupWithItemIdentifier_titles_selectionMode_labels_target_action(
51 item_identifier: &NSToolbarItemIdentifier,
52 titles: &NSArray<NSString>,
53 selection_mode: NSToolbarItemGroupSelectionMode,
54 labels: Option<&NSArray<NSString>>,
55 target: Option<&AnyObject>,
56 action: Option<Sel>,
57 mtm: MainThreadMarker,
58 ) -> Id<Self>;
59
60 #[cfg(all(
61 feature = "AppKit_NSImage",
62 feature = "Foundation_NSArray",
63 feature = "Foundation_NSString"
64 ))]
65 #[method_id(@__retain_semantics Other groupWithItemIdentifier:images:selectionMode:labels:target:action:)]
66 pub unsafe fn groupWithItemIdentifier_images_selectionMode_labels_target_action(
67 item_identifier: &NSToolbarItemIdentifier,
68 images: &NSArray<NSImage>,
69 selection_mode: NSToolbarItemGroupSelectionMode,
70 labels: Option<&NSArray<NSString>>,
71 target: Option<&AnyObject>,
72 action: Option<Sel>,
73 mtm: MainThreadMarker,
74 ) -> Id<Self>;
75
76 #[cfg(feature = "Foundation_NSArray")]
77 #[method_id(@__retain_semantics Other subitems)]
78 pub unsafe fn subitems(&self) -> Id<NSArray<NSToolbarItem>>;
79
80 #[cfg(feature = "Foundation_NSArray")]
81 #[method(setSubitems:)]
82 pub unsafe fn setSubitems(&self, subitems: &NSArray<NSToolbarItem>);
83
84 #[method(controlRepresentation)]
85 pub unsafe fn controlRepresentation(&self) -> NSToolbarItemGroupControlRepresentation;
86
87 #[method(setControlRepresentation:)]
88 pub unsafe fn setControlRepresentation(
89 &self,
90 control_representation: NSToolbarItemGroupControlRepresentation,
91 );
92
93 #[method(selectionMode)]
94 pub unsafe fn selectionMode(&self) -> NSToolbarItemGroupSelectionMode;
95
96 #[method(setSelectionMode:)]
97 pub unsafe fn setSelectionMode(&self, selection_mode: NSToolbarItemGroupSelectionMode);
98
99 #[method(selectedIndex)]
100 pub unsafe fn selectedIndex(&self) -> NSInteger;
101
102 #[method(setSelectedIndex:)]
103 pub unsafe fn setSelectedIndex(&self, selected_index: NSInteger);
104
105 #[method(setSelected:atIndex:)]
106 pub unsafe fn setSelected_atIndex(&self, selected: bool, index: NSInteger);
107
108 #[method(isSelectedAtIndex:)]
109 pub unsafe fn isSelectedAtIndex(&self, index: NSInteger) -> bool;
110 }
111);
112
113extern_methods!(
114 #[cfg(feature = "AppKit_NSToolbarItemGroup")]
116 unsafe impl NSToolbarItemGroup {
117 #[method_id(@__retain_semantics Init initWithItemIdentifier:)]
118 pub unsafe fn initWithItemIdentifier(
119 this: Allocated<Self>,
120 item_identifier: &NSToolbarItemIdentifier,
121 ) -> Id<Self>;
122 }
123);
124
125extern_methods!(
126 #[cfg(feature = "AppKit_NSToolbarItemGroup")]
128 unsafe impl NSToolbarItemGroup {
129 #[method_id(@__retain_semantics Init init)]
130 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
131
132 #[method_id(@__retain_semantics New new)]
133 pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
134 }
135);