objc2_game_kit/generated/
GKTurnBasedMatchmakerViewController.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-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkturnbasedmatchmakerviewcontroller?language=objc)
15    #[unsafe(super(NSViewController, NSResponder, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "objc2-app-kit")]
18    #[cfg(target_os = "macos")]
19    pub struct GKTurnBasedMatchmakerViewController;
20);
21
22#[cfg(all(feature = "GKDialogController", feature = "objc2-app-kit"))]
23#[cfg(target_os = "macos")]
24extern_conformance!(
25    unsafe impl GKViewController for GKTurnBasedMatchmakerViewController {}
26);
27
28#[cfg(feature = "objc2-app-kit")]
29#[cfg(target_os = "macos")]
30extern_conformance!(
31    unsafe impl NSCoding for GKTurnBasedMatchmakerViewController {}
32);
33
34#[cfg(feature = "objc2-app-kit")]
35#[cfg(target_os = "macos")]
36extern_conformance!(
37    unsafe impl NSEditor for GKTurnBasedMatchmakerViewController {}
38);
39
40#[cfg(feature = "objc2-app-kit")]
41#[cfg(target_os = "macos")]
42extern_conformance!(
43    unsafe impl NSObjectProtocol for GKTurnBasedMatchmakerViewController {}
44);
45
46#[cfg(feature = "objc2-app-kit")]
47#[cfg(target_os = "macos")]
48extern_conformance!(
49    unsafe impl NSSeguePerforming for GKTurnBasedMatchmakerViewController {}
50);
51
52#[cfg(feature = "objc2-app-kit")]
53#[cfg(target_os = "macos")]
54extern_conformance!(
55    unsafe impl NSUserInterfaceItemIdentification for GKTurnBasedMatchmakerViewController {}
56);
57
58#[cfg(feature = "objc2-app-kit")]
59#[cfg(target_os = "macos")]
60impl GKTurnBasedMatchmakerViewController {
61    extern_methods!();
62}
63
64/// Methods declared on superclass `NSViewController`.
65#[cfg(feature = "objc2-app-kit")]
66#[cfg(target_os = "macos")]
67impl GKTurnBasedMatchmakerViewController {
68    extern_methods!(
69        #[unsafe(method(initWithNibName:bundle:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithNibName_bundle(
72            this: Allocated<Self>,
73            nib_name_or_nil: Option<&NSNibName>,
74            nib_bundle_or_nil: Option<&NSBundle>,
75        ) -> Retained<Self>;
76
77        #[unsafe(method(initWithCoder:))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn initWithCoder(
80            this: Allocated<Self>,
81            coder: &NSCoder,
82        ) -> Option<Retained<Self>>;
83    );
84}
85
86/// Methods declared on superclass `NSResponder`.
87#[cfg(feature = "objc2-app-kit")]
88#[cfg(target_os = "macos")]
89impl GKTurnBasedMatchmakerViewController {
90    extern_methods!(
91        #[unsafe(method(init))]
92        #[unsafe(method_family = init)]
93        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
94    );
95}
96
97/// Methods declared on superclass `NSObject`.
98#[cfg(feature = "objc2-app-kit")]
99#[cfg(target_os = "macos")]
100impl GKTurnBasedMatchmakerViewController {
101    extern_methods!(
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
105    );
106}
107
108#[cfg(feature = "objc2-app-kit")]
109#[cfg(target_os = "macos")]
110impl GKTurnBasedMatchmakerViewController {
111    extern_methods!(
112        #[unsafe(method(turnBasedMatchmakerDelegate))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn turnBasedMatchmakerDelegate(
115            &self,
116        ) -> Option<Retained<ProtocolObject<dyn GKTurnBasedMatchmakerViewControllerDelegate>>>;
117
118        /// This is a [weak property][objc2::topics::weak_property].
119        /// Setter for [`turnBasedMatchmakerDelegate`][Self::turnBasedMatchmakerDelegate].
120        #[unsafe(method(setTurnBasedMatchmakerDelegate:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn setTurnBasedMatchmakerDelegate(
123            &self,
124            turn_based_matchmaker_delegate: Option<
125                &ProtocolObject<dyn GKTurnBasedMatchmakerViewControllerDelegate>,
126            >,
127        );
128
129        #[unsafe(method(showExistingMatches))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn showExistingMatches(&self) -> bool;
132
133        /// Setter for [`showExistingMatches`][Self::showExistingMatches].
134        #[unsafe(method(setShowExistingMatches:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn setShowExistingMatches(&self, show_existing_matches: bool);
137
138        #[cfg(feature = "GKMatchmakerViewController")]
139        /// This controls the mode of matchmaking to support in the UI (all, nearby only, automatch only, invite only). Throws an exception if you can not set to the desired mode (due to restrictions)
140        #[unsafe(method(matchmakingMode))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn matchmakingMode(&self) -> GKMatchmakingMode;
143
144        #[cfg(feature = "GKMatchmakerViewController")]
145        /// Setter for [`matchmakingMode`][Self::matchmakingMode].
146        #[unsafe(method(setMatchmakingMode:))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn setMatchmakingMode(&self, matchmaking_mode: GKMatchmakingMode);
149
150        #[cfg(feature = "GKMatchmaker")]
151        #[unsafe(method(initWithMatchRequest:))]
152        #[unsafe(method_family = init)]
153        pub unsafe fn initWithMatchRequest(
154            this: Allocated<Self>,
155            request: &GKMatchRequest,
156        ) -> Retained<Self>;
157    );
158}
159
160extern_protocol!(
161    /// [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkturnbasedmatchmakerviewcontrollerdelegate?language=objc)
162    pub unsafe trait GKTurnBasedMatchmakerViewControllerDelegate: NSObjectProtocol {
163        #[cfg(feature = "objc2-app-kit")]
164        #[cfg(target_os = "macos")]
165        /// The user has cancelled
166        #[unsafe(method(turnBasedMatchmakerViewControllerWasCancelled:))]
167        #[unsafe(method_family = none)]
168        unsafe fn turnBasedMatchmakerViewControllerWasCancelled(
169            &self,
170            view_controller: &GKTurnBasedMatchmakerViewController,
171        );
172
173        #[cfg(feature = "objc2-app-kit")]
174        #[cfg(target_os = "macos")]
175        /// Matchmaking has failed with an error
176        #[unsafe(method(turnBasedMatchmakerViewController:didFailWithError:))]
177        #[unsafe(method_family = none)]
178        unsafe fn turnBasedMatchmakerViewController_didFailWithError(
179            &self,
180            view_controller: &GKTurnBasedMatchmakerViewController,
181            error: &NSError,
182        );
183
184        #[cfg(all(feature = "GKTurnBasedMatch", feature = "objc2-app-kit"))]
185        #[cfg(target_os = "macos")]
186        #[deprecated]
187        #[optional]
188        #[unsafe(method(turnBasedMatchmakerViewController:didFindMatch:))]
189        #[unsafe(method_family = none)]
190        unsafe fn turnBasedMatchmakerViewController_didFindMatch(
191            &self,
192            view_controller: &GKTurnBasedMatchmakerViewController,
193            r#match: &GKTurnBasedMatch,
194        );
195
196        #[cfg(all(feature = "GKTurnBasedMatch", feature = "objc2-app-kit"))]
197        #[cfg(target_os = "macos")]
198        #[deprecated]
199        #[optional]
200        #[unsafe(method(turnBasedMatchmakerViewController:playerQuitForMatch:))]
201        #[unsafe(method_family = none)]
202        unsafe fn turnBasedMatchmakerViewController_playerQuitForMatch(
203            &self,
204            view_controller: &GKTurnBasedMatchmakerViewController,
205            r#match: &GKTurnBasedMatch,
206        );
207    }
208);