objc2-game-kit 0.3.2

Bindings to the GameKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// This a not a Game Center feature. To support voice chat as part of Game Center online play, see GKVoiceChat.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkvoicechatservice?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated = "Use SharePlay instead"]
    pub struct GKVoiceChatService;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for GKVoiceChatService {}
);

impl GKVoiceChatService {
    extern_methods!(
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(defaultVoiceChatService))]
        #[unsafe(method_family = none)]
        pub unsafe fn defaultVoiceChatService() -> Option<Retained<GKVoiceChatService>>;

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(isVoIPAllowed))]
        #[unsafe(method_family = none)]
        pub unsafe fn isVoIPAllowed() -> bool;

        #[cfg(feature = "GKPublicProtocols")]
        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[deprecated = "No longer supported."]
        #[unsafe(method(client))]
        #[unsafe(method_family = none)]
        pub unsafe fn client(&self) -> Option<Retained<ProtocolObject<dyn GKVoiceChatClient>>>;

        #[cfg(feature = "GKPublicProtocols")]
        /// Setter for [`client`][Self::client].
        ///
        /// # Safety
        ///
        /// - `client` might not allow `None`.
        /// - This is unretained, you must ensure the object is kept alive while in use.
        #[deprecated = "No longer supported."]
        #[unsafe(method(setClient:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setClient(&self, client: Option<&ProtocolObject<dyn GKVoiceChatClient>>);

        /// # Safety
        ///
        /// - `participant_id` might not allow `None`.
        /// - `error` might not allow `None`.
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(startVoiceChatWithParticipantID:error:))]
        #[unsafe(method_family = none)]
        pub unsafe fn startVoiceChatWithParticipantID_error(
            &self,
            participant_id: Option<&NSString>,
            error: Option<&mut Option<Retained<NSError>>>,
        ) -> bool;

        /// # Safety
        ///
        /// `participant_id` might not allow `None`.
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(stopVoiceChatWithParticipantID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn stopVoiceChatWithParticipantID(&self, participant_id: Option<&NSString>);

        /// # Safety
        ///
        /// `error` might not allow `None`.
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(acceptCallID:error:))]
        #[unsafe(method_family = none)]
        pub unsafe fn acceptCallID_error(
            &self,
            call_id: NSInteger,
            error: Option<&mut Option<Retained<NSError>>>,
        ) -> bool;

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(denyCallID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn denyCallID(&self, call_id: NSInteger);

        /// # Safety
        ///
        /// - `audio` might not allow `None`.
        /// - `participant_id` might not allow `None`.
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(receivedRealTimeData:fromParticipantID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn receivedRealTimeData_fromParticipantID(
            &self,
            audio: Option<&NSData>,
            participant_id: Option<&NSString>,
        );

        /// # Safety
        ///
        /// - `arbitrary_data` might not allow `None`.
        /// - `participant_id` might not allow `None`.
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(receivedData:fromParticipantID:))]
        #[unsafe(method_family = none)]
        pub unsafe fn receivedData_fromParticipantID(
            &self,
            arbitrary_data: Option<&NSData>,
            participant_id: Option<&NSString>,
        );

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(isMicrophoneMuted))]
        #[unsafe(method_family = none)]
        pub unsafe fn isMicrophoneMuted(&self) -> bool;

        /// Setter for [`isMicrophoneMuted`][Self::isMicrophoneMuted].
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(setMicrophoneMuted:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMicrophoneMuted(&self, microphone_muted: bool);

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(remoteParticipantVolume))]
        #[unsafe(method_family = none)]
        pub unsafe fn remoteParticipantVolume(&self) -> c_float;

        /// Setter for [`remoteParticipantVolume`][Self::remoteParticipantVolume].
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(setRemoteParticipantVolume:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setRemoteParticipantVolume(&self, remote_participant_volume: c_float);

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(isOutputMeteringEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isOutputMeteringEnabled(&self) -> bool;

        /// Setter for [`isOutputMeteringEnabled`][Self::isOutputMeteringEnabled].
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(setOutputMeteringEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOutputMeteringEnabled(&self, output_metering_enabled: bool);

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(isInputMeteringEnabled))]
        #[unsafe(method_family = none)]
        pub unsafe fn isInputMeteringEnabled(&self) -> bool;

        /// Setter for [`isInputMeteringEnabled`][Self::isInputMeteringEnabled].
        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(setInputMeteringEnabled:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setInputMeteringEnabled(&self, input_metering_enabled: bool);

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(outputMeterLevel))]
        #[unsafe(method_family = none)]
        pub unsafe fn outputMeterLevel(&self) -> c_float;

        #[deprecated = "Use SharePlay instead"]
        #[unsafe(method(inputMeterLevel))]
        #[unsafe(method_family = none)]
        pub unsafe fn inputMeterLevel(&self) -> c_float;
    );
}

/// Methods declared on superclass `NSObject`.
impl GKVoiceChatService {
    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>;
    );
}