objc2_game_kit/generated/
GKPublicProtocols.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_protocol!(
11    /// Callbacks to the GKSession delegate.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gksessiondelegate?language=objc)
14    #[deprecated]
15    pub unsafe trait GKSessionDelegate: NSObjectProtocol {
16        #[cfg(all(feature = "GKPublicConstants", feature = "GKSession"))]
17        #[deprecated]
18        #[optional]
19        #[unsafe(method(session:peer:didChangeState:))]
20        #[unsafe(method_family = none)]
21        unsafe fn session_peer_didChangeState(
22            &self,
23            session: &GKSession,
24            peer_id: &NSString,
25            state: GKPeerConnectionState,
26        );
27
28        #[cfg(feature = "GKSession")]
29        /// Indicates a connection request was received from another peer.
30        ///
31        /// Accept by calling -acceptConnectionFromPeer:
32        /// Deny by calling -denyConnectionFromPeer:
33        #[deprecated]
34        #[optional]
35        #[unsafe(method(session:didReceiveConnectionRequestFromPeer:))]
36        #[unsafe(method_family = none)]
37        unsafe fn session_didReceiveConnectionRequestFromPeer(
38            &self,
39            session: &GKSession,
40            peer_id: &NSString,
41        );
42
43        #[cfg(feature = "GKSession")]
44        /// Indicates a connection error occurred with a peer, which includes connection request failures, or disconnects due to timeouts.
45        #[deprecated]
46        #[optional]
47        #[unsafe(method(session:connectionWithPeerFailed:withError:))]
48        #[unsafe(method_family = none)]
49        unsafe fn session_connectionWithPeerFailed_withError(
50            &self,
51            session: &GKSession,
52            peer_id: &NSString,
53            error: &NSError,
54        );
55
56        #[cfg(feature = "GKSession")]
57        /// Indicates an error occurred with the session such as failing to make available.
58        #[deprecated]
59        #[optional]
60        #[unsafe(method(session:didFailWithError:))]
61        #[unsafe(method_family = none)]
62        unsafe fn session_didFailWithError(&self, session: &GKSession, error: &NSError);
63    }
64);
65
66extern_protocol!(
67    /// [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkvoicechatclient?language=objc)
68    #[deprecated]
69    pub unsafe trait GKVoiceChatClient: NSObjectProtocol {
70        #[cfg(feature = "GKVoiceChatService")]
71        /// 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.
72        #[deprecated]
73        #[unsafe(method(voiceChatService:sendData:toParticipantID:))]
74        #[unsafe(method_family = none)]
75        unsafe fn voiceChatService_sendData_toParticipantID(
76            &self,
77            voice_chat_service: &GKVoiceChatService,
78            data: &NSData,
79            participant_id: &NSString,
80        );
81
82        /// must be sent within some reasonble period of time and should accept at least 512 bytes.
83        #[deprecated]
84        #[unsafe(method(participantID))]
85        #[unsafe(method_family = none)]
86        unsafe fn participantID(&self) -> Retained<NSString>;
87
88        #[cfg(feature = "GKVoiceChatService")]
89        /// should be sent immediately with no delay on a UDP peer-to-peer connection.
90        /// 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.
91        #[deprecated]
92        #[optional]
93        #[unsafe(method(voiceChatService:sendRealTimeData:toParticipantID:))]
94        #[unsafe(method_family = none)]
95        unsafe fn voiceChatService_sendRealTimeData_toParticipantID(
96            &self,
97            voice_chat_service: &GKVoiceChatService,
98            data: &NSData,
99            participant_id: &NSString,
100        );
101
102        #[cfg(feature = "GKVoiceChatService")]
103        #[deprecated]
104        #[optional]
105        #[unsafe(method(voiceChatService:didStartWithParticipantID:))]
106        #[unsafe(method_family = none)]
107        unsafe fn voiceChatService_didStartWithParticipantID(
108            &self,
109            voice_chat_service: &GKVoiceChatService,
110            participant_id: &NSString,
111        );
112
113        #[cfg(feature = "GKVoiceChatService")]
114        #[deprecated]
115        #[optional]
116        #[unsafe(method(voiceChatService:didNotStartWithParticipantID:error:))]
117        #[unsafe(method_family = none)]
118        unsafe fn voiceChatService_didNotStartWithParticipantID_error(
119            &self,
120            voice_chat_service: &GKVoiceChatService,
121            participant_id: &NSString,
122            error: Option<&NSError>,
123        );
124
125        #[cfg(feature = "GKVoiceChatService")]
126        #[deprecated]
127        #[optional]
128        #[unsafe(method(voiceChatService:didStopWithParticipantID:error:))]
129        #[unsafe(method_family = none)]
130        unsafe fn voiceChatService_didStopWithParticipantID_error(
131            &self,
132            voice_chat_service: &GKVoiceChatService,
133            participant_id: &NSString,
134            error: Option<&NSError>,
135        );
136
137        #[cfg(feature = "GKVoiceChatService")]
138        #[deprecated]
139        #[optional]
140        #[unsafe(method(voiceChatService:didReceiveInvitationFromParticipantID:callID:))]
141        #[unsafe(method_family = none)]
142        unsafe fn voiceChatService_didReceiveInvitationFromParticipantID_callID(
143            &self,
144            voice_chat_service: &GKVoiceChatService,
145            participant_id: &NSString,
146            call_id: NSInteger,
147        );
148    }
149);