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::*;
extern_class!(
#[unsafe(super(NSViewController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
pub struct GKTurnBasedMatchmakerViewController;
);
#[cfg(all(feature = "GKDialogController", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl GKViewController for GKTurnBasedMatchmakerViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for GKTurnBasedMatchmakerViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSEditor for GKTurnBasedMatchmakerViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for GKTurnBasedMatchmakerViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSeguePerforming for GKTurnBasedMatchmakerViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for GKTurnBasedMatchmakerViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKTurnBasedMatchmakerViewController {
extern_methods!();
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl GKTurnBasedMatchmakerViewController {
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 GKTurnBasedMatchmakerViewController {
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 GKTurnBasedMatchmakerViewController {
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 GKTurnBasedMatchmakerViewController {
extern_methods!(
#[unsafe(method(turnBasedMatchmakerDelegate))]
#[unsafe(method_family = none)]
pub unsafe fn turnBasedMatchmakerDelegate(
&self,
) -> Option<Retained<ProtocolObject<dyn GKTurnBasedMatchmakerViewControllerDelegate>>>;
#[unsafe(method(setTurnBasedMatchmakerDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setTurnBasedMatchmakerDelegate(
&self,
turn_based_matchmaker_delegate: Option<
&ProtocolObject<dyn GKTurnBasedMatchmakerViewControllerDelegate>,
>,
);
#[unsafe(method(showExistingMatches))]
#[unsafe(method_family = none)]
pub unsafe fn showExistingMatches(&self) -> bool;
#[unsafe(method(setShowExistingMatches:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowExistingMatches(&self, show_existing_matches: bool);
#[cfg(feature = "GKMatchmakerViewController")]
#[unsafe(method(matchmakingMode))]
#[unsafe(method_family = none)]
pub unsafe fn matchmakingMode(&self) -> GKMatchmakingMode;
#[cfg(feature = "GKMatchmakerViewController")]
#[unsafe(method(setMatchmakingMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setMatchmakingMode(&self, matchmaking_mode: GKMatchmakingMode);
#[cfg(feature = "GKMatchmaker")]
#[unsafe(method(initWithMatchRequest:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithMatchRequest(
this: Allocated<Self>,
request: &GKMatchRequest,
) -> Retained<Self>;
);
}
extern_protocol!(
pub unsafe trait GKTurnBasedMatchmakerViewControllerDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(turnBasedMatchmakerViewControllerWasCancelled:))]
#[unsafe(method_family = none)]
unsafe fn turnBasedMatchmakerViewControllerWasCancelled(
&self,
view_controller: &GKTurnBasedMatchmakerViewController,
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(turnBasedMatchmakerViewController:didFailWithError:))]
#[unsafe(method_family = none)]
unsafe fn turnBasedMatchmakerViewController_didFailWithError(
&self,
view_controller: &GKTurnBasedMatchmakerViewController,
error: &NSError,
);
#[cfg(all(feature = "GKTurnBasedMatch", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
#[optional]
#[unsafe(method(turnBasedMatchmakerViewController:didFindMatch:))]
#[unsafe(method_family = none)]
unsafe fn turnBasedMatchmakerViewController_didFindMatch(
&self,
view_controller: &GKTurnBasedMatchmakerViewController,
r#match: &GKTurnBasedMatch,
);
#[cfg(all(feature = "GKTurnBasedMatch", feature = "objc2-app-kit"))]
#[cfg(target_os = "macos")]
#[deprecated]
#[optional]
#[unsafe(method(turnBasedMatchmakerViewController:playerQuitForMatch:))]
#[unsafe(method_family = none)]
unsafe fn turnBasedMatchmakerViewController_playerQuitForMatch(
&self,
view_controller: &GKTurnBasedMatchmakerViewController,
r#match: &GKTurnBasedMatch,
);
}
);