objc2_ui_kit/generated/
UISplitViewController.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerdisplaymode?language=objc)
13// NS_ENUM
14#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct UISplitViewControllerDisplayMode(pub NSInteger);
17impl UISplitViewControllerDisplayMode {
18    #[doc(alias = "UISplitViewControllerDisplayModeAutomatic")]
19    pub const Automatic: Self = Self(0);
20    #[doc(alias = "UISplitViewControllerDisplayModeSecondaryOnly")]
21    pub const SecondaryOnly: Self = Self(1);
22    #[doc(alias = "UISplitViewControllerDisplayModeOneBesideSecondary")]
23    pub const OneBesideSecondary: Self = Self(2);
24    #[doc(alias = "UISplitViewControllerDisplayModeOneOverSecondary")]
25    pub const OneOverSecondary: Self = Self(3);
26    #[doc(alias = "UISplitViewControllerDisplayModeTwoBesideSecondary")]
27    pub const TwoBesideSecondary: Self = Self(4);
28    #[doc(alias = "UISplitViewControllerDisplayModeTwoOverSecondary")]
29    pub const TwoOverSecondary: Self = Self(5);
30    #[doc(alias = "UISplitViewControllerDisplayModeTwoDisplaceSecondary")]
31    pub const TwoDisplaceSecondary: Self = Self(6);
32    #[doc(alias = "UISplitViewControllerDisplayModePrimaryHidden")]
33    #[deprecated]
34    pub const PrimaryHidden: Self = Self(UISplitViewControllerDisplayMode::SecondaryOnly.0);
35    #[doc(alias = "UISplitViewControllerDisplayModeAllVisible")]
36    #[deprecated]
37    pub const AllVisible: Self = Self(UISplitViewControllerDisplayMode::OneBesideSecondary.0);
38    #[doc(alias = "UISplitViewControllerDisplayModePrimaryOverlay")]
39    #[deprecated]
40    pub const PrimaryOverlay: Self = Self(UISplitViewControllerDisplayMode::OneOverSecondary.0);
41}
42
43unsafe impl Encode for UISplitViewControllerDisplayMode {
44    const ENCODING: Encoding = NSInteger::ENCODING;
45}
46
47unsafe impl RefEncode for UISplitViewControllerDisplayMode {
48    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
49}
50
51/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerprimaryedge?language=objc)
52// NS_ENUM
53#[repr(transparent)]
54#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
55pub struct UISplitViewControllerPrimaryEdge(pub NSInteger);
56impl UISplitViewControllerPrimaryEdge {
57    #[doc(alias = "UISplitViewControllerPrimaryEdgeLeading")]
58    pub const Leading: Self = Self(0);
59    #[doc(alias = "UISplitViewControllerPrimaryEdgeTrailing")]
60    pub const Trailing: Self = Self(1);
61}
62
63unsafe impl Encode for UISplitViewControllerPrimaryEdge {
64    const ENCODING: Encoding = NSInteger::ENCODING;
65}
66
67unsafe impl RefEncode for UISplitViewControllerPrimaryEdge {
68    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
69}
70
71/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerbackgroundstyle?language=objc)
72// NS_ENUM
73#[repr(transparent)]
74#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
75pub struct UISplitViewControllerBackgroundStyle(pub NSInteger);
76impl UISplitViewControllerBackgroundStyle {
77    #[doc(alias = "UISplitViewControllerBackgroundStyleNone")]
78    pub const None: Self = Self(0);
79    #[doc(alias = "UISplitViewControllerBackgroundStyleSidebar")]
80    pub const Sidebar: Self = Self(1);
81}
82
83unsafe impl Encode for UISplitViewControllerBackgroundStyle {
84    const ENCODING: Encoding = NSInteger::ENCODING;
85}
86
87unsafe impl RefEncode for UISplitViewControllerBackgroundStyle {
88    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
89}
90
91/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerstyle?language=objc)
92// NS_ENUM
93#[repr(transparent)]
94#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
95pub struct UISplitViewControllerStyle(pub NSInteger);
96impl UISplitViewControllerStyle {
97    #[doc(alias = "UISplitViewControllerStyleUnspecified")]
98    #[deprecated]
99    pub const Unspecified: Self = Self(0);
100    #[doc(alias = "UISplitViewControllerStyleDoubleColumn")]
101    pub const DoubleColumn: Self = Self(1);
102    #[doc(alias = "UISplitViewControllerStyleTripleColumn")]
103    pub const TripleColumn: Self = Self(2);
104}
105
106unsafe impl Encode for UISplitViewControllerStyle {
107    const ENCODING: Encoding = NSInteger::ENCODING;
108}
109
110unsafe impl RefEncode for UISplitViewControllerStyle {
111    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
112}
113
114/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollercolumn?language=objc)
115// NS_ENUM
116#[repr(transparent)]
117#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
118pub struct UISplitViewControllerColumn(pub NSInteger);
119impl UISplitViewControllerColumn {
120    #[doc(alias = "UISplitViewControllerColumnPrimary")]
121    pub const Primary: Self = Self(0);
122    #[doc(alias = "UISplitViewControllerColumnSupplementary")]
123    pub const Supplementary: Self = Self(1);
124    #[doc(alias = "UISplitViewControllerColumnSecondary")]
125    pub const Secondary: Self = Self(2);
126    #[doc(alias = "UISplitViewControllerColumnCompact")]
127    pub const Compact: Self = Self(3);
128}
129
130unsafe impl Encode for UISplitViewControllerColumn {
131    const ENCODING: Encoding = NSInteger::ENCODING;
132}
133
134unsafe impl RefEncode for UISplitViewControllerColumn {
135    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
136}
137
138/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollersplitbehavior?language=objc)
139// NS_ENUM
140#[repr(transparent)]
141#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
142pub struct UISplitViewControllerSplitBehavior(pub NSInteger);
143impl UISplitViewControllerSplitBehavior {
144    #[doc(alias = "UISplitViewControllerSplitBehaviorAutomatic")]
145    pub const Automatic: Self = Self(0);
146    #[doc(alias = "UISplitViewControllerSplitBehaviorTile")]
147    pub const Tile: Self = Self(1);
148    #[doc(alias = "UISplitViewControllerSplitBehaviorOverlay")]
149    pub const Overlay: Self = Self(2);
150    #[doc(alias = "UISplitViewControllerSplitBehaviorDisplace")]
151    pub const Displace: Self = Self(3);
152}
153
154unsafe impl Encode for UISplitViewControllerSplitBehavior {
155    const ENCODING: Encoding = NSInteger::ENCODING;
156}
157
158unsafe impl RefEncode for UISplitViewControllerSplitBehavior {
159    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
160}
161
162/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerdisplaymodebuttonvisibility?language=objc)
163// NS_ENUM
164#[repr(transparent)]
165#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
166pub struct UISplitViewControllerDisplayModeButtonVisibility(pub NSInteger);
167impl UISplitViewControllerDisplayModeButtonVisibility {
168    #[doc(alias = "UISplitViewControllerDisplayModeButtonVisibilityAutomatic")]
169    pub const Automatic: Self = Self(0);
170    #[doc(alias = "UISplitViewControllerDisplayModeButtonVisibilityNever")]
171    pub const Never: Self = Self(1);
172    #[doc(alias = "UISplitViewControllerDisplayModeButtonVisibilityAlways")]
173    pub const Always: Self = Self(2);
174}
175
176unsafe impl Encode for UISplitViewControllerDisplayModeButtonVisibility {
177    const ENCODING: Encoding = NSInteger::ENCODING;
178}
179
180unsafe impl RefEncode for UISplitViewControllerDisplayModeButtonVisibility {
181    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
182}
183
184extern "C" {
185    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerautomaticdimension?language=objc)
186    #[cfg(feature = "objc2-core-foundation")]
187    pub static UISplitViewControllerAutomaticDimension: CGFloat;
188}
189
190extern_class!(
191    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontroller?language=objc)
192    #[unsafe(super(UIViewController, UIResponder, NSObject))]
193    #[thread_kind = MainThreadOnly]
194    #[derive(Debug, PartialEq, Eq, Hash)]
195    #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
196    pub struct UISplitViewController;
197);
198
199#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
200extern_conformance!(
201    unsafe impl NSCoding for UISplitViewController {}
202);
203
204#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
205extern_conformance!(
206    unsafe impl NSObjectProtocol for UISplitViewController {}
207);
208
209#[cfg(all(
210    feature = "UIAppearance",
211    feature = "UIResponder",
212    feature = "UIViewController"
213))]
214extern_conformance!(
215    unsafe impl UIAppearanceContainer for UISplitViewController {}
216);
217
218#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
219extern_conformance!(
220    unsafe impl UIContentContainer for UISplitViewController {}
221);
222
223#[cfg(all(
224    feature = "UIFocus",
225    feature = "UIResponder",
226    feature = "UIViewController"
227))]
228extern_conformance!(
229    unsafe impl UIFocusEnvironment for UISplitViewController {}
230);
231
232#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
233extern_conformance!(
234    unsafe impl UIResponderStandardEditActions for UISplitViewController {}
235);
236
237#[cfg(all(
238    feature = "UIResponder",
239    feature = "UITraitCollection",
240    feature = "UIViewController"
241))]
242extern_conformance!(
243    unsafe impl UITraitEnvironment for UISplitViewController {}
244);
245
246#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
247impl UISplitViewController {
248    extern_methods!(
249        #[unsafe(method(initWithCoder:))]
250        #[unsafe(method_family = init)]
251        pub unsafe fn initWithCoder(
252            this: Allocated<Self>,
253            coder: &NSCoder,
254        ) -> Option<Retained<Self>>;
255
256        #[unsafe(method(initWithNibName:bundle:))]
257        #[unsafe(method_family = init)]
258        pub unsafe fn initWithNibName_bundle(
259            this: Allocated<Self>,
260            nib_name_or_nil: Option<&NSString>,
261            nib_bundle_or_nil: Option<&NSBundle>,
262        ) -> Retained<Self>;
263
264        #[unsafe(method(initWithStyle:))]
265        #[unsafe(method_family = init)]
266        pub unsafe fn initWithStyle(
267            this: Allocated<Self>,
268            style: UISplitViewControllerStyle,
269        ) -> Retained<Self>;
270
271        #[unsafe(method(style))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn style(&self) -> UISplitViewControllerStyle;
274
275        #[unsafe(method(delegate))]
276        #[unsafe(method_family = none)]
277        pub unsafe fn delegate(
278            &self,
279        ) -> Option<Retained<ProtocolObject<dyn UISplitViewControllerDelegate>>>;
280
281        /// This is a [weak property][objc2::topics::weak_property].
282        /// Setter for [`delegate`][Self::delegate].
283        #[unsafe(method(setDelegate:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn setDelegate(
286            &self,
287            delegate: Option<&ProtocolObject<dyn UISplitViewControllerDelegate>>,
288        );
289
290        #[unsafe(method(showsSecondaryOnlyButton))]
291        #[unsafe(method_family = none)]
292        pub unsafe fn showsSecondaryOnlyButton(&self) -> bool;
293
294        /// Setter for [`showsSecondaryOnlyButton`][Self::showsSecondaryOnlyButton].
295        #[unsafe(method(setShowsSecondaryOnlyButton:))]
296        #[unsafe(method_family = none)]
297        pub unsafe fn setShowsSecondaryOnlyButton(&self, shows_secondary_only_button: bool);
298
299        #[unsafe(method(preferredSplitBehavior))]
300        #[unsafe(method_family = none)]
301        pub unsafe fn preferredSplitBehavior(&self) -> UISplitViewControllerSplitBehavior;
302
303        /// Setter for [`preferredSplitBehavior`][Self::preferredSplitBehavior].
304        #[unsafe(method(setPreferredSplitBehavior:))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn setPreferredSplitBehavior(
307            &self,
308            preferred_split_behavior: UISplitViewControllerSplitBehavior,
309        );
310
311        #[unsafe(method(splitBehavior))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn splitBehavior(&self) -> UISplitViewControllerSplitBehavior;
314
315        #[unsafe(method(setViewController:forColumn:))]
316        #[unsafe(method_family = none)]
317        pub unsafe fn setViewController_forColumn(
318            &self,
319            vc: Option<&UIViewController>,
320            column: UISplitViewControllerColumn,
321        );
322
323        #[unsafe(method(viewControllerForColumn:))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn viewControllerForColumn(
326            &self,
327            column: UISplitViewControllerColumn,
328        ) -> Option<Retained<UIViewController>>;
329
330        #[unsafe(method(hideColumn:))]
331        #[unsafe(method_family = none)]
332        pub unsafe fn hideColumn(&self, column: UISplitViewControllerColumn);
333
334        #[unsafe(method(showColumn:))]
335        #[unsafe(method_family = none)]
336        pub unsafe fn showColumn(&self, column: UISplitViewControllerColumn);
337
338        #[unsafe(method(viewControllers))]
339        #[unsafe(method_family = none)]
340        pub unsafe fn viewControllers(&self) -> Retained<NSArray<UIViewController>>;
341
342        /// Setter for [`viewControllers`][Self::viewControllers].
343        #[unsafe(method(setViewControllers:))]
344        #[unsafe(method_family = none)]
345        pub unsafe fn setViewControllers(&self, view_controllers: &NSArray<UIViewController>);
346
347        #[unsafe(method(presentsWithGesture))]
348        #[unsafe(method_family = none)]
349        pub unsafe fn presentsWithGesture(&self) -> bool;
350
351        /// Setter for [`presentsWithGesture`][Self::presentsWithGesture].
352        #[unsafe(method(setPresentsWithGesture:))]
353        #[unsafe(method_family = none)]
354        pub unsafe fn setPresentsWithGesture(&self, presents_with_gesture: bool);
355
356        #[unsafe(method(isCollapsed))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn isCollapsed(&self) -> bool;
359
360        #[unsafe(method(preferredDisplayMode))]
361        #[unsafe(method_family = none)]
362        pub unsafe fn preferredDisplayMode(&self) -> UISplitViewControllerDisplayMode;
363
364        /// Setter for [`preferredDisplayMode`][Self::preferredDisplayMode].
365        #[unsafe(method(setPreferredDisplayMode:))]
366        #[unsafe(method_family = none)]
367        pub unsafe fn setPreferredDisplayMode(
368            &self,
369            preferred_display_mode: UISplitViewControllerDisplayMode,
370        );
371
372        #[unsafe(method(displayMode))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn displayMode(&self) -> UISplitViewControllerDisplayMode;
375
376        #[cfg(all(feature = "UIBarButtonItem", feature = "UIBarItem"))]
377        #[unsafe(method(displayModeButtonItem))]
378        #[unsafe(method_family = none)]
379        pub unsafe fn displayModeButtonItem(&self) -> Retained<UIBarButtonItem>;
380
381        #[unsafe(method(displayModeButtonVisibility))]
382        #[unsafe(method_family = none)]
383        pub unsafe fn displayModeButtonVisibility(
384            &self,
385        ) -> UISplitViewControllerDisplayModeButtonVisibility;
386
387        /// Setter for [`displayModeButtonVisibility`][Self::displayModeButtonVisibility].
388        #[unsafe(method(setDisplayModeButtonVisibility:))]
389        #[unsafe(method_family = none)]
390        pub unsafe fn setDisplayModeButtonVisibility(
391            &self,
392            display_mode_button_visibility: UISplitViewControllerDisplayModeButtonVisibility,
393        );
394
395        #[cfg(feature = "objc2-core-foundation")]
396        #[unsafe(method(preferredPrimaryColumnWidthFraction))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn preferredPrimaryColumnWidthFraction(&self) -> CGFloat;
399
400        #[cfg(feature = "objc2-core-foundation")]
401        /// Setter for [`preferredPrimaryColumnWidthFraction`][Self::preferredPrimaryColumnWidthFraction].
402        #[unsafe(method(setPreferredPrimaryColumnWidthFraction:))]
403        #[unsafe(method_family = none)]
404        pub unsafe fn setPreferredPrimaryColumnWidthFraction(
405            &self,
406            preferred_primary_column_width_fraction: CGFloat,
407        );
408
409        #[cfg(feature = "objc2-core-foundation")]
410        #[unsafe(method(preferredPrimaryColumnWidth))]
411        #[unsafe(method_family = none)]
412        pub unsafe fn preferredPrimaryColumnWidth(&self) -> CGFloat;
413
414        #[cfg(feature = "objc2-core-foundation")]
415        /// Setter for [`preferredPrimaryColumnWidth`][Self::preferredPrimaryColumnWidth].
416        #[unsafe(method(setPreferredPrimaryColumnWidth:))]
417        #[unsafe(method_family = none)]
418        pub unsafe fn setPreferredPrimaryColumnWidth(
419            &self,
420            preferred_primary_column_width: CGFloat,
421        );
422
423        #[cfg(feature = "objc2-core-foundation")]
424        #[unsafe(method(minimumPrimaryColumnWidth))]
425        #[unsafe(method_family = none)]
426        pub unsafe fn minimumPrimaryColumnWidth(&self) -> CGFloat;
427
428        #[cfg(feature = "objc2-core-foundation")]
429        /// Setter for [`minimumPrimaryColumnWidth`][Self::minimumPrimaryColumnWidth].
430        #[unsafe(method(setMinimumPrimaryColumnWidth:))]
431        #[unsafe(method_family = none)]
432        pub unsafe fn setMinimumPrimaryColumnWidth(&self, minimum_primary_column_width: CGFloat);
433
434        #[cfg(feature = "objc2-core-foundation")]
435        #[unsafe(method(maximumPrimaryColumnWidth))]
436        #[unsafe(method_family = none)]
437        pub unsafe fn maximumPrimaryColumnWidth(&self) -> CGFloat;
438
439        #[cfg(feature = "objc2-core-foundation")]
440        /// Setter for [`maximumPrimaryColumnWidth`][Self::maximumPrimaryColumnWidth].
441        #[unsafe(method(setMaximumPrimaryColumnWidth:))]
442        #[unsafe(method_family = none)]
443        pub unsafe fn setMaximumPrimaryColumnWidth(&self, maximum_primary_column_width: CGFloat);
444
445        #[cfg(feature = "objc2-core-foundation")]
446        #[unsafe(method(primaryColumnWidth))]
447        #[unsafe(method_family = none)]
448        pub unsafe fn primaryColumnWidth(&self) -> CGFloat;
449
450        #[cfg(feature = "objc2-core-foundation")]
451        #[unsafe(method(preferredSupplementaryColumnWidthFraction))]
452        #[unsafe(method_family = none)]
453        pub unsafe fn preferredSupplementaryColumnWidthFraction(&self) -> CGFloat;
454
455        #[cfg(feature = "objc2-core-foundation")]
456        /// Setter for [`preferredSupplementaryColumnWidthFraction`][Self::preferredSupplementaryColumnWidthFraction].
457        #[unsafe(method(setPreferredSupplementaryColumnWidthFraction:))]
458        #[unsafe(method_family = none)]
459        pub unsafe fn setPreferredSupplementaryColumnWidthFraction(
460            &self,
461            preferred_supplementary_column_width_fraction: CGFloat,
462        );
463
464        #[cfg(feature = "objc2-core-foundation")]
465        #[unsafe(method(preferredSupplementaryColumnWidth))]
466        #[unsafe(method_family = none)]
467        pub unsafe fn preferredSupplementaryColumnWidth(&self) -> CGFloat;
468
469        #[cfg(feature = "objc2-core-foundation")]
470        /// Setter for [`preferredSupplementaryColumnWidth`][Self::preferredSupplementaryColumnWidth].
471        #[unsafe(method(setPreferredSupplementaryColumnWidth:))]
472        #[unsafe(method_family = none)]
473        pub unsafe fn setPreferredSupplementaryColumnWidth(
474            &self,
475            preferred_supplementary_column_width: CGFloat,
476        );
477
478        #[cfg(feature = "objc2-core-foundation")]
479        #[unsafe(method(minimumSupplementaryColumnWidth))]
480        #[unsafe(method_family = none)]
481        pub unsafe fn minimumSupplementaryColumnWidth(&self) -> CGFloat;
482
483        #[cfg(feature = "objc2-core-foundation")]
484        /// Setter for [`minimumSupplementaryColumnWidth`][Self::minimumSupplementaryColumnWidth].
485        #[unsafe(method(setMinimumSupplementaryColumnWidth:))]
486        #[unsafe(method_family = none)]
487        pub unsafe fn setMinimumSupplementaryColumnWidth(
488            &self,
489            minimum_supplementary_column_width: CGFloat,
490        );
491
492        #[cfg(feature = "objc2-core-foundation")]
493        #[unsafe(method(maximumSupplementaryColumnWidth))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn maximumSupplementaryColumnWidth(&self) -> CGFloat;
496
497        #[cfg(feature = "objc2-core-foundation")]
498        /// Setter for [`maximumSupplementaryColumnWidth`][Self::maximumSupplementaryColumnWidth].
499        #[unsafe(method(setMaximumSupplementaryColumnWidth:))]
500        #[unsafe(method_family = none)]
501        pub unsafe fn setMaximumSupplementaryColumnWidth(
502            &self,
503            maximum_supplementary_column_width: CGFloat,
504        );
505
506        #[cfg(feature = "objc2-core-foundation")]
507        #[unsafe(method(supplementaryColumnWidth))]
508        #[unsafe(method_family = none)]
509        pub unsafe fn supplementaryColumnWidth(&self) -> CGFloat;
510
511        #[unsafe(method(primaryEdge))]
512        #[unsafe(method_family = none)]
513        pub unsafe fn primaryEdge(&self) -> UISplitViewControllerPrimaryEdge;
514
515        /// Setter for [`primaryEdge`][Self::primaryEdge].
516        #[unsafe(method(setPrimaryEdge:))]
517        #[unsafe(method_family = none)]
518        pub unsafe fn setPrimaryEdge(&self, primary_edge: UISplitViewControllerPrimaryEdge);
519
520        #[unsafe(method(showViewController:sender:))]
521        #[unsafe(method_family = none)]
522        pub unsafe fn showViewController_sender(
523            &self,
524            vc: &UIViewController,
525            sender: Option<&AnyObject>,
526        );
527
528        #[unsafe(method(showDetailViewController:sender:))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn showDetailViewController_sender(
531            &self,
532            vc: &UIViewController,
533            sender: Option<&AnyObject>,
534        );
535
536        #[unsafe(method(primaryBackgroundStyle))]
537        #[unsafe(method_family = none)]
538        pub unsafe fn primaryBackgroundStyle(&self) -> UISplitViewControllerBackgroundStyle;
539
540        /// Setter for [`primaryBackgroundStyle`][Self::primaryBackgroundStyle].
541        #[unsafe(method(setPrimaryBackgroundStyle:))]
542        #[unsafe(method_family = none)]
543        pub unsafe fn setPrimaryBackgroundStyle(
544            &self,
545            primary_background_style: UISplitViewControllerBackgroundStyle,
546        );
547    );
548}
549
550/// Methods declared on superclass `NSObject`.
551#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
552impl UISplitViewController {
553    extern_methods!(
554        #[unsafe(method(init))]
555        #[unsafe(method_family = init)]
556        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
557
558        #[unsafe(method(new))]
559        #[unsafe(method_family = new)]
560        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
561    );
562}
563
564extern_protocol!(
565    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerdelegate?language=objc)
566    pub unsafe trait UISplitViewControllerDelegate: MainThreadOnly {
567        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
568        #[optional]
569        #[unsafe(method(splitViewController:willChangeToDisplayMode:))]
570        #[unsafe(method_family = none)]
571        unsafe fn splitViewController_willChangeToDisplayMode(
572            &self,
573            svc: &UISplitViewController,
574            display_mode: UISplitViewControllerDisplayMode,
575        );
576
577        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
578        #[optional]
579        #[unsafe(method(targetDisplayModeForActionInSplitViewController:))]
580        #[unsafe(method_family = none)]
581        unsafe fn targetDisplayModeForActionInSplitViewController(
582            &self,
583            svc: &UISplitViewController,
584        ) -> UISplitViewControllerDisplayMode;
585
586        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
587        #[optional]
588        #[unsafe(method(splitViewController:showViewController:sender:))]
589        #[unsafe(method_family = none)]
590        unsafe fn splitViewController_showViewController_sender(
591            &self,
592            split_view_controller: &UISplitViewController,
593            vc: &UIViewController,
594            sender: Option<&AnyObject>,
595        ) -> bool;
596
597        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
598        #[optional]
599        #[unsafe(method(splitViewController:showDetailViewController:sender:))]
600        #[unsafe(method_family = none)]
601        unsafe fn splitViewController_showDetailViewController_sender(
602            &self,
603            split_view_controller: &UISplitViewController,
604            vc: &UIViewController,
605            sender: Option<&AnyObject>,
606        ) -> bool;
607
608        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
609        #[optional]
610        #[unsafe(method(primaryViewControllerForCollapsingSplitViewController:))]
611        #[unsafe(method_family = none)]
612        unsafe fn primaryViewControllerForCollapsingSplitViewController(
613            &self,
614            split_view_controller: &UISplitViewController,
615        ) -> Option<Retained<UIViewController>>;
616
617        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
618        #[optional]
619        #[unsafe(method(primaryViewControllerForExpandingSplitViewController:))]
620        #[unsafe(method_family = none)]
621        unsafe fn primaryViewControllerForExpandingSplitViewController(
622            &self,
623            split_view_controller: &UISplitViewController,
624        ) -> Option<Retained<UIViewController>>;
625
626        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
627        #[optional]
628        #[unsafe(method(splitViewController:collapseSecondaryViewController:ontoPrimaryViewController:))]
629        #[unsafe(method_family = none)]
630        unsafe fn splitViewController_collapseSecondaryViewController_ontoPrimaryViewController(
631            &self,
632            split_view_controller: &UISplitViewController,
633            secondary_view_controller: &UIViewController,
634            primary_view_controller: &UIViewController,
635        ) -> bool;
636
637        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
638        #[optional]
639        #[unsafe(method(splitViewController:separateSecondaryViewControllerFromPrimaryViewController:))]
640        #[unsafe(method_family = none)]
641        unsafe fn splitViewController_separateSecondaryViewControllerFromPrimaryViewController(
642            &self,
643            split_view_controller: &UISplitViewController,
644            primary_view_controller: &UIViewController,
645        ) -> Option<Retained<UIViewController>>;
646
647        #[cfg(all(
648            feature = "UIOrientation",
649            feature = "UIResponder",
650            feature = "UIViewController"
651        ))]
652        #[optional]
653        #[unsafe(method(splitViewControllerSupportedInterfaceOrientations:))]
654        #[unsafe(method_family = none)]
655        unsafe fn splitViewControllerSupportedInterfaceOrientations(
656            &self,
657            split_view_controller: &UISplitViewController,
658        ) -> UIInterfaceOrientationMask;
659
660        #[cfg(all(
661            feature = "UIOrientation",
662            feature = "UIResponder",
663            feature = "UIViewController"
664        ))]
665        #[optional]
666        #[unsafe(method(splitViewControllerPreferredInterfaceOrientationForPresentation:))]
667        #[unsafe(method_family = none)]
668        unsafe fn splitViewControllerPreferredInterfaceOrientationForPresentation(
669            &self,
670            split_view_controller: &UISplitViewController,
671        ) -> UIInterfaceOrientation;
672
673        #[cfg(all(
674            feature = "UIBarButtonItem",
675            feature = "UIBarItem",
676            feature = "UIPopoverController",
677            feature = "UIResponder",
678            feature = "UIViewController"
679        ))]
680        #[deprecated = "Use splitViewController:willChangeToDisplayMode: and displayModeButtonItem instead"]
681        #[optional]
682        #[unsafe(method(splitViewController:willHideViewController:withBarButtonItem:forPopoverController:))]
683        #[unsafe(method_family = none)]
684        unsafe fn splitViewController_willHideViewController_withBarButtonItem_forPopoverController(
685            &self,
686            svc: &UISplitViewController,
687            a_view_controller: &UIViewController,
688            bar_button_item: &UIBarButtonItem,
689            pc: &UIPopoverController,
690        );
691
692        #[cfg(all(
693            feature = "UIBarButtonItem",
694            feature = "UIBarItem",
695            feature = "UIResponder",
696            feature = "UIViewController"
697        ))]
698        #[deprecated = "Use splitViewController:willChangeToDisplayMode: and displayModeButtonItem instead"]
699        #[optional]
700        #[unsafe(method(splitViewController:willShowViewController:invalidatingBarButtonItem:))]
701        #[unsafe(method_family = none)]
702        unsafe fn splitViewController_willShowViewController_invalidatingBarButtonItem(
703            &self,
704            svc: &UISplitViewController,
705            a_view_controller: &UIViewController,
706            bar_button_item: &UIBarButtonItem,
707        );
708
709        #[cfg(all(
710            feature = "UIPopoverController",
711            feature = "UIResponder",
712            feature = "UIViewController"
713        ))]
714        #[deprecated]
715        #[optional]
716        #[unsafe(method(splitViewController:popoverController:willPresentViewController:))]
717        #[unsafe(method_family = none)]
718        unsafe fn splitViewController_popoverController_willPresentViewController(
719            &self,
720            svc: &UISplitViewController,
721            pc: &UIPopoverController,
722            a_view_controller: &UIViewController,
723        );
724
725        #[cfg(all(
726            feature = "UIOrientation",
727            feature = "UIResponder",
728            feature = "UIViewController"
729        ))]
730        #[deprecated]
731        #[optional]
732        #[unsafe(method(splitViewController:shouldHideViewController:inOrientation:))]
733        #[unsafe(method_family = none)]
734        unsafe fn splitViewController_shouldHideViewController_inOrientation(
735            &self,
736            svc: &UISplitViewController,
737            vc: &UIViewController,
738            orientation: UIInterfaceOrientation,
739        ) -> bool;
740
741        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
742        #[optional]
743        #[unsafe(method(splitViewController:topColumnForCollapsingToProposedTopColumn:))]
744        #[unsafe(method_family = none)]
745        unsafe fn splitViewController_topColumnForCollapsingToProposedTopColumn(
746            &self,
747            svc: &UISplitViewController,
748            proposed_top_column: UISplitViewControllerColumn,
749        ) -> UISplitViewControllerColumn;
750
751        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
752        #[optional]
753        #[unsafe(method(splitViewController:displayModeForExpandingToProposedDisplayMode:))]
754        #[unsafe(method_family = none)]
755        unsafe fn splitViewController_displayModeForExpandingToProposedDisplayMode(
756            &self,
757            svc: &UISplitViewController,
758            proposed_display_mode: UISplitViewControllerDisplayMode,
759        ) -> UISplitViewControllerDisplayMode;
760
761        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
762        #[optional]
763        #[unsafe(method(splitViewControllerDidCollapse:))]
764        #[unsafe(method_family = none)]
765        unsafe fn splitViewControllerDidCollapse(&self, svc: &UISplitViewController);
766
767        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
768        #[optional]
769        #[unsafe(method(splitViewControllerDidExpand:))]
770        #[unsafe(method_family = none)]
771        unsafe fn splitViewControllerDidExpand(&self, svc: &UISplitViewController);
772
773        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
774        #[optional]
775        #[unsafe(method(splitViewController:willShowColumn:))]
776        #[unsafe(method_family = none)]
777        unsafe fn splitViewController_willShowColumn(
778            &self,
779            svc: &UISplitViewController,
780            column: UISplitViewControllerColumn,
781        );
782
783        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
784        #[optional]
785        #[unsafe(method(splitViewController:willHideColumn:))]
786        #[unsafe(method_family = none)]
787        unsafe fn splitViewController_willHideColumn(
788            &self,
789            svc: &UISplitViewController,
790            column: UISplitViewControllerColumn,
791        );
792
793        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
794        #[optional]
795        #[unsafe(method(splitViewControllerInteractivePresentationGestureWillBegin:))]
796        #[unsafe(method_family = none)]
797        unsafe fn splitViewControllerInteractivePresentationGestureWillBegin(
798            &self,
799            svc: &UISplitViewController,
800        );
801
802        #[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
803        #[optional]
804        #[unsafe(method(splitViewControllerInteractivePresentationGestureDidEnd:))]
805        #[unsafe(method_family = none)]
806        unsafe fn splitViewControllerInteractivePresentationGestureDidEnd(
807            &self,
808            svc: &UISplitViewController,
809        );
810    }
811);
812
813/// UISplitViewController.
814#[cfg(all(feature = "UIResponder", feature = "UIViewController"))]
815impl UIViewController {
816    extern_methods!(
817        #[unsafe(method(splitViewController))]
818        #[unsafe(method_family = none)]
819        pub unsafe fn splitViewController(&self) -> Option<Retained<UISplitViewController>>;
820
821        #[unsafe(method(collapseSecondaryViewController:forSplitViewController:))]
822        #[unsafe(method_family = none)]
823        pub unsafe fn collapseSecondaryViewController_forSplitViewController(
824            &self,
825            secondary_view_controller: &UIViewController,
826            split_view_controller: &UISplitViewController,
827        );
828
829        #[unsafe(method(separateSecondaryViewControllerForSplitViewController:))]
830        #[unsafe(method_family = none)]
831        pub unsafe fn separateSecondaryViewControllerForSplitViewController(
832            &self,
833            split_view_controller: &UISplitViewController,
834        ) -> Option<Retained<UIViewController>>;
835    );
836}