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