icrate/generated/GameKit/
GKGameCenterViewController.rs1use crate::common::*;
4use crate::AppKit::*;
5use crate::Foundation::*;
6use crate::GameKit::*;
7
8ns_enum!(
9 #[underlying(NSInteger)]
10 pub enum GKGameCenterViewControllerState {
11 GKGameCenterViewControllerStateDefault = -1,
12 GKGameCenterViewControllerStateLeaderboards = 0,
13 GKGameCenterViewControllerStateAchievements = 1,
14 GKGameCenterViewControllerStateChallenges = 2,
15 GKGameCenterViewControllerStateLocalPlayerProfile = 3,
16 GKGameCenterViewControllerStateDashboard = 4,
17 GKGameCenterViewControllerStateLocalPlayerFriendsList = 5,
18 }
19);
20
21extern_class!(
22 #[derive(Debug, PartialEq, Eq, Hash)]
23 #[cfg(feature = "GameKit_GKGameCenterViewController")]
24 pub struct GKGameCenterViewController;
25
26 #[cfg(feature = "GameKit_GKGameCenterViewController")]
27 unsafe impl ClassType for GKGameCenterViewController {
28 #[inherits(NSResponder, NSObject)]
29 type Super = NSViewController;
30 type Mutability = MainThreadOnly;
31 }
32);
33
34#[cfg(feature = "GameKit_GKGameCenterViewController")]
35unsafe impl GKViewController for GKGameCenterViewController {}
36
37#[cfg(feature = "GameKit_GKGameCenterViewController")]
38unsafe impl NSCoding for GKGameCenterViewController {}
39
40#[cfg(feature = "GameKit_GKGameCenterViewController")]
41unsafe impl NSEditor for GKGameCenterViewController {}
42
43#[cfg(feature = "GameKit_GKGameCenterViewController")]
44unsafe impl NSObjectProtocol for GKGameCenterViewController {}
45
46#[cfg(feature = "GameKit_GKGameCenterViewController")]
47unsafe impl NSSeguePerforming for GKGameCenterViewController {}
48
49#[cfg(feature = "GameKit_GKGameCenterViewController")]
50unsafe impl NSUserInterfaceItemIdentification for GKGameCenterViewController {}
51
52extern_methods!(
53 #[cfg(feature = "GameKit_GKGameCenterViewController")]
54 unsafe impl GKGameCenterViewController {}
55);
56
57extern_methods!(
58 #[cfg(feature = "GameKit_GKGameCenterViewController")]
60 unsafe impl GKGameCenterViewController {
61 #[cfg(feature = "Foundation_NSBundle")]
62 #[method_id(@__retain_semantics Init initWithNibName:bundle:)]
63 pub unsafe fn initWithNibName_bundle(
64 this: Allocated<Self>,
65 nib_name_or_nil: Option<&NSNibName>,
66 nib_bundle_or_nil: Option<&NSBundle>,
67 ) -> Id<Self>;
68
69 #[cfg(feature = "Foundation_NSCoder")]
70 #[method_id(@__retain_semantics Init initWithCoder:)]
71 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
72 }
73);
74
75extern_methods!(
76 #[cfg(feature = "GameKit_GKGameCenterViewController")]
78 unsafe impl GKGameCenterViewController {
79 #[method_id(@__retain_semantics Init init)]
80 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
81 }
82);
83
84extern_methods!(
85 #[cfg(feature = "GameKit_GKGameCenterViewController")]
87 unsafe impl GKGameCenterViewController {
88 #[method_id(@__retain_semantics New new)]
89 pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
90 }
91);
92
93extern_methods!(
94 #[cfg(feature = "GameKit_GKGameCenterViewController")]
95 unsafe impl GKGameCenterViewController {
96 #[method_id(@__retain_semantics Other gameCenterDelegate)]
97 pub unsafe fn gameCenterDelegate(
98 &self,
99 ) -> Option<Id<ProtocolObject<dyn GKGameCenterControllerDelegate>>>;
100
101 #[method(setGameCenterDelegate:)]
102 pub unsafe fn setGameCenterDelegate(
103 &self,
104 game_center_delegate: Option<&ProtocolObject<dyn GKGameCenterControllerDelegate>>,
105 );
106
107 #[method_id(@__retain_semantics Init initWithState:)]
108 pub unsafe fn initWithState(
109 this: Allocated<Self>,
110 state: GKGameCenterViewControllerState,
111 ) -> Id<Self>;
112
113 #[cfg(feature = "Foundation_NSString")]
114 #[method_id(@__retain_semantics Init initWithLeaderboardID:playerScope:timeScope:)]
115 pub unsafe fn initWithLeaderboardID_playerScope_timeScope(
116 this: Allocated<Self>,
117 leaderboard_id: &NSString,
118 player_scope: GKLeaderboardPlayerScope,
119 time_scope: GKLeaderboardTimeScope,
120 ) -> Id<Self>;
121
122 #[cfg(feature = "GameKit_GKLeaderboard")]
123 #[method_id(@__retain_semantics Init initWithLeaderboard:playerScope:)]
124 pub unsafe fn initWithLeaderboard_playerScope(
125 this: Allocated<Self>,
126 leaderboard: &GKLeaderboard,
127 player_scope: GKLeaderboardPlayerScope,
128 ) -> Id<Self>;
129
130 #[cfg(feature = "Foundation_NSString")]
131 #[method_id(@__retain_semantics Init initWithAchievementID:)]
132 pub unsafe fn initWithAchievementID(
133 this: Allocated<Self>,
134 achievement_id: &NSString,
135 ) -> Id<Self>;
136 }
137);
138
139extern_methods!(
140 #[cfg(feature = "GameKit_GKGameCenterViewController")]
142 unsafe impl GKGameCenterViewController {
143 #[deprecated]
144 #[method(viewState)]
145 pub unsafe fn viewState(&self) -> GKGameCenterViewControllerState;
146
147 #[deprecated]
148 #[method(setViewState:)]
149 pub unsafe fn setViewState(&self, view_state: GKGameCenterViewControllerState);
150
151 #[deprecated]
152 #[method(leaderboardTimeScope)]
153 pub unsafe fn leaderboardTimeScope(&self) -> GKLeaderboardTimeScope;
154
155 #[deprecated]
156 #[method(setLeaderboardTimeScope:)]
157 pub unsafe fn setLeaderboardTimeScope(
158 &self,
159 leaderboard_time_scope: GKLeaderboardTimeScope,
160 );
161
162 #[cfg(feature = "Foundation_NSString")]
163 #[deprecated]
164 #[method_id(@__retain_semantics Other leaderboardIdentifier)]
165 pub unsafe fn leaderboardIdentifier(&self) -> Option<Id<NSString>>;
166
167 #[cfg(feature = "Foundation_NSString")]
168 #[deprecated]
169 #[method(setLeaderboardIdentifier:)]
170 pub unsafe fn setLeaderboardIdentifier(&self, leaderboard_identifier: Option<&NSString>);
171
172 #[cfg(feature = "Foundation_NSString")]
173 #[deprecated]
174 #[method_id(@__retain_semantics Other leaderboardCategory)]
175 pub unsafe fn leaderboardCategory(&self) -> Option<Id<NSString>>;
176
177 #[cfg(feature = "Foundation_NSString")]
178 #[deprecated]
179 #[method(setLeaderboardCategory:)]
180 pub unsafe fn setLeaderboardCategory(&self, leaderboard_category: Option<&NSString>);
181 }
182);
183
184extern_protocol!(
185 pub unsafe trait GKGameCenterControllerDelegate: NSObjectProtocol {
186 #[cfg(feature = "GameKit_GKGameCenterViewController")]
187 #[method(gameCenterViewControllerDidFinish:)]
188 unsafe fn gameCenterViewControllerDidFinish(
189 &self,
190 game_center_view_controller: &GKGameCenterViewController,
191 );
192 }
193
194 unsafe impl ProtocolType for dyn GKGameCenterControllerDelegate {}
195);