use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GKGameCenterViewControllerState(pub NSInteger);
impl GKGameCenterViewControllerState {
#[doc(alias = "GKGameCenterViewControllerStateDefault")]
pub const Default: Self = Self(-1);
#[doc(alias = "GKGameCenterViewControllerStateLeaderboards")]
pub const Leaderboards: Self = Self(0);
#[doc(alias = "GKGameCenterViewControllerStateAchievements")]
pub const Achievements: Self = Self(1);
#[doc(alias = "GKGameCenterViewControllerStateChallenges")]
#[deprecated]
pub const Challenges: Self = Self(2);
#[doc(alias = "GKGameCenterViewControllerStateLocalPlayerProfile")]
pub const LocalPlayerProfile: Self = Self(3);
#[doc(alias = "GKGameCenterViewControllerStateDashboard")]
pub const Dashboard: Self = Self(4);
#[doc(alias = "GKGameCenterViewControllerStateLocalPlayerFriendsList")]
pub const LocalPlayerFriendsList: Self = Self(5);
}
unsafe impl Encode for GKGameCenterViewControllerState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for GKGameCenterViewControllerState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSViewController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[deprecated]
pub struct GKGameCenterViewController;
);
#[cfg(all(feature = "GKDialogController", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl GKViewController for GKGameCenterViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for GKGameCenterViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSEditor for GKGameCenterViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for GKGameCenterViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSeguePerforming for GKGameCenterViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for GKGameCenterViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKGameCenterViewController {
extern_methods!();
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKGameCenterViewController {
extern_methods!(
#[unsafe(method(initWithNibName:bundle:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSNibName>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKGameCenterViewController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKGameCenterViewController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKGameCenterViewController {
extern_methods!(
#[unsafe(method(gameCenterDelegate))]
#[unsafe(method_family = none)]
pub unsafe fn gameCenterDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn GKGameCenterControllerDelegate>>>;
#[unsafe(method(setGameCenterDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setGameCenterDelegate(
&self,
game_center_delegate: Option<&ProtocolObject<dyn GKGameCenterControllerDelegate>>,
);
#[unsafe(method(initWithState:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithState(
this: Allocated<Self>,
state: GKGameCenterViewControllerState,
) -> Retained<Self>;
#[cfg(feature = "GKLeaderboard")]
#[unsafe(method(initWithLeaderboardID:playerScope:timeScope:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLeaderboardID_playerScope_timeScope(
this: Allocated<Self>,
leaderboard_id: &NSString,
player_scope: GKLeaderboardPlayerScope,
time_scope: GKLeaderboardTimeScope,
) -> Retained<Self>;
#[cfg(feature = "GKLeaderboard")]
#[unsafe(method(initWithLeaderboard:playerScope:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLeaderboard_playerScope(
this: Allocated<Self>,
leaderboard: &GKLeaderboard,
player_scope: GKLeaderboardPlayerScope,
) -> Retained<Self>;
#[unsafe(method(initWithLeaderboardSetID:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithLeaderboardSetID(
this: Allocated<Self>,
leaderboard_set_id: &NSString,
) -> Retained<Self>;
#[unsafe(method(initWithAchievementID:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithAchievementID(
this: Allocated<Self>,
achievement_id: &NSString,
) -> Retained<Self>;
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[unsafe(method(initWithPlayer:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithPlayer(this: Allocated<Self>, player: &GKPlayer) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKGameCenterViewController {
extern_methods!(
#[deprecated]
#[unsafe(method(viewState))]
#[unsafe(method_family = none)]
pub unsafe fn viewState(&self) -> GKGameCenterViewControllerState;
#[deprecated]
#[unsafe(method(setViewState:))]
#[unsafe(method_family = none)]
pub unsafe fn setViewState(&self, view_state: GKGameCenterViewControllerState);
#[cfg(feature = "GKLeaderboard")]
#[deprecated]
#[unsafe(method(leaderboardTimeScope))]
#[unsafe(method_family = none)]
pub unsafe fn leaderboardTimeScope(&self) -> GKLeaderboardTimeScope;
#[cfg(feature = "GKLeaderboard")]
#[deprecated]
#[unsafe(method(setLeaderboardTimeScope:))]
#[unsafe(method_family = none)]
pub unsafe fn setLeaderboardTimeScope(
&self,
leaderboard_time_scope: GKLeaderboardTimeScope,
);
#[deprecated]
#[unsafe(method(leaderboardIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn leaderboardIdentifier(&self) -> Option<Retained<NSString>>;
#[deprecated]
#[unsafe(method(setLeaderboardIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setLeaderboardIdentifier(&self, leaderboard_identifier: Option<&NSString>);
#[deprecated]
#[unsafe(method(leaderboardCategory))]
#[unsafe(method_family = none)]
pub unsafe fn leaderboardCategory(&self) -> Option<Retained<NSString>>;
#[deprecated]
#[unsafe(method(setLeaderboardCategory:))]
#[unsafe(method_family = none)]
pub unsafe fn setLeaderboardCategory(&self, leaderboard_category: Option<&NSString>);
);
}
extern_protocol!(
#[deprecated]
pub unsafe trait GKGameCenterControllerDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(gameCenterViewControllerDidFinish:))]
#[unsafe(method_family = none)]
unsafe fn gameCenterViewControllerDidFinish(
&self,
game_center_view_controller: &GKGameCenterViewController,
);
}
);