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 GKAccessPointLocation(pub NSInteger);
impl GKAccessPointLocation {
#[doc(alias = "GKAccessPointLocationTopLeading")]
pub const TopLeading: Self = Self(0);
#[doc(alias = "GKAccessPointLocationTopTrailing")]
pub const TopTrailing: Self = Self(1);
#[doc(alias = "GKAccessPointLocationBottomLeading")]
pub const BottomLeading: Self = Self(2);
#[doc(alias = "GKAccessPointLocationBottomTrailing")]
pub const BottomTrailing: Self = Self(3);
}
unsafe impl Encode for GKAccessPointLocation {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for GKAccessPointLocation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GKAccessPoint;
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKAccessPoint {}
);
impl GKAccessPoint {
extern_methods!(
#[unsafe(method(shared))]
#[unsafe(method_family = none)]
pub unsafe fn shared() -> Retained<GKAccessPoint>;
#[unsafe(method(isActive))]
#[unsafe(method_family = none)]
pub unsafe fn isActive(&self) -> bool;
#[unsafe(method(setActive:))]
#[unsafe(method_family = none)]
pub unsafe fn setActive(&self, active: bool);
#[unsafe(method(isFocused))]
#[unsafe(method_family = none)]
pub unsafe fn isFocused(&self) -> bool;
#[unsafe(method(setFocused:))]
#[unsafe(method_family = none)]
pub unsafe fn setFocused(&self, focused: bool);
#[unsafe(method(isVisible))]
#[unsafe(method_family = none)]
pub unsafe fn isVisible(&self) -> bool;
#[unsafe(method(isPresentingGameCenter))]
#[unsafe(method_family = none)]
pub unsafe fn isPresentingGameCenter(&self) -> bool;
#[deprecated = "No longer supported"]
#[unsafe(method(showHighlights))]
#[unsafe(method_family = none)]
pub unsafe fn showHighlights(&self) -> bool;
#[deprecated = "No longer supported"]
#[unsafe(method(setShowHighlights:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowHighlights(&self, show_highlights: bool);
#[unsafe(method(location))]
#[unsafe(method_family = none)]
pub unsafe fn location(&self) -> GKAccessPointLocation;
#[unsafe(method(setLocation:))]
#[unsafe(method_family = none)]
pub unsafe fn setLocation(&self, location: GKAccessPointLocation);
#[unsafe(method(frameInScreenCoordinates))]
#[unsafe(method_family = none)]
pub unsafe fn frameInScreenCoordinates(&self) -> NSRect;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(parentWindow))]
#[unsafe(method_family = none)]
pub unsafe fn parentWindow(&self, mtm: MainThreadMarker) -> Option<Retained<NSWindow>>;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(setParentWindow:))]
#[unsafe(method_family = none)]
pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointWithHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithHandler(&self, handler: &block2::DynBlock<dyn Fn()>);
#[cfg(all(feature = "GKGameCenterViewController", feature = "block2"))]
#[unsafe(method(triggerAccessPointWithState:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithState_handler(
&self,
state: GKGameCenterViewControllerState,
handler: &block2::DynBlock<dyn Fn()>,
);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointWithAchievementID:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithAchievementID_handler(
&self,
achievement_id: &NSString,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointWithLeaderboardSetID:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithLeaderboardSetID_handler(
&self,
leaderboard_set_id: &NSString,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(all(feature = "GKLeaderboard", feature = "block2"))]
#[unsafe(method(triggerAccessPointWithLeaderboardID:playerScope:timeScope:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithLeaderboardID_playerScope_timeScope_handler(
&self,
leaderboard_id: &NSString,
player_scope: GKLeaderboardPlayerScope,
time_scope: GKLeaderboardTimeScope,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer", feature = "block2"))]
#[unsafe(method(triggerAccessPointWithPlayer:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithPlayer_handler(
&self,
player: &GKPlayer,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointForPlayTogetherWithHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointForPlayTogetherWithHandler(
&self,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointForChallengesWithHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointForChallengesWithHandler(
&self,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointWithChallengeDefinitionID:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithChallengeDefinitionID_handler(
&self,
challenge_definition_id: &NSString,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointWithGameActivityDefinitionID:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithGameActivityDefinitionID_handler(
&self,
game_activity_definition_id: &NSString,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(all(feature = "GKGameActivity", feature = "block2"))]
#[unsafe(method(triggerAccessPointWithGameActivity:handler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointWithGameActivity_handler(
&self,
game_activity: &GKGameActivity,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
#[cfg(feature = "block2")]
#[unsafe(method(triggerAccessPointForFriendingWithHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn triggerAccessPointForFriendingWithHandler(
&self,
handler: Option<&block2::DynBlock<dyn Fn()>>,
);
);
}
impl GKAccessPoint {
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>;
);
}