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
//! 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-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssplitviewitembehavior?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSSplitViewItemBehavior(pub NSInteger);
impl NSSplitViewItemBehavior {
    #[doc(alias = "NSSplitViewItemBehaviorDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "NSSplitViewItemBehaviorSidebar")]
    pub const Sidebar: Self = Self(1);
    #[doc(alias = "NSSplitViewItemBehaviorContentList")]
    pub const ContentList: Self = Self(2);
    #[doc(alias = "NSSplitViewItemBehaviorInspector")]
    pub const Inspector: Self = Self(3);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssplitviewitemcollapsebehavior?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSSplitViewItemCollapseBehavior(pub NSInteger);
impl NSSplitViewItemCollapseBehavior {
    /// The item uses the default collapsing behavior for its set `behavior`. The default may change over time.
    #[doc(alias = "NSSplitViewItemCollapseBehaviorDefault")]
    pub const Default: Self = Self(0);
    /// The item prefers to keep the other panes at their current size and position on screen, potentially growing or shrinking the window in the direction to best preserve that. But it will break that preference in order to keep the window fully on screen or when in full screen.
    #[doc(alias = "NSSplitViewItemCollapseBehaviorPreferResizingSplitViewWithFixedSiblings")]
    pub const PreferResizingSplitViewWithFixedSiblings: Self = Self(1);
    /// The item prefers to resize the other split panes. This will be broken when uncollapsing if the item can't fully uncollapse before hitting the minimum size of the other panes or the window.
    #[doc(alias = "NSSplitViewItemCollapseBehaviorPreferResizingSiblingsWithFixedSplitView")]
    pub const PreferResizingSiblingsWithFixedSplitView: Self = Self(2);
    /// The item will collapse/uncollapse purely from a constraint animation, with a constraint priority of the item’s `holdingPriority`. This could result in a partial internal content resize and window resize, and has no implications for keeping the window on screen. External constraints can be used to tweak exactly how the animation affects item, sibling, and window size and positions.
    #[doc(alias = "NSSplitViewItemCollapseBehaviorUseConstraints")]
    pub const UseConstraints: Self = Self(3);
}

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

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

extern "C" {
    /// This constant can be used with any sizing related
    /// `NSSplitViewItem`properties to unset their values.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nssplitviewitemunspecifieddimension?language=objc)
    #[cfg(feature = "objc2-core-foundation")]
    pub static NSSplitViewItemUnspecifiedDimension: CGFloat;
}

extern_class!(
    /// NSSplitViewItem implements the items used in an NSSplitViewController.
    /// The item describes a child ViewController's state in a SplitViewController, e.g. its collapsibility, holding priority and other metrics, and collapsed state.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nssplitviewitem?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSSplitViewItem;
);

#[cfg(feature = "NSAnimation")]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for NSSplitViewItem {}
);

extern_conformance!(
    unsafe impl NSCoding for NSSplitViewItem {}
);

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

impl NSSplitViewItem {
    extern_methods!(
        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        /// Creates an autoreleased SplitViewItem that represents the provided ViewController. All other properties are left at their default.
        ///
        /// Parameter `viewController`: The view controller used to set the viewController property
        ///
        /// Returns: An autoreleased SplitViewItem.
        #[unsafe(method(splitViewItemWithViewController:))]
        #[unsafe(method_family = none)]
        pub fn splitViewItemWithViewController(
            view_controller: &NSViewController,
        ) -> Retained<Self>;

        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        /// Creates a split view item representing a sidebar for the provided ViewController.
        /// Sidebars have standard system behavior, specifically:
        /// - Translucent material background
        /// - The ability to collapse/uncollapse on split view size changes
        /// - The ability to overlay at small split view sizes when in fullscreen
        /// - canCollapse is set to YES
        /// - minimumThickness and maximumThickness are set to the standard minimum and maximum sidebar size
        /// - preferredThicknessFraction is set to the standard fraction for sidebars (0.15)
        /// - springLoaded is set to YES
        ///
        /// Parameter `viewController`: The view controller used to set the viewController property
        ///
        /// Returns: An autoreleased SplitViewItem that acts as a sidebar.
        #[unsafe(method(sidebarWithViewController:))]
        #[unsafe(method_family = none)]
        pub fn sidebarWithViewController(view_controller: &NSViewController) -> Retained<Self>;

        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        /// Creates a split view item representing a content list for the provided ViewController, akin to Mail's message list, Note's note list.
        /// Content lists have system standard defaults, specifically:
        /// - minimumThickness and maximumThickness are set to the system standard for content lists
        /// - automaticMaximumThickness is set to the system standard for content lists
        /// - preferredThicknessFraction is set to the standard fraction for content lists (0.28 when a neighbor sidebar is visible, 0.33 if not)
        ///
        /// Parameter `viewController`: The view controller used to set the viewController property
        ///
        /// Returns: An autoreleased SplitViewItem that acts as a content list.
        #[unsafe(method(contentListWithViewController:))]
        #[unsafe(method_family = none)]
        pub fn contentListWithViewController(view_controller: &NSViewController) -> Retained<Self>;

        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        /// Creates a split view item representing an inspector for the provided ViewController.
        /// On macOS 14.0 and above inspectors have the following standard system behavior:
        /// - canCollapse is set to YES
        /// - minimumThickness and maximumThickness are set to the standard inspector size (270) and are not resizable by default
        ///
        /// Parameter `viewController`: The view controller used to set the viewController property
        ///
        /// Returns: An autoreleased SplitViewItem that acts as an inspector.
        #[unsafe(method(inspectorWithViewController:))]
        #[unsafe(method_family = none)]
        pub fn inspectorWithViewController(view_controller: &NSViewController) -> Retained<Self>;

        /// The standard behavior type of the receiver. See initializers for descriptions of each behavior.
        #[unsafe(method(behavior))]
        #[unsafe(method_family = none)]
        pub fn behavior(&self) -> NSSplitViewItemBehavior;

        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        /// The view controller represented by the SplitViewItem. An exception will be thrown if a new viewController is set while the receiving SplitViewItem is added to a SplitViewController.
        #[unsafe(method(viewController))]
        #[unsafe(method_family = none)]
        pub fn viewController(&self, mtm: MainThreadMarker) -> Retained<NSViewController>;

        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        /// Setter for [`viewController`][Self::viewController].
        #[unsafe(method(setViewController:))]
        #[unsafe(method_family = none)]
        pub fn setViewController(&self, view_controller: &NSViewController);

        /// Whether or not the child ViewController corresponding to the SplitViewItem is collapsed in the SplitViewController. The default is
        /// `NO.`This can be set with the animator proxy to animate the collapse or uncollapse. The exact animation used can be customized by setting it in the -animations dictionary with a key of "collapsed". If this is set to YES before it is added to the SplitViewController, it will be initially collapsed and the SplitViewController will not cause the view to be loaded until it is uncollapsed. This is KVC/KVO compliant and will be updated if the value changes from user interaction.
        #[unsafe(method(isCollapsed))]
        #[unsafe(method_family = none)]
        pub fn isCollapsed(&self) -> bool;

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

        /// Whether or not the child view controller is collapsible from user interaction - whether by dragging or double clicking a divider. The default is
        /// `NO.`
        #[unsafe(method(canCollapse))]
        #[unsafe(method_family = none)]
        pub fn canCollapse(&self) -> bool;

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

        /// The resize behavior when the receiver toggles its `collapsed` state programmatically, both animatedly and not. Defaults to `.Default`.
        #[unsafe(method(collapseBehavior))]
        #[unsafe(method_family = none)]
        pub fn collapseBehavior(&self) -> NSSplitViewItemCollapseBehavior;

        /// Setter for [`collapseBehavior`][Self::collapseBehavior].
        #[unsafe(method(setCollapseBehavior:))]
        #[unsafe(method_family = none)]
        pub fn setCollapseBehavior(&self, collapse_behavior: NSSplitViewItemCollapseBehavior);

        #[cfg(feature = "objc2-core-foundation")]
        /// A convenience to set the minimum thickness of the split view item -- width for "vertical" split views, height otherwise. If NSSplitViewItemUnspecifiedDimension, no minimum size is enforced by the SplitViewItem, although constraints in the contained view hierarchy might have constraints specify some minimum size on their own. Defaults to NSSplitViewItemUnspecifiedDimension.
        #[unsafe(method(minimumThickness))]
        #[unsafe(method_family = none)]
        pub fn minimumThickness(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`minimumThickness`][Self::minimumThickness].
        #[unsafe(method(setMinimumThickness:))]
        #[unsafe(method_family = none)]
        pub fn setMinimumThickness(&self, minimum_thickness: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// A convenience to set the maximum thickness of the split view item -- width for "vertical" split views, height otherwise. If NSSplitViewItemUnspecifiedDimension, no maximum size is enforced by the SplitViewItem, although constraints in the contained view hierarchy might have constraints specify some maximum size on their own. Defaults to NSSplitViewItemUnspecifiedDimension.
        #[unsafe(method(maximumThickness))]
        #[unsafe(method_family = none)]
        pub fn maximumThickness(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`maximumThickness`][Self::maximumThickness].
        #[unsafe(method(setMaximumThickness:))]
        #[unsafe(method_family = none)]
        pub fn setMaximumThickness(&self, maximum_thickness: CGFloat);

        #[cfg(feature = "objc2-core-foundation")]
        /// The percentage of the contained NSSplitView that the NSSplitViewItem prefers to encompass. This is used when double-clicking on a neighbor divider to return to that standard ratio. As well as after entering fullscreen to determine the initial size of the receiver. Defaults to NSSplitViewItemUnspecifiedDimension, which means no resize will occur on double-clicks, and the absolute size is preserved when entering fullscreen.
        #[unsafe(method(preferredThicknessFraction))]
        #[unsafe(method_family = none)]
        pub fn preferredThicknessFraction(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`preferredThicknessFraction`][Self::preferredThicknessFraction].
        #[unsafe(method(setPreferredThicknessFraction:))]
        #[unsafe(method_family = none)]
        pub fn setPreferredThicknessFraction(&self, preferred_thickness_fraction: CGFloat);

        #[cfg(feature = "NSLayoutConstraint")]
        /// Sets the priority under which a SplitViewItem will hold its width (for a vertical split view) or height (for a horizontal split view). The view with the lowest priority will be the first to take on additional width if the split view grows or shrinks. The default is
        /// `NSLayoutPriorityDefaultLow.`
        #[unsafe(method(holdingPriority))]
        #[unsafe(method_family = none)]
        pub fn holdingPriority(&self) -> NSLayoutPriority;

        #[cfg(feature = "NSLayoutConstraint")]
        /// Setter for [`holdingPriority`][Self::holdingPriority].
        #[unsafe(method(setHoldingPriority:))]
        #[unsafe(method_family = none)]
        pub fn setHoldingPriority(&self, holding_priority: NSLayoutPriority);

        #[cfg(feature = "objc2-core-foundation")]
        /// The maximum thickness of the split view item when resizing due to automatic sizing, such as entering fullscreen with a set preferredThicknessFraction or proportional sizing. The user can still resize up to the absolute maximum size by dragging the divider or otherwise. If NSSplitViewItemUnspecifiedDimension, no automatic maximum is enforced. Defaults to NSSplitViewItemUnspecifiedDimension.
        #[unsafe(method(automaticMaximumThickness))]
        #[unsafe(method_family = none)]
        pub fn automaticMaximumThickness(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`automaticMaximumThickness`][Self::automaticMaximumThickness].
        #[unsafe(method(setAutomaticMaximumThickness:))]
        #[unsafe(method_family = none)]
        pub fn setAutomaticMaximumThickness(&self, automatic_maximum_thickness: CGFloat);

        /// If YES, the split view item can be temporarily uncollapsed during a drag by hovering or deep clicking on its neighboring divider. Defaults to NO.
        #[unsafe(method(isSpringLoaded))]
        #[unsafe(method_family = none)]
        pub fn isSpringLoaded(&self) -> bool;

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

        /// If YES, the item can be collapsed from a window resize. This can differ from `canCollapse`, to allow divider collapsing but not window resize collapsing or vice versa.
        /// Defaults to YES for Sidebars and NO for Inspectors.
        /// - Note: Setting `canCollapse` for sidebars will reset this value to that new value.
        #[unsafe(method(canCollapseFromWindowResize))]
        #[unsafe(method_family = none)]
        pub fn canCollapseFromWindowResize(&self) -> bool;

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

        /// Whether or not a sidebar or inspector is allowed to be full height in the window when the `NSFullSizeContentViewWindowMask` style mask is also set. Only applies to NSSplitViewItemBehaviorSidebar and NSSplitViewItemBehaviorInspector. Defaults to YES.
        #[unsafe(method(allowsFullHeightLayout))]
        #[unsafe(method_family = none)]
        pub fn allowsFullHeightLayout(&self) -> bool;

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

        #[cfg(feature = "NSWindow")]
        /// Specifies a preference for the style of separator displayed between the titlebar and the content of the split view item.
        ///
        /// For this value to be applicable, the item's view must be associated with its own titlebar section (see `NSTrackingSeparatorToolbarItem` for more info).
        /// The default value is NSTitlebarSeparatorStyleAutomatic. This value is subject to the containing window's preference and can be overridden.
        #[unsafe(method(titlebarSeparatorStyle))]
        #[unsafe(method_family = none)]
        pub fn titlebarSeparatorStyle(&self) -> NSTitlebarSeparatorStyle;

        #[cfg(feature = "NSWindow")]
        /// Setter for [`titlebarSeparatorStyle`][Self::titlebarSeparatorStyle].
        #[unsafe(method(setTitlebarSeparatorStyle:))]
        #[unsafe(method_family = none)]
        pub fn setTitlebarSeparatorStyle(&self, titlebar_separator_style: NSTitlebarSeparatorStyle);

        /// When YES, other items such as sidebars or inspectors may appear overlaid on top of this item's `viewController` and this item's `safeAreaInsets` will be adjusted with respect to overlaid content. Defaults to `NO`.
        #[unsafe(method(automaticallyAdjustsSafeAreaInsets))]
        #[unsafe(method_family = none)]
        pub fn automaticallyAdjustsSafeAreaInsets(&self) -> bool;

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

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        /// The following methods allow you to add accessory views to the top/bottom of this splitViewItem. See `NSSplitViewItemAccessoryViewController` for more details.
        #[unsafe(method(topAlignedAccessoryViewControllers))]
        #[unsafe(method_family = none)]
        pub fn topAlignedAccessoryViewControllers(
            &self,
            mtm: MainThreadMarker,
        ) -> Retained<NSArray<NSSplitViewItemAccessoryViewController>>;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        /// Setter for [`topAlignedAccessoryViewControllers`][Self::topAlignedAccessoryViewControllers].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setTopAlignedAccessoryViewControllers:))]
        #[unsafe(method_family = none)]
        pub fn setTopAlignedAccessoryViewControllers(
            &self,
            top_aligned_accessory_view_controllers: &NSArray<
                NSSplitViewItemAccessoryViewController,
            >,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[unsafe(method(addTopAlignedAccessoryViewController:))]
        #[unsafe(method_family = none)]
        pub fn addTopAlignedAccessoryViewController(
            &self,
            child_view_controller: &NSSplitViewItemAccessoryViewController,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[unsafe(method(insertTopAlignedAccessoryViewController:atIndex:))]
        #[unsafe(method_family = none)]
        pub fn insertTopAlignedAccessoryViewController_atIndex(
            &self,
            child_view_controller: &NSSplitViewItemAccessoryViewController,
            index: NSInteger,
        );

        /// NOTE: you can use this method, or `-removeFromParentViewController:`, whichever is easier.
        #[unsafe(method(removeTopAlignedAccessoryViewControllerAtIndex:))]
        #[unsafe(method_family = none)]
        pub fn removeTopAlignedAccessoryViewControllerAtIndex(&self, index: NSInteger);

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[unsafe(method(bottomAlignedAccessoryViewControllers))]
        #[unsafe(method_family = none)]
        pub fn bottomAlignedAccessoryViewControllers(
            &self,
            mtm: MainThreadMarker,
        ) -> Retained<NSArray<NSSplitViewItemAccessoryViewController>>;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        /// Setter for [`bottomAlignedAccessoryViewControllers`][Self::bottomAlignedAccessoryViewControllers].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setBottomAlignedAccessoryViewControllers:))]
        #[unsafe(method_family = none)]
        pub fn setBottomAlignedAccessoryViewControllers(
            &self,
            bottom_aligned_accessory_view_controllers: &NSArray<
                NSSplitViewItemAccessoryViewController,
            >,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[unsafe(method(addBottomAlignedAccessoryViewController:))]
        #[unsafe(method_family = none)]
        pub fn addBottomAlignedAccessoryViewController(
            &self,
            child_view_controller: &NSSplitViewItemAccessoryViewController,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSSplitViewItemAccessoryViewController",
            feature = "NSViewController"
        ))]
        #[unsafe(method(insertBottomAlignedAccessoryViewController:atIndex:))]
        #[unsafe(method_family = none)]
        pub fn insertBottomAlignedAccessoryViewController_atIndex(
            &self,
            child_view_controller: &NSSplitViewItemAccessoryViewController,
            index: NSInteger,
        );

        /// NOTE: you can use this method, or `-removeFromParentViewController:`, whichever is easier.
        #[unsafe(method(removeBottomAlignedAccessoryViewControllerAtIndex:))]
        #[unsafe(method_family = none)]
        pub fn removeBottomAlignedAccessoryViewControllerAtIndex(&self, index: NSInteger);
    );
}

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

impl DefaultRetained for NSSplitViewItem {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}