objc2_game_kit/generated/
GKVoiceChat.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
10/// [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkvoicechatplayerstate?language=objc)
11// NS_ENUM
12#[deprecated = "No longer supported"]
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct GKVoiceChatPlayerState(pub NSInteger);
16impl GKVoiceChatPlayerState {
17    #[doc(alias = "GKVoiceChatPlayerConnected")]
18    #[deprecated = "No longer supported"]
19    pub const Connected: Self = Self(0);
20    #[doc(alias = "GKVoiceChatPlayerDisconnected")]
21    #[deprecated = "No longer supported"]
22    pub const Disconnected: Self = Self(1);
23    #[doc(alias = "GKVoiceChatPlayerSpeaking")]
24    #[deprecated = "No longer supported"]
25    pub const Speaking: Self = Self(2);
26    #[doc(alias = "GKVoiceChatPlayerSilent")]
27    #[deprecated = "No longer supported"]
28    pub const Silent: Self = Self(3);
29    #[doc(alias = "GKVoiceChatPlayerConnecting")]
30    #[deprecated = "No longer supported"]
31    pub const Connecting: Self = Self(4);
32}
33
34unsafe impl Encode for GKVoiceChatPlayerState {
35    const ENCODING: Encoding = NSInteger::ENCODING;
36}
37
38unsafe impl RefEncode for GKVoiceChatPlayerState {
39    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42extern_class!(
43    /// GKVoiceChat represents an instance of a named voice communications channel
44    ///
45    /// See also [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkvoicechat?language=objc)
46    #[unsafe(super(NSObject))]
47    #[derive(Debug, PartialEq, Eq, Hash)]
48    #[deprecated = "No longer supported"]
49    pub struct GKVoiceChat;
50);
51
52extern_conformance!(
53    unsafe impl NSObjectProtocol for GKVoiceChat {}
54);
55
56impl GKVoiceChat {
57    extern_methods!(
58        #[deprecated = "No longer supported"]
59        #[unsafe(method(start))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn start(&self);
62
63        /// start receiving audio from the chat
64        #[deprecated = "No longer supported"]
65        #[unsafe(method(stop))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn stop(&self);
68
69        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
70        /// stop receiving audio from the chat
71        #[deprecated = "No longer supported"]
72        #[unsafe(method(setPlayer:muted:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setPlayer_muted(&self, player: &GKPlayer, is_muted: bool);
75
76        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer", feature = "block2"))]
77        /// # Safety
78        ///
79        /// The returned block's argument 1 must be a valid pointer.
80        #[deprecated = "No longer supported"]
81        #[unsafe(method(playerVoiceChatStateDidChangeHandler))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn playerVoiceChatStateDidChangeHandler(
84            &self,
85        ) -> NonNull<block2::DynBlock<dyn Fn(NonNull<GKPlayer>, GKVoiceChatPlayerState)>>;
86
87        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer", feature = "block2"))]
88        /// Setter for [`playerVoiceChatStateDidChangeHandler`][Self::playerVoiceChatStateDidChangeHandler].
89        ///
90        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
91        #[deprecated = "No longer supported"]
92        #[unsafe(method(setPlayerVoiceChatStateDidChangeHandler:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setPlayerVoiceChatStateDidChangeHandler(
95            &self,
96            player_voice_chat_state_did_change_handler: &block2::DynBlock<
97                dyn Fn(NonNull<GKPlayer>, GKVoiceChatPlayerState),
98            >,
99        );
100
101        #[deprecated = "No longer supported"]
102        #[unsafe(method(name))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn name(&self) -> Retained<NSString>;
105
106        #[deprecated = "No longer supported"]
107        #[unsafe(method(isActive))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn isActive(&self) -> bool;
110
111        /// Setter for [`isActive`][Self::isActive].
112        #[deprecated = "No longer supported"]
113        #[unsafe(method(setActive:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setActive(&self, active: bool);
116
117        #[deprecated = "No longer supported"]
118        #[unsafe(method(volume))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn volume(&self) -> c_float;
121
122        /// Setter for [`volume`][Self::volume].
123        #[deprecated = "No longer supported"]
124        #[unsafe(method(setVolume:))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn setVolume(&self, volume: c_float);
127
128        #[cfg(all(feature = "GKBasePlayer", feature = "GKPlayer"))]
129        #[deprecated = "No longer supported"]
130        #[unsafe(method(players))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn players(&self) -> Retained<NSArray<GKPlayer>>;
133
134        #[deprecated = "No longer supported"]
135        #[unsafe(method(isVoIPAllowed))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn isVoIPAllowed() -> bool;
138    );
139}
140
141/// Methods declared on superclass `NSObject`.
142impl GKVoiceChat {
143    extern_methods!(
144        #[unsafe(method(init))]
145        #[unsafe(method_family = init)]
146        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
147
148        #[unsafe(method(new))]
149        #[unsafe(method_family = new)]
150        pub unsafe fn new() -> Retained<Self>;
151    );
152}
153
154/// Deprecated.
155#[deprecated = "No longer supported"]
156impl GKVoiceChat {
157    extern_methods!(
158        #[cfg(feature = "block2")]
159        /// # Safety
160        ///
161        /// The returned block's argument 1 must be a valid pointer.
162        #[deprecated]
163        #[unsafe(method(playerStateUpdateHandler))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn playerStateUpdateHandler(
166            &self,
167        ) -> NonNull<block2::DynBlock<dyn Fn(NonNull<NSString>, GKVoiceChatPlayerState)>>;
168
169        #[cfg(feature = "block2")]
170        /// Setter for [`playerStateUpdateHandler`][Self::playerStateUpdateHandler].
171        ///
172        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
173        #[deprecated]
174        #[unsafe(method(setPlayerStateUpdateHandler:))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn setPlayerStateUpdateHandler(
177            &self,
178            player_state_update_handler: &block2::DynBlock<
179                dyn Fn(NonNull<NSString>, GKVoiceChatPlayerState),
180            >,
181        );
182    );
183}
184
185/// Obsoleted.
186#[deprecated = "No longer supported"]
187impl GKVoiceChat {
188    extern_methods!(
189        /// * This property is obsolete. **
190        #[deprecated]
191        #[unsafe(method(playerIDs))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn playerIDs(&self) -> Option<Retained<NSArray<NSString>>>;
194
195        /// * This method is obsolete. It will never be invoked and its implementation does nothing**
196        #[deprecated]
197        #[unsafe(method(setMute:forPlayer:))]
198        #[unsafe(method_family = none)]
199        pub unsafe fn setMute_forPlayer(&self, is_muted: bool, player_id: &NSString);
200    );
201}