objc2_game_kit/generated/
GKAchievement.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct GKAchievement;
15);
16
17extern_conformance!(
18 unsafe impl NSCoding for GKAchievement {}
19);
20
21extern_conformance!(
22 unsafe impl NSObjectProtocol for GKAchievement {}
23);
24
25extern_conformance!(
26 unsafe impl NSSecureCoding for GKAchievement {}
27);
28
29impl GKAchievement {
30 extern_methods!(
31 #[cfg(feature = "block2")]
32 #[unsafe(method(loadAchievementsWithCompletionHandler:))]
34 #[unsafe(method_family = none)]
35 pub unsafe fn loadAchievementsWithCompletionHandler(
36 completion_handler: Option<
37 &block2::DynBlock<dyn Fn(*mut NSArray<GKAchievement>, *mut NSError)>,
38 >,
39 );
40
41 #[cfg(feature = "block2")]
42 #[unsafe(method(resetAchievementsWithCompletionHandler:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn resetAchievementsWithCompletionHandler(
49 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
50 );
51
52 #[unsafe(method(initWithIdentifier:))]
54 #[unsafe(method_family = init)]
55 pub unsafe fn initWithIdentifier(
56 this: Allocated<Self>,
57 identifier: &NSString,
58 ) -> Retained<Self>;
59
60 #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
61 #[unsafe(method(initWithIdentifier:player:))]
63 #[unsafe(method_family = init)]
64 pub unsafe fn initWithIdentifier_player(
65 this: Allocated<Self>,
66 identifier: &NSString,
67 player: &GKPlayer,
68 ) -> Retained<Self>;
69
70 #[cfg(feature = "block2")]
71 #[unsafe(method(reportAchievements:withCompletionHandler:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn reportAchievements_withCompletionHandler(
79 achievements: &NSArray<GKAchievement>,
80 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
81 );
82
83 #[unsafe(method(identifier))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn identifier(&self) -> Retained<NSString>;
87
88 #[unsafe(method(setIdentifier:))]
92 #[unsafe(method_family = none)]
93 pub unsafe fn setIdentifier(&self, identifier: &NSString);
94
95 #[unsafe(method(percentComplete))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn percentComplete(&self) -> c_double;
99
100 #[unsafe(method(setPercentComplete:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setPercentComplete(&self, percent_complete: c_double);
104
105 #[unsafe(method(isCompleted))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn isCompleted(&self) -> bool;
109
110 #[unsafe(method(lastReportedDate))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn lastReportedDate(&self) -> Retained<NSDate>;
114
115 #[unsafe(method(showsCompletionBanner))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn showsCompletionBanner(&self) -> bool;
119
120 #[unsafe(method(setShowsCompletionBanner:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setShowsCompletionBanner(&self, shows_completion_banner: bool);
124
125 #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
126 #[unsafe(method(player))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn player(&self) -> Retained<GKPlayer>;
130 );
131}
132
133impl GKAchievement {
135 extern_methods!(
136 #[unsafe(method(init))]
137 #[unsafe(method_family = init)]
138 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
139
140 #[unsafe(method(new))]
141 #[unsafe(method_family = new)]
142 pub unsafe fn new() -> Retained<Self>;
143 );
144}
145
146impl GKAchievement {
148 extern_methods!(
149 #[cfg(feature = "block2")]
150 #[deprecated]
151 #[unsafe(method(reportAchievementWithCompletionHandler:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn reportAchievementWithCompletionHandler(
154 &self,
155 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
156 );
157
158 #[deprecated]
159 #[unsafe(method(isHidden))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn isHidden(&self) -> bool;
162 );
163}
164
165impl GKAchievement {
167 extern_methods!(
168 #[deprecated]
170 #[unsafe(method(initWithIdentifier:forPlayer:))]
171 #[unsafe(method_family = init)]
172 pub unsafe fn initWithIdentifier_forPlayer(
173 this: Allocated<Self>,
174 identifier: Option<&NSString>,
175 player_id: &NSString,
176 ) -> Option<Retained<Self>>;
177
178 #[deprecated]
180 #[unsafe(method(playerID))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn playerID(&self) -> Option<Retained<NSString>>;
183 );
184}