objc2_app_kit/generated/
NSStoryboardSegue.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsstoryboardsegueidentifier?language=objc)
11pub type NSStoryboardSegueIdentifier = NSString;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsstoryboardsegue?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct NSStoryboardSegue;
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for NSStoryboardSegue {}
22);
23
24impl NSStoryboardSegue {
25    extern_methods!(
26        #[cfg(feature = "block2")]
27        /// # Safety
28        ///
29        /// - `source_controller` should be of the correct type.
30        /// - `destination_controller` should be of the correct type.
31        #[unsafe(method(segueWithIdentifier:source:destination:performHandler:))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn segueWithIdentifier_source_destination_performHandler(
34            identifier: &NSStoryboardSegueIdentifier,
35            source_controller: &AnyObject,
36            destination_controller: &AnyObject,
37            perform_handler: &block2::DynBlock<dyn Fn()>,
38        ) -> Retained<Self>;
39
40        /// # Safety
41        ///
42        /// - `source_controller` should be of the correct type.
43        /// - `destination_controller` should be of the correct type.
44        #[unsafe(method(initWithIdentifier:source:destination:))]
45        #[unsafe(method_family = init)]
46        pub unsafe fn initWithIdentifier_source_destination(
47            this: Allocated<Self>,
48            identifier: &NSStoryboardSegueIdentifier,
49            source_controller: &AnyObject,
50            destination_controller: &AnyObject,
51        ) -> Retained<Self>;
52
53        #[unsafe(method(identifier))]
54        #[unsafe(method_family = none)]
55        pub fn identifier(&self) -> Option<Retained<NSStoryboardSegueIdentifier>>;
56
57        #[unsafe(method(sourceController))]
58        #[unsafe(method_family = none)]
59        pub fn sourceController(&self) -> Retained<AnyObject>;
60
61        #[unsafe(method(destinationController))]
62        #[unsafe(method_family = none)]
63        pub fn destinationController(&self) -> Retained<AnyObject>;
64
65        #[unsafe(method(perform))]
66        #[unsafe(method_family = none)]
67        pub fn perform(&self);
68    );
69}
70
71/// Methods declared on superclass `NSObject`.
72impl NSStoryboardSegue {
73    extern_methods!(
74        #[unsafe(method(init))]
75        #[unsafe(method_family = init)]
76        pub fn init(this: Allocated<Self>) -> Retained<Self>;
77
78        #[unsafe(method(new))]
79        #[unsafe(method_family = new)]
80        pub fn new() -> Retained<Self>;
81    );
82}
83
84impl DefaultRetained for NSStoryboardSegue {
85    #[inline]
86    fn default_retained() -> Retained<Self> {
87        Self::new()
88    }
89}
90
91extern_protocol!(
92    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nssegueperforming?language=objc)
93    pub unsafe trait NSSeguePerforming: NSObjectProtocol + MainThreadOnly {
94        /// # Safety
95        ///
96        /// `sender` should be of the correct type.
97        #[optional]
98        #[unsafe(method(prepareForSegue:sender:))]
99        #[unsafe(method_family = none)]
100        unsafe fn prepareForSegue_sender(
101            &self,
102            segue: &NSStoryboardSegue,
103            sender: Option<&AnyObject>,
104        );
105
106        /// # Safety
107        ///
108        /// `sender` should be of the correct type.
109        #[optional]
110        #[unsafe(method(performSegueWithIdentifier:sender:))]
111        #[unsafe(method_family = none)]
112        unsafe fn performSegueWithIdentifier_sender(
113            &self,
114            identifier: &NSStoryboardSegueIdentifier,
115            sender: Option<&AnyObject>,
116        );
117
118        /// # Safety
119        ///
120        /// `sender` should be of the correct type.
121        #[optional]
122        #[unsafe(method(shouldPerformSegueWithIdentifier:sender:))]
123        #[unsafe(method_family = none)]
124        unsafe fn shouldPerformSegueWithIdentifier_sender(
125            &self,
126            identifier: &NSStoryboardSegueIdentifier,
127            sender: Option<&AnyObject>,
128        ) -> bool;
129    }
130);