objc2_game_kit/generated/
GKChallengeEventHandler.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_protocol!(
10 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
14 pub unsafe trait GKChallengeEventHandlerDelegate: NSObjectProtocol {
15 #[cfg(feature = "GKChallenge")]
16 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
22 #[optional]
23 #[unsafe(method(localPlayerDidSelectChallenge:))]
24 #[unsafe(method_family = none)]
25 unsafe fn localPlayerDidSelectChallenge(&self, challenge: Option<&GKChallenge>);
26
27 #[cfg(feature = "GKChallenge")]
28 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
34 #[optional]
35 #[unsafe(method(shouldShowBannerForLocallyReceivedChallenge:))]
36 #[unsafe(method_family = none)]
37 unsafe fn shouldShowBannerForLocallyReceivedChallenge(
38 &self,
39 challenge: Option<&GKChallenge>,
40 ) -> bool;
41
42 #[cfg(feature = "GKChallenge")]
43 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
49 #[optional]
50 #[unsafe(method(localPlayerDidReceiveChallenge:))]
51 #[unsafe(method_family = none)]
52 unsafe fn localPlayerDidReceiveChallenge(&self, challenge: Option<&GKChallenge>);
53
54 #[cfg(feature = "GKChallenge")]
55 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
61 #[optional]
62 #[unsafe(method(shouldShowBannerForLocallyCompletedChallenge:))]
63 #[unsafe(method_family = none)]
64 unsafe fn shouldShowBannerForLocallyCompletedChallenge(
65 &self,
66 challenge: Option<&GKChallenge>,
67 ) -> bool;
68
69 #[cfg(feature = "GKChallenge")]
70 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
76 #[optional]
77 #[unsafe(method(localPlayerDidCompleteChallenge:))]
78 #[unsafe(method_family = none)]
79 unsafe fn localPlayerDidCompleteChallenge(&self, challenge: Option<&GKChallenge>);
80
81 #[cfg(feature = "GKChallenge")]
82 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
88 #[optional]
89 #[unsafe(method(shouldShowBannerForRemotelyCompletedChallenge:))]
90 #[unsafe(method_family = none)]
91 unsafe fn shouldShowBannerForRemotelyCompletedChallenge(
92 &self,
93 challenge: Option<&GKChallenge>,
94 ) -> bool;
95
96 #[cfg(feature = "GKChallenge")]
97 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
103 #[optional]
104 #[unsafe(method(remotePlayerDidCompleteChallenge:))]
105 #[unsafe(method_family = none)]
106 unsafe fn remotePlayerDidCompleteChallenge(&self, challenge: Option<&GKChallenge>);
107 }
108);
109
110extern_class!(
111 #[unsafe(super(NSObject))]
115 #[derive(Debug, PartialEq, Eq, Hash)]
116 #[deprecated = "You should instead implement the GKChallengeListener protocol and register a listener with GKLocalPlayer."]
117 pub struct GKChallengeEventHandler;
118);
119
120extern_conformance!(
121 unsafe impl NSObjectProtocol for GKChallengeEventHandler {}
122);
123
124impl GKChallengeEventHandler {
125 extern_methods!(
126 #[deprecated = "No longer supported."]
127 #[unsafe(method(challengeEventHandler))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn challengeEventHandler() -> Option<Retained<GKChallengeEventHandler>>;
130
131 #[deprecated = "No longer supported."]
132 #[unsafe(method(delegate))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn delegate(
135 &self,
136 ) -> Option<Retained<ProtocolObject<dyn GKChallengeEventHandlerDelegate>>>;
137
138 #[deprecated = "No longer supported."]
146 #[unsafe(method(setDelegate:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn setDelegate(
149 &self,
150 delegate: Option<&ProtocolObject<dyn GKChallengeEventHandlerDelegate>>,
151 );
152 );
153}
154
155impl GKChallengeEventHandler {
157 extern_methods!(
158 #[unsafe(method(init))]
159 #[unsafe(method_family = init)]
160 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
161
162 #[unsafe(method(new))]
163 #[unsafe(method_family = new)]
164 pub unsafe fn new() -> Retained<Self>;
165 );
166}