icrate/generated/GameKit/
GKMatchmakerViewController.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::AppKit::*;
5use crate::Foundation::*;
6use crate::GameKit::*;
7
8ns_enum!(
9    #[underlying(NSInteger)]
10    pub enum GKMatchmakingMode {
11        GKMatchmakingModeDefault = 0,
12        GKMatchmakingModeNearbyOnly = 1,
13        GKMatchmakingModeAutomatchOnly = 2,
14        GKMatchmakingModeInviteOnly = 3,
15    }
16);
17
18extern_class!(
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "GameKit_GKMatchmakerViewController")]
21    pub struct GKMatchmakerViewController;
22
23    #[cfg(feature = "GameKit_GKMatchmakerViewController")]
24    unsafe impl ClassType for GKMatchmakerViewController {
25        #[inherits(NSResponder, NSObject)]
26        type Super = NSViewController;
27        type Mutability = MainThreadOnly;
28    }
29);
30
31#[cfg(feature = "GameKit_GKMatchmakerViewController")]
32unsafe impl GKViewController for GKMatchmakerViewController {}
33
34#[cfg(feature = "GameKit_GKMatchmakerViewController")]
35unsafe impl NSCoding for GKMatchmakerViewController {}
36
37#[cfg(feature = "GameKit_GKMatchmakerViewController")]
38unsafe impl NSEditor for GKMatchmakerViewController {}
39
40#[cfg(feature = "GameKit_GKMatchmakerViewController")]
41unsafe impl NSObjectProtocol for GKMatchmakerViewController {}
42
43#[cfg(feature = "GameKit_GKMatchmakerViewController")]
44unsafe impl NSSeguePerforming for GKMatchmakerViewController {}
45
46#[cfg(feature = "GameKit_GKMatchmakerViewController")]
47unsafe impl NSUserInterfaceItemIdentification for GKMatchmakerViewController {}
48
49extern_methods!(
50    #[cfg(feature = "GameKit_GKMatchmakerViewController")]
51    unsafe impl GKMatchmakerViewController {
52        #[method_id(@__retain_semantics Other matchmakerDelegate)]
53        pub unsafe fn matchmakerDelegate(
54            &self,
55        ) -> Option<Id<ProtocolObject<dyn GKMatchmakerViewControllerDelegate>>>;
56
57        #[method(setMatchmakerDelegate:)]
58        pub unsafe fn setMatchmakerDelegate(
59            &self,
60            matchmaker_delegate: Option<&ProtocolObject<dyn GKMatchmakerViewControllerDelegate>>,
61        );
62
63        #[cfg(feature = "GameKit_GKMatchRequest")]
64        #[method_id(@__retain_semantics Other matchRequest)]
65        pub unsafe fn matchRequest(&self) -> Id<GKMatchRequest>;
66
67        #[method(isHosted)]
68        pub unsafe fn isHosted(&self) -> bool;
69
70        #[method(setHosted:)]
71        pub unsafe fn setHosted(&self, hosted: bool);
72
73        #[method(matchmakingMode)]
74        pub unsafe fn matchmakingMode(&self) -> GKMatchmakingMode;
75
76        #[method(setMatchmakingMode:)]
77        pub unsafe fn setMatchmakingMode(&self, matchmaking_mode: GKMatchmakingMode);
78
79        #[method(canStartWithMinimumPlayers)]
80        pub unsafe fn canStartWithMinimumPlayers(&self) -> bool;
81
82        #[method(setCanStartWithMinimumPlayers:)]
83        pub unsafe fn setCanStartWithMinimumPlayers(&self, can_start_with_minimum_players: bool);
84
85        #[cfg(feature = "GameKit_GKMatchRequest")]
86        #[method_id(@__retain_semantics Init initWithMatchRequest:)]
87        pub unsafe fn initWithMatchRequest(
88            this: Allocated<Self>,
89            request: &GKMatchRequest,
90        ) -> Option<Id<Self>>;
91
92        #[cfg(feature = "GameKit_GKInvite")]
93        #[method_id(@__retain_semantics Init initWithInvite:)]
94        pub unsafe fn initWithInvite(this: Allocated<Self>, invite: &GKInvite) -> Option<Id<Self>>;
95
96        #[cfg(feature = "GameKit_GKMatch")]
97        #[method(addPlayersToMatch:)]
98        pub unsafe fn addPlayersToMatch(&self, r#match: &GKMatch);
99
100        #[cfg(feature = "GameKit_GKPlayer")]
101        #[method(setHostedPlayer:didConnect:)]
102        pub unsafe fn setHostedPlayer_didConnect(&self, player: &GKPlayer, connected: bool);
103
104        #[cfg(feature = "Foundation_NSString")]
105        #[deprecated]
106        #[method_id(@__retain_semantics Other defaultInvitationMessage)]
107        pub unsafe fn defaultInvitationMessage(&self) -> Option<Id<NSString>>;
108
109        #[cfg(feature = "Foundation_NSString")]
110        #[deprecated]
111        #[method(setDefaultInvitationMessage:)]
112        pub unsafe fn setDefaultInvitationMessage(
113            &self,
114            default_invitation_message: Option<&NSString>,
115        );
116    }
117);
118
119extern_methods!(
120    /// Methods declared on superclass `NSViewController`
121    #[cfg(feature = "GameKit_GKMatchmakerViewController")]
122    unsafe impl GKMatchmakerViewController {
123        #[cfg(feature = "Foundation_NSBundle")]
124        #[method_id(@__retain_semantics Init initWithNibName:bundle:)]
125        pub unsafe fn initWithNibName_bundle(
126            this: Allocated<Self>,
127            nib_name_or_nil: Option<&NSNibName>,
128            nib_bundle_or_nil: Option<&NSBundle>,
129        ) -> Id<Self>;
130
131        #[cfg(feature = "Foundation_NSCoder")]
132        #[method_id(@__retain_semantics Init initWithCoder:)]
133        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
134    }
135);
136
137extern_methods!(
138    /// Methods declared on superclass `NSResponder`
139    #[cfg(feature = "GameKit_GKMatchmakerViewController")]
140    unsafe impl GKMatchmakerViewController {
141        #[method_id(@__retain_semantics Init init)]
142        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
143    }
144);
145
146extern_methods!(
147    /// Methods declared on superclass `NSObject`
148    #[cfg(feature = "GameKit_GKMatchmakerViewController")]
149    unsafe impl GKMatchmakerViewController {
150        #[method_id(@__retain_semantics New new)]
151        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
152    }
153);
154
155extern_methods!(
156    /// Obsoleted
157    #[cfg(feature = "GameKit_GKMatchmakerViewController")]
158    unsafe impl GKMatchmakerViewController {
159        #[cfg(feature = "Foundation_NSString")]
160        #[deprecated]
161        #[method(setHostedPlayer:connected:)]
162        pub unsafe fn setHostedPlayer_connected(&self, player_id: &NSString, connected: bool);
163    }
164);
165
166extern_protocol!(
167    pub unsafe trait GKMatchmakerViewControllerDelegate: NSObjectProtocol {
168        #[cfg(feature = "GameKit_GKMatchmakerViewController")]
169        #[method(matchmakerViewControllerWasCancelled:)]
170        unsafe fn matchmakerViewControllerWasCancelled(
171            &self,
172            view_controller: &GKMatchmakerViewController,
173        );
174
175        #[cfg(all(
176            feature = "Foundation_NSError",
177            feature = "GameKit_GKMatchmakerViewController"
178        ))]
179        #[method(matchmakerViewController:didFailWithError:)]
180        unsafe fn matchmakerViewController_didFailWithError(
181            &self,
182            view_controller: &GKMatchmakerViewController,
183            error: &NSError,
184        );
185
186        #[cfg(all(
187            feature = "GameKit_GKMatch",
188            feature = "GameKit_GKMatchmakerViewController"
189        ))]
190        #[optional]
191        #[method(matchmakerViewController:didFindMatch:)]
192        unsafe fn matchmakerViewController_didFindMatch(
193            &self,
194            view_controller: &GKMatchmakerViewController,
195            r#match: &GKMatch,
196        );
197
198        #[cfg(all(
199            feature = "Foundation_NSArray",
200            feature = "GameKit_GKMatchmakerViewController",
201            feature = "GameKit_GKPlayer"
202        ))]
203        #[optional]
204        #[method(matchmakerViewController:didFindHostedPlayers:)]
205        unsafe fn matchmakerViewController_didFindHostedPlayers(
206            &self,
207            view_controller: &GKMatchmakerViewController,
208            players: &NSArray<GKPlayer>,
209        );
210
211        #[cfg(all(
212            feature = "GameKit_GKMatchmakerViewController",
213            feature = "GameKit_GKPlayer"
214        ))]
215        #[optional]
216        #[method(matchmakerViewController:hostedPlayerDidAccept:)]
217        unsafe fn matchmakerViewController_hostedPlayerDidAccept(
218            &self,
219            view_controller: &GKMatchmakerViewController,
220            player: &GKPlayer,
221        );
222
223        #[cfg(all(
224            feature = "Foundation_NSArray",
225            feature = "Foundation_NSString",
226            feature = "GameKit_GKMatchmakerViewController"
227        ))]
228        #[deprecated]
229        #[optional]
230        #[method(matchmakerViewController:didFindPlayers:)]
231        unsafe fn matchmakerViewController_didFindPlayers(
232            &self,
233            view_controller: &GKMatchmakerViewController,
234            player_i_ds: &NSArray<NSString>,
235        );
236
237        #[cfg(all(
238            feature = "Foundation_NSString",
239            feature = "GameKit_GKMatchmakerViewController"
240        ))]
241        #[deprecated]
242        #[optional]
243        #[method(matchmakerViewController:didReceiveAcceptFromHostedPlayer:)]
244        unsafe fn matchmakerViewController_didReceiveAcceptFromHostedPlayer(
245            &self,
246            view_controller: &GKMatchmakerViewController,
247            player_id: &NSString,
248        );
249    }
250
251    unsafe impl ProtocolType for dyn GKMatchmakerViewControllerDelegate {}
252);