use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[deprecated = "No longer supported"]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct GKVoiceChatPlayerState(pub NSInteger);
impl GKVoiceChatPlayerState {
#[doc(alias = "GKVoiceChatPlayerConnected")]
#[deprecated = "No longer supported"]
pub const Connected: Self = Self(0);
#[doc(alias = "GKVoiceChatPlayerDisconnected")]
#[deprecated = "No longer supported"]
pub const Disconnected: Self = Self(1);
#[doc(alias = "GKVoiceChatPlayerSpeaking")]
#[deprecated = "No longer supported"]
pub const Speaking: Self = Self(2);
#[doc(alias = "GKVoiceChatPlayerSilent")]
#[deprecated = "No longer supported"]
pub const Silent: Self = Self(3);
#[doc(alias = "GKVoiceChatPlayerConnecting")]
#[deprecated = "No longer supported"]
pub const Connecting: Self = Self(4);
}
unsafe impl Encode for GKVoiceChatPlayerState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for GKVoiceChatPlayerState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "No longer supported"]
pub struct GKVoiceChat;
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKVoiceChat {}
);
impl GKVoiceChat {
extern_methods!(
#[deprecated = "No longer supported"]
#[unsafe(method(start))]
#[unsafe(method_family = none)]
pub unsafe fn start(&self);
#[deprecated = "No longer supported"]
#[unsafe(method(stop))]
#[unsafe(method_family = none)]
pub unsafe fn stop(&self);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[deprecated = "No longer supported"]
#[unsafe(method(setPlayer:muted:))]
#[unsafe(method_family = none)]
pub unsafe fn setPlayer_muted(&self, player: &GKPlayer, is_muted: bool);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer", feature = "block2"))]
#[deprecated = "No longer supported"]
#[unsafe(method(playerVoiceChatStateDidChangeHandler))]
#[unsafe(method_family = none)]
pub unsafe fn playerVoiceChatStateDidChangeHandler(
&self,
) -> NonNull<block2::DynBlock<dyn Fn(NonNull<GKPlayer>, GKVoiceChatPlayerState)>>;
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer", feature = "block2"))]
#[deprecated = "No longer supported"]
#[unsafe(method(setPlayerVoiceChatStateDidChangeHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setPlayerVoiceChatStateDidChangeHandler(
&self,
player_voice_chat_state_did_change_handler: &block2::DynBlock<
dyn Fn(NonNull<GKPlayer>, GKVoiceChatPlayerState),
>,
);
#[deprecated = "No longer supported"]
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[deprecated = "No longer supported"]
#[unsafe(method(isActive))]
#[unsafe(method_family = none)]
pub unsafe fn isActive(&self) -> bool;
#[deprecated = "No longer supported"]
#[unsafe(method(setActive:))]
#[unsafe(method_family = none)]
pub unsafe fn setActive(&self, active: bool);
#[deprecated = "No longer supported"]
#[unsafe(method(volume))]
#[unsafe(method_family = none)]
pub unsafe fn volume(&self) -> c_float;
#[deprecated = "No longer supported"]
#[unsafe(method(setVolume:))]
#[unsafe(method_family = none)]
pub unsafe fn setVolume(&self, volume: c_float);
#[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
#[deprecated = "No longer supported"]
#[unsafe(method(players))]
#[unsafe(method_family = none)]
pub unsafe fn players(&self) -> Retained<NSArray<GKPlayer>>;
#[deprecated = "No longer supported"]
#[unsafe(method(isVoIPAllowed))]
#[unsafe(method_family = none)]
pub unsafe fn isVoIPAllowed() -> bool;
);
}
impl GKVoiceChat {
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>;
);
}
#[deprecated = "No longer supported"]
impl GKVoiceChat {
extern_methods!(
#[cfg(feature = "block2")]
#[deprecated]
#[unsafe(method(playerStateUpdateHandler))]
#[unsafe(method_family = none)]
pub unsafe fn playerStateUpdateHandler(
&self,
) -> NonNull<block2::DynBlock<dyn Fn(NonNull<NSString>, GKVoiceChatPlayerState)>>;
#[cfg(feature = "block2")]
#[deprecated]
#[unsafe(method(setPlayerStateUpdateHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setPlayerStateUpdateHandler(
&self,
player_state_update_handler: &block2::DynBlock<
dyn Fn(NonNull<NSString>, GKVoiceChatPlayerState),
>,
);
);
}
#[deprecated = "No longer supported"]
impl GKVoiceChat {
extern_methods!(
#[deprecated]
#[unsafe(method(playerIDs))]
#[unsafe(method_family = none)]
pub unsafe fn playerIDs(&self) -> Option<Retained<NSArray<NSString>>>;
#[deprecated]
#[unsafe(method(setMute:forPlayer:))]
#[unsafe(method_family = none)]
pub unsafe fn setMute_forPlayer(&self, is_muted: bool, player_id: &NSString);
);
}