icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::Foundation::*;
use crate::GameKit::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "GameKit_GKScore")]
    #[deprecated]
    pub struct GKScore;

    #[cfg(feature = "GameKit_GKScore")]
    unsafe impl ClassType for GKScore {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "GameKit_GKScore")]
unsafe impl NSCoding for GKScore {}

#[cfg(feature = "GameKit_GKScore")]
unsafe impl NSObjectProtocol for GKScore {}

#[cfg(feature = "GameKit_GKScore")]
unsafe impl NSSecureCoding for GKScore {}

extern_methods!(
    #[cfg(feature = "GameKit_GKScore")]
    unsafe impl GKScore {
        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Init initWithLeaderboardIdentifier:)]
        pub unsafe fn initWithLeaderboardIdentifier(
            this: Allocated<Self>,
            identifier: &NSString,
        ) -> Id<Self>;

        #[cfg(all(feature = "Foundation_NSString", feature = "GameKit_GKPlayer"))]
        #[method_id(@__retain_semantics Init initWithLeaderboardIdentifier:player:)]
        pub unsafe fn initWithLeaderboardIdentifier_player(
            this: Allocated<Self>,
            identifier: &NSString,
            player: &GKPlayer,
        ) -> Id<Self>;

        #[deprecated]
        #[method(value)]
        pub unsafe fn value(&self) -> i64;

        #[deprecated]
        #[method(setValue:)]
        pub unsafe fn setValue(&self, value: i64);

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other formattedValue)]
        pub unsafe fn formattedValue(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other leaderboardIdentifier)]
        pub unsafe fn leaderboardIdentifier(&self) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setLeaderboardIdentifier:)]
        pub unsafe fn setLeaderboardIdentifier(&self, leaderboard_identifier: &NSString);

        #[method(context)]
        pub unsafe fn context(&self) -> u64;

        #[method(setContext:)]
        pub unsafe fn setContext(&self, context: u64);

        #[cfg(feature = "Foundation_NSDate")]
        #[deprecated]
        #[method_id(@__retain_semantics Other date)]
        pub unsafe fn date(&self) -> Id<NSDate>;

        #[cfg(feature = "GameKit_GKPlayer")]
        #[method_id(@__retain_semantics Other player)]
        pub unsafe fn player(&self) -> Option<Id<GKPlayer>>;

        #[deprecated]
        #[method(rank)]
        pub unsafe fn rank(&self) -> NSInteger;

        #[method(shouldSetDefaultLeaderboard)]
        pub unsafe fn shouldSetDefaultLeaderboard(&self) -> bool;

        #[method(setShouldSetDefaultLeaderboard:)]
        pub unsafe fn setShouldSetDefaultLeaderboard(&self, should_set_default_leaderboard: bool);

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSError"))]
        #[method(reportScores:withCompletionHandler:)]
        pub unsafe fn reportScores_withCompletionHandler(
            scores: &NSArray<GKScore>,
            completion_handler: Option<&Block<(*mut NSError,), ()>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "GameKit_GKScore")]
    unsafe impl GKScore {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);

extern_methods!(
    /// Deprecated
    #[cfg(feature = "GameKit_GKScore")]
    unsafe impl GKScore {
        #[cfg(feature = "Foundation_NSError")]
        #[deprecated]
        #[method(reportScoreWithCompletionHandler:)]
        pub unsafe fn reportScoreWithCompletionHandler(
            &self,
            completion_handler: Option<&Block<(*mut NSError,), ()>>,
        );

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Init initWithCategory:)]
        pub unsafe fn initWithCategory(
            this: Allocated<Self>,
            category: Option<&NSString>,
        ) -> Id<Self>;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other category)]
        pub unsafe fn category(&self) -> Option<Id<NSString>>;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method(setCategory:)]
        pub unsafe fn setCategory(&self, category: Option<&NSString>);
    }
);

extern_methods!(
    /// Obsoleted
    #[cfg(feature = "GameKit_GKScore")]
    unsafe impl GKScore {
        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Init initWithLeaderboardIdentifier:forPlayer:)]
        pub unsafe fn initWithLeaderboardIdentifier_forPlayer(
            this: Allocated<Self>,
            identifier: &NSString,
            player_id: &NSString,
        ) -> Option<Id<Self>>;

        #[cfg(feature = "Foundation_NSString")]
        #[deprecated]
        #[method_id(@__retain_semantics Other playerID)]
        pub unsafe fn playerID(&self) -> Option<Id<NSString>>;
    }
);