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_protocol!(
    /// Callbacks to the GKSession delegate.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gksessiondelegate?language=objc)
    #[deprecated]
    pub unsafe trait GKSessionDelegate: NSObjectProtocol {
        #[cfg(all(feature = "GKPublicConstants", feature = "GKSession"))]
        #[deprecated]
        #[optional]
        #[unsafe(method(session:peer:didChangeState:))]
        #[unsafe(method_family = none)]
        unsafe fn session_peer_didChangeState(
            &self,
            session: &GKSession,
            peer_id: &NSString,
            state: GKPeerConnectionState,
        );

        #[cfg(feature = "GKSession")]
        /// Indicates a connection request was received from another peer.
        ///
        /// Accept by calling -acceptConnectionFromPeer:
        /// Deny by calling -denyConnectionFromPeer:
        #[deprecated]
        #[optional]
        #[unsafe(method(session:didReceiveConnectionRequestFromPeer:))]
        #[unsafe(method_family = none)]
        unsafe fn session_didReceiveConnectionRequestFromPeer(
            &self,
            session: &GKSession,
            peer_id: &NSString,
        );

        #[cfg(feature = "GKSession")]
        /// Indicates a connection error occurred with a peer, which includes connection request failures, or disconnects due to timeouts.
        #[deprecated]
        #[optional]
        #[unsafe(method(session:connectionWithPeerFailed:withError:))]
        #[unsafe(method_family = none)]
        unsafe fn session_connectionWithPeerFailed_withError(
            &self,
            session: &GKSession,
            peer_id: &NSString,
            error: &NSError,
        );

        #[cfg(feature = "GKSession")]
        /// Indicates an error occurred with the session such as failing to make available.
        #[deprecated]
        #[optional]
        #[unsafe(method(session:didFailWithError:))]
        #[unsafe(method_family = none)]
        unsafe fn session_didFailWithError(&self, session: &GKSession, error: &NSError);
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkvoicechatclient?language=objc)
    #[deprecated]
    pub unsafe trait GKVoiceChatClient: NSObjectProtocol {
        #[cfg(feature = "GKVoiceChatService")]
        /// this channel will only be used to setup voice chat, and not to send audio data. The only requirement is that messages are sent and received within a few (1-2) seconds time.
        #[deprecated]
        #[unsafe(method(voiceChatService:sendData:toParticipantID:))]
        #[unsafe(method_family = none)]
        unsafe fn voiceChatService_sendData_toParticipantID(
            &self,
            voice_chat_service: &GKVoiceChatService,
            data: &NSData,
            participant_id: &NSString,
        );

        /// must be sent within some reasonble period of time and should accept at least 512 bytes.
        #[deprecated]
        #[unsafe(method(participantID))]
        #[unsafe(method_family = none)]
        unsafe fn participantID(&self) -> Retained<NSString>;

        #[cfg(feature = "GKVoiceChatService")]
        /// should be sent immediately with no delay on a UDP peer-to-peer connection.
        /// If this method is implemented, then the Voice Chat Service will not attempt to set up a peer-to-peer connection. And will rely on this one.  To transmit audio.
        #[deprecated]
        #[optional]
        #[unsafe(method(voiceChatService:sendRealTimeData:toParticipantID:))]
        #[unsafe(method_family = none)]
        unsafe fn voiceChatService_sendRealTimeData_toParticipantID(
            &self,
            voice_chat_service: &GKVoiceChatService,
            data: &NSData,
            participant_id: &NSString,
        );

        #[cfg(feature = "GKVoiceChatService")]
        #[deprecated]
        #[optional]
        #[unsafe(method(voiceChatService:didStartWithParticipantID:))]
        #[unsafe(method_family = none)]
        unsafe fn voiceChatService_didStartWithParticipantID(
            &self,
            voice_chat_service: &GKVoiceChatService,
            participant_id: &NSString,
        );

        #[cfg(feature = "GKVoiceChatService")]
        #[deprecated]
        #[optional]
        #[unsafe(method(voiceChatService:didNotStartWithParticipantID:error:))]
        #[unsafe(method_family = none)]
        unsafe fn voiceChatService_didNotStartWithParticipantID_error(
            &self,
            voice_chat_service: &GKVoiceChatService,
            participant_id: &NSString,
            error: Option<&NSError>,
        );

        #[cfg(feature = "GKVoiceChatService")]
        #[deprecated]
        #[optional]
        #[unsafe(method(voiceChatService:didStopWithParticipantID:error:))]
        #[unsafe(method_family = none)]
        unsafe fn voiceChatService_didStopWithParticipantID_error(
            &self,
            voice_chat_service: &GKVoiceChatService,
            participant_id: &NSString,
            error: Option<&NSError>,
        );

        #[cfg(feature = "GKVoiceChatService")]
        #[deprecated]
        #[optional]
        #[unsafe(method(voiceChatService:didReceiveInvitationFromParticipantID:callID:))]
        #[unsafe(method_family = none)]
        unsafe fn voiceChatService_didReceiveInvitationFromParticipantID_callID(
            &self,
            voice_chat_service: &GKVoiceChatService,
            participant_id: &NSString,
            call_id: NSInteger,
        );
    }
);