objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
//! 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::*;
#[cfg(feature = "objc2-cloud-kit")]
#[cfg(target_vendor = "apple")]
use objc2_cloud_kit::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbaritemstyle?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSToolbarItemStyle(pub NSInteger);
impl NSToolbarItemStyle {
    #[doc(alias = "NSToolbarItemStylePlain")]
    pub const Plain: Self = Self(0);
    #[doc(alias = "NSToolbarItemStyleProminent")]
    pub const Prominent: Self = Self(1);
}

unsafe impl Encode for NSToolbarItemStyle {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for NSToolbarItemStyle {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbaritemvisibilitypriority?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSToolbarItemVisibilityPriority = NSInteger;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbaritemvisibilityprioritystandard?language=objc)
pub static NSToolbarItemVisibilityPriorityStandard: NSToolbarItemVisibilityPriority = 0;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbaritemvisibilityprioritylow?language=objc)
pub static NSToolbarItemVisibilityPriorityLow: NSToolbarItemVisibilityPriority = -1000;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbaritemvisibilitypriorityhigh?language=objc)
pub static NSToolbarItemVisibilityPriorityHigh: NSToolbarItemVisibilityPriority = 1000;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbaritemvisibilitypriorityuser?language=objc)
pub static NSToolbarItemVisibilityPriorityUser: NSToolbarItemVisibilityPriority = 2000;

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

extern_conformance!(
    unsafe impl NSCopying for NSToolbarItem {}
);

unsafe impl CopyingHelper for NSToolbarItem {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSToolbarItem {}
);

impl NSToolbarItem {
    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>;

        #[cfg(feature = "NSToolbar")]
        #[unsafe(method(itemIdentifier))]
        #[unsafe(method_family = none)]
        pub fn itemIdentifier(&self) -> Retained<NSToolbarItemIdentifier>;

        #[cfg(feature = "NSToolbar")]
        /// Use this to determine the toolbar in which an item is currently displayed.
        #[unsafe(method(toolbar))]
        #[unsafe(method_family = none)]
        pub fn toolbar(&self) -> Option<Retained<NSToolbar>>;

        /// Use this to set the item's label that appears in the toolbar.
        /// The label may also be used for the default `menuFormRepresentation` of the item.
        /// Also, developers should make sure the length of the label is appropriate and not too long.
        #[unsafe(method(label))]
        #[unsafe(method_family = none)]
        pub fn label(&self) -> Retained<NSString>;

        /// Setter for [`label`][Self::label].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setLabel:))]
        #[unsafe(method_family = none)]
        pub fn setLabel(&self, label: &NSString);

        /// Use this to set the item's label that appears when the item is in the customization palette.
        /// All Items must have a palette label, and for most things it is reasonable to set them to the same string as the label used in the toolbar.
        #[unsafe(method(paletteLabel))]
        #[unsafe(method_family = none)]
        pub fn paletteLabel(&self) -> Retained<NSString>;

        /// Setter for [`paletteLabel`][Self::paletteLabel].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPaletteLabel:))]
        #[unsafe(method_family = none)]
        pub fn setPaletteLabel(&self, palette_label: &NSString);

        /// An array of all alternate labels this item may display.
        /// The item will use the size of the longest label to prevent resizing when the label is changed.
        #[unsafe(method(possibleLabels))]
        #[unsafe(method_family = none)]
        pub fn possibleLabels(&self) -> Retained<NSSet<NSString>>;

        /// Setter for [`possibleLabels`][Self::possibleLabels].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setPossibleLabels:))]
        #[unsafe(method_family = none)]
        pub fn setPossibleLabels(&self, possible_labels: &NSSet<NSString>);

        /// Use this to set a tooltip to be used when the item is displayed in the toolbar. (forwards to `-view` if it responds)
        #[unsafe(method(toolTip))]
        #[unsafe(method_family = none)]
        pub fn toolTip(&self) -> Option<Retained<NSString>>;

        /// Setter for [`toolTip`][Self::toolTip].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setToolTip:))]
        #[unsafe(method_family = none)]
        pub fn setToolTip(&self, tool_tip: Option<&NSString>);

        #[cfg(feature = "NSMenuItem")]
        /// The menu form of a toolbar item's purpose is twofold.
        /// First, when the window is too small to display an item, it will be clipped but remain accessible from a "clipped items" menu containing the menu item returned here.
        /// Second, in text only mode, the menu returned will be used to create the displayed items.
        /// Singleton menu items will be clickable, while submenu items will be represented as a pull down.
        /// For instance, say you want a button that allows you to switch between modes A, B, and C.
        /// You could represent this as a menu by: a menu item "mode" with three submenu items "A", "B", and "C".
        /// By default, this method returns a singleton menu item with item label as the title.
        /// For standard items, the target, action is set.
        #[unsafe(method(menuFormRepresentation))]
        #[unsafe(method_family = none)]
        pub fn menuFormRepresentation(&self) -> Option<Retained<NSMenuItem>>;

        #[cfg(feature = "NSMenuItem")]
        /// Setter for [`menuFormRepresentation`][Self::menuFormRepresentation].
        #[unsafe(method(setMenuFormRepresentation:))]
        #[unsafe(method_family = none)]
        pub fn setMenuFormRepresentation(&self, menu_form_representation: Option<&NSMenuItem>);

        /// Tag for your own custom purpose. (forwards to `-view` if it responds)
        #[unsafe(method(tag))]
        #[unsafe(method_family = none)]
        pub fn tag(&self) -> NSInteger;

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

        /// Set and get the action of an item. (forwards to `-view` if it responds)
        #[unsafe(method(target))]
        #[unsafe(method_family = none)]
        pub fn target(&self) -> Option<Retained<AnyObject>>;

        /// Setter for [`target`][Self::target].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        ///
        /// # Safety
        ///
        /// `target` should be of the correct type.
        #[unsafe(method(setTarget:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTarget(&self, target: Option<&AnyObject>);

        /// Set and get the action of an item.
        /// For custom views, this method will call `-setAction:` on the view if it responds. (forwards to `-view` if it responds)
        #[unsafe(method(action))]
        #[unsafe(method_family = none)]
        pub fn action(&self) -> Option<Sel>;

        /// Setter for [`action`][Self::action].
        ///
        /// # Safety
        ///
        /// `action` must be a valid selector.
        #[unsafe(method(setAction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setAction(&self, action: Option<Sel>);

        /// Set and get the enabled flag of an item.
        /// For custom views, this method will call `-setEnabled:` on the view if it responds. (forwards to `-view` if it responds)
        #[unsafe(method(isEnabled))]
        #[unsafe(method_family = none)]
        pub fn isEnabled(&self) -> bool;

        /// Setter for [`isEnabled`][Self::isEnabled].
        #[unsafe(method(setEnabled:))]
        #[unsafe(method_family = none)]
        pub fn setEnabled(&self, enabled: bool);

        #[cfg(feature = "NSImage")]
        #[unsafe(method(image))]
        #[unsafe(method_family = none)]
        pub fn image(&self) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        /// Setter for [`image`][Self::image].
        #[unsafe(method(setImage:))]
        #[unsafe(method_family = none)]
        pub fn setImage(&self, image: Option<&NSImage>);

        /// Set and get the title of an item.
        /// For custom views, this method will call `-setTitle:` on the view if it responds. (forwards to `-view` if it responds)
        #[unsafe(method(title))]
        #[unsafe(method_family = none)]
        pub fn title(&self) -> Retained<NSString>;

        /// Setter for [`title`][Self::title].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTitle:))]
        #[unsafe(method_family = none)]
        pub fn setTitle(&self, title: &NSString);

        /// When set on an item without a custom view, the button produced will have a bordered style.
        /// Defaults to NO.
        #[unsafe(method(isBordered))]
        #[unsafe(method_family = none)]
        pub fn isBordered(&self) -> bool;

        /// Setter for [`isBordered`][Self::isBordered].
        #[unsafe(method(setBordered:))]
        #[unsafe(method_family = none)]
        pub fn setBordered(&self, bordered: bool);

        #[cfg(feature = "NSColor")]
        #[unsafe(method(backgroundTintColor))]
        #[unsafe(method_family = none)]
        pub fn backgroundTintColor(&self) -> Option<Retained<NSColor>>;

        #[cfg(feature = "NSColor")]
        /// Setter for [`backgroundTintColor`][Self::backgroundTintColor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBackgroundTintColor:))]
        #[unsafe(method_family = none)]
        pub fn setBackgroundTintColor(&self, background_tint_color: Option<&NSColor>);

        /// Defines the toolbar item’s appearance. The default style is plain.
        /// Prominent style tints the background. If a background tint color is set, it uses it; otherwise, it uses the app’s or system’s accent color. If grouped with other items,
        /// it moves to its own to avoid tinting other items' background.
        #[unsafe(method(style))]
        #[unsafe(method_family = none)]
        pub fn style(&self) -> NSToolbarItemStyle;

        /// Setter for [`style`][Self::style].
        #[unsafe(method(setStyle:))]
        #[unsafe(method_family = none)]
        pub fn setStyle(&self, style: NSToolbarItemStyle);

        /// Whether or not the item behaves as a navigation item (i.e. back/forward) in the toolbar.
        /// Navigation items may be specially positioned by the system outside the normal list of items of the toolbar in the order specified by `-toolbarDefaultItemIdentifiers:`.
        /// Defaults to NO.
        #[unsafe(method(isNavigational))]
        #[unsafe(method_family = none)]
        pub fn isNavigational(&self) -> bool;

        /// Setter for [`isNavigational`][Self::isNavigational].
        #[unsafe(method(setNavigational:))]
        #[unsafe(method_family = none)]
        pub fn setNavigational(&self, navigational: bool);

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        /// Items with automatically generated views will return nil from this getter.
        /// Custom views may be provided but not all `NSToolbarItem` subclasses support custom views.
        /// Note that, by default, many of the set/get methods will be implemented by calls forwarded to the view you set, if it responds to it.
        #[unsafe(method(view))]
        #[unsafe(method_family = none)]
        pub fn view(&self) -> Option<Retained<NSView>>;

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        /// Setter for [`view`][Self::view].
        #[unsafe(method(setView:))]
        #[unsafe(method_family = none)]
        pub fn setView(&self, view: Option<&NSView>);

        /// An item is visible if it is present in the NSToolbar and not in the overflow menu.
        /// This property is key value observable.
        #[unsafe(method(isVisible))]
        #[unsafe(method_family = none)]
        pub fn isVisible(&self) -> bool;

        /// When an item is hidden it will not be visible in the toolbar. The item will still be visible in the customization panel. Because hidden items may be visible during user customization, use the `visible` property to determine if an item is currently displayed. Note that even hidden toolbar items are sync'd to other toolbars with a shared identifier, but its `hidden` state can be unique to each instance. Use this property to show a toolbar item in one toolbar instance but not another.
        #[unsafe(method(isHidden))]
        #[unsafe(method_family = none)]
        pub fn isHidden(&self) -> bool;

        /// Setter for [`isHidden`][Self::isHidden].
        #[unsafe(method(setHidden:))]
        #[unsafe(method_family = none)]
        pub fn setHidden(&self, hidden: bool);

        /// Unless you have already set your own custom view, you should not call these methods.
        /// The min size should be small enough to look nice in all display modes.
        /// If you do not set a min/max size, the view's size properties will be calculated using constraints. Apps linked before 10.14 will use the view's current size.
        /// In general, apps should rely on the automatic measurements and constraints to define min/max sizes rather than setting these properties since this will account for localizations.
        #[deprecated = "This property is no longer recommended. Instead, let the system automatically measure the size of the view using constraints."]
        #[unsafe(method(minSize))]
        #[unsafe(method_family = none)]
        pub fn minSize(&self) -> NSSize;

        /// Setter for [`minSize`][Self::minSize].
        #[deprecated = "This property is no longer recommended. Instead, let the system automatically measure the size of the view using constraints."]
        #[unsafe(method(setMinSize:))]
        #[unsafe(method_family = none)]
        pub fn setMinSize(&self, min_size: NSSize);

        #[deprecated = "This property is no longer recommended. Instead, let the system automatically measure the size of the view using constraints."]
        #[unsafe(method(maxSize))]
        #[unsafe(method_family = none)]
        pub fn maxSize(&self) -> NSSize;

        /// Setter for [`maxSize`][Self::maxSize].
        #[deprecated = "This property is no longer recommended. Instead, let the system automatically measure the size of the view using constraints."]
        #[unsafe(method(setMaxSize:))]
        #[unsafe(method_family = none)]
        pub fn setMaxSize(&self, max_size: NSSize);

        /// When a toolbar does not have enough space to fit all its items, it must push some into the overflow menu.
        /// Items with the highest `visibilityPriority` level are chosen last for the overflow menu.
        /// The default `visibilityPriority` value is `NSToolbarItemVisibilityPriorityStandard`.
        /// To suggest that an item always remain visible, give it a value greater than `NSToolbarItemVisibilityPriorityStandard`, but less than `NSToolbarItemVisibilityPriorityUser`.
        /// In 10.7, users can no longer modify the toolbar item visibility priority.
        #[unsafe(method(visibilityPriority))]
        #[unsafe(method_family = none)]
        pub fn visibilityPriority(&self) -> NSToolbarItemVisibilityPriority;

        /// Setter for [`visibilityPriority`][Self::visibilityPriority].
        #[unsafe(method(setVisibilityPriority:))]
        #[unsafe(method_family = none)]
        pub fn setVisibilityPriority(&self, visibility_priority: NSToolbarItemVisibilityPriority);

        #[cfg(feature = "NSItemBadge")]
        /// A badge that can be attached to an NSToolbarItem. This provides a way to display small visual indicators that can be used to highlight important information, such as unread notifications or status indicators.
        #[unsafe(method(badge))]
        #[unsafe(method_family = none)]
        pub fn badge(&self) -> Option<Retained<NSItemBadge>>;

        #[cfg(feature = "NSItemBadge")]
        /// Setter for [`badge`][Self::badge].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBadge:))]
        #[unsafe(method_family = none)]
        pub fn setBadge(&self, badge: Option<&NSItemBadge>);

        /// Typically you should not invoke this method.
        /// This method is called by its toolbar during validation.
        /// Standard items validate themselves by sending the `-validateToolbarItem:` validate message to the current validator.
        /// Since items with custom views don't always have meaningful target/actions, they do nothing.
        /// So for your custom items it may be useful to override this method and invent your own validation.
        #[unsafe(method(validate))]
        #[unsafe(method_family = none)]
        pub fn validate(&self);

        /// This property only affects automatic validation performed by NSToolbar.
        /// Explicit validation requests, such as the `-[NSToolbar validateVisibleItems]` method, will invoke the `-validate` method even if `autovalidates` is `NO`.
        /// Defaults to YES.
        #[unsafe(method(autovalidates))]
        #[unsafe(method_family = none)]
        pub fn autovalidates(&self) -> bool;

        /// Setter for [`autovalidates`][Self::autovalidates].
        #[unsafe(method(setAutovalidates:))]
        #[unsafe(method_family = none)]
        pub fn setAutovalidates(&self, autovalidates: bool);

        /// Duplicate items outside of spaces are not allowed.
        #[deprecated = "Duplicates are no longer supported."]
        #[unsafe(method(allowsDuplicatesInToolbar))]
        #[unsafe(method_family = none)]
        pub fn allowsDuplicatesInToolbar(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSToolbarItem {
    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>;
    );
}

impl NSToolbarItem {
    extern_methods!();
}

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

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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbaritemvalidation?language=objc)
    pub unsafe trait NSToolbarItemValidation: NSObjectProtocol + MainThreadOnly {
        /// `NSToolbarItemValidation` extends the standard validation idea by introducing this new method which is sent to validators for each visible standard `NSToolbarItem` with a valid target/action pair.
        /// Note: This message is sent from NSToolbarItem's validate method, however validate will not send this message for items that have custom views.
        #[unsafe(method(validateToolbarItem:))]
        #[unsafe(method_family = none)]
        fn validateToolbarItem(&self, item: &NSToolbarItem) -> bool;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscloudsharingvalidation?language=objc)
    pub unsafe trait NSCloudSharingValidation: NSObjectProtocol + MainThreadOnly {
        #[cfg(all(feature = "NSUserInterfaceValidation", feature = "objc2-cloud-kit"))]
        #[cfg(target_vendor = "apple")]
        /// `NSToolbarItems` created with `NSToolbarCloudSharingItemIdentifier` use this method for further validation after sending `-validateToolbarItem:` or `-validateUserInterfaceItem:`.
        /// The validator for the item's action should return the current CKShare corresponding to the selected item, if any.
        /// The state of the item will be changed reflect the state of the CKShare.
        #[unsafe(method(cloudShareForUserInterfaceItem:))]
        #[unsafe(method_family = none)]
        fn cloudShareForUserInterfaceItem(
            &self,
            item: &ProtocolObject<dyn NSValidatedUserInterfaceItem>,
        ) -> Option<Retained<CKShare>>;
    }
);

extern "C" {
    /// A space item of a standard fixed size.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarspaceitemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarSpaceItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A space item of flexible width.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarflexiblespaceitemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarFlexibleSpaceItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A standard item that is configured to show the color panel when invoked.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarshowcolorsitemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarShowColorsItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A standard item that is configured to show the font panel when invoked.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarshowfontsitemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarShowFontsItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A standard item that is configured to send -printDocument: to the firstResponder when invoked
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarprintitemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarPrintItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A standard item that is configured to send -toggleSidebar: to the firstResponder when invoked.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbartogglesidebaritemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarToggleSidebarItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A standard item that is configured to send -toggleInspector: to the firstResponder when invoked.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbartoggleinspectoritemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarToggleInspectorItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A standard item for cloud sharing via NSSharingServiceNameCloudSharing. It validates itself and modifies its appearance by using the NSCloudSharingValidation protocol. It sends -performCloudSharing: to the firstResponder.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarcloudsharingitemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarCloudSharingItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// A standard item that is configured to send -showWritingTools: to the firstResponder when invoked.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarwritingtoolsitemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarWritingToolsItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// Creates a new NSTrackingSeparatorToolbarItem and automatically configures it to track the divider of the sidebar if one is discovered.
    /// Only applies to windows with `NSWindowStyleMaskFullSizeContentView` applied.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarsidebartrackingseparatoritemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarSidebarTrackingSeparatorItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// Creates a new NSTrackingSeparatorToolbarItem and automatically configures it to track the divider of the inspector if one is discovered.
    /// Only applies to windows with `NSWindowStyleMaskFullSizeContentView` applied.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarinspectortrackingseparatoritemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    pub static NSToolbarInspectorTrackingSeparatorItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// Deprecated Item Identifiers
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarseparatoritemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    #[deprecated = "This item is no longer recommended and will be ignored on 10.7 and later."]
    pub static NSToolbarSeparatorItemIdentifier: &'static NSToolbarItemIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstoolbarcustomizetoolbaritemidentifier?language=objc)
    #[cfg(feature = "NSToolbar")]
    #[deprecated = "This item is no longer recommended and will be ignored on 10.7 and later."]
    pub static NSToolbarCustomizeToolbarItemIdentifier: &'static NSToolbarItemIdentifier;
}