use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GKAchievement;
);
extern_conformance!(
unsafe impl NSCoding for GKAchievement {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKAchievement {}
);
extern_conformance!(
unsafe impl NSSecureCoding for GKAchievement {}
);
impl GKAchievement {
extern_methods!(
#[cfg(feature = "block2")]
#[unsafe(method(loadAchievementsWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn loadAchievementsWithCompletionHandler(
completion_handler: Option<
&block2::DynBlock<dyn Fn(*mut NSArray<GKAchievement>, *mut NSError)>,
>,
);
#[cfg(feature = "block2")]
#[unsafe(method(resetAchievementsWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn resetAchievementsWithCompletionHandler(
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[unsafe(method(initWithIdentifier:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithIdentifier(
this: Allocated<Self>,
identifier: &NSString,
) -> Retained<Self>;
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[unsafe(method(initWithIdentifier:player:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithIdentifier_player(
this: Allocated<Self>,
identifier: &NSString,
player: &GKPlayer,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(reportAchievements:withCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn reportAchievements_withCompletionHandler(
achievements: &NSArray<GKAchievement>,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[unsafe(method(identifier))]
#[unsafe(method_family = none)]
pub unsafe fn identifier(&self) -> Retained<NSString>;
#[unsafe(method(setIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setIdentifier(&self, identifier: &NSString);
#[unsafe(method(percentComplete))]
#[unsafe(method_family = none)]
pub unsafe fn percentComplete(&self) -> c_double;
#[unsafe(method(setPercentComplete:))]
#[unsafe(method_family = none)]
pub unsafe fn setPercentComplete(&self, percent_complete: c_double);
#[unsafe(method(isCompleted))]
#[unsafe(method_family = none)]
pub unsafe fn isCompleted(&self) -> bool;
#[unsafe(method(lastReportedDate))]
#[unsafe(method_family = none)]
pub unsafe fn lastReportedDate(&self) -> Retained<NSDate>;
#[unsafe(method(showsCompletionBanner))]
#[unsafe(method_family = none)]
pub unsafe fn showsCompletionBanner(&self) -> bool;
#[unsafe(method(setShowsCompletionBanner:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsCompletionBanner(&self, shows_completion_banner: bool);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[unsafe(method(player))]
#[unsafe(method_family = none)]
pub unsafe fn player(&self) -> Retained<GKPlayer>;
);
}
impl GKAchievement {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
impl GKAchievement {
extern_methods!(
#[cfg(feature = "block2")]
#[deprecated]
#[unsafe(method(reportAchievementWithCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn reportAchievementWithCompletionHandler(
&self,
completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
);
#[deprecated]
#[unsafe(method(isHidden))]
#[unsafe(method_family = none)]
pub unsafe fn isHidden(&self) -> bool;
);
}
impl GKAchievement {
extern_methods!(
#[deprecated]
#[unsafe(method(initWithIdentifier:forPlayer:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithIdentifier_forPlayer(
this: Allocated<Self>,
identifier: Option<&NSString>,
player_id: &NSString,
) -> Option<Retained<Self>>;
#[deprecated]
#[unsafe(method(playerID))]
#[unsafe(method_family = none)]
pub unsafe fn playerID(&self) -> Option<Retained<NSString>>;
);
}