objc2_push_to_talk/generated/
PTChannelManager.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct PTServiceStatus(pub NSInteger);
15impl PTServiceStatus {
16 #[doc(alias = "PTServiceStatusReady")]
18 pub const Ready: Self = Self(0);
19 #[doc(alias = "PTServiceStatusConnecting")]
21 pub const Connecting: Self = Self(1);
22 #[doc(alias = "PTServiceStatusUnavailable")]
24 pub const Unavailable: Self = Self(2);
25}
26
27unsafe impl Encode for PTServiceStatus {
28 const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for PTServiceStatus {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35#[repr(transparent)]
38#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
39pub struct PTTransmissionMode(pub NSInteger);
40impl PTTransmissionMode {
41 #[doc(alias = "PTTransmissionModeFullDuplex")]
43 pub const FullDuplex: Self = Self(0);
44 #[doc(alias = "PTTransmissionModeHalfDuplex")]
46 pub const HalfDuplex: Self = Self(1);
47 #[doc(alias = "PTTransmissionModeListenOnly")]
49 pub const ListenOnly: Self = Self(2);
50}
51
52unsafe impl Encode for PTTransmissionMode {
53 const ENCODING: Encoding = NSInteger::ENCODING;
54}
55
56unsafe impl RefEncode for PTTransmissionMode {
57 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60extern_class!(
61 #[unsafe(super(NSObject))]
63 #[derive(Debug, PartialEq, Eq, Hash)]
64 pub struct PTChannelManager;
65);
66
67unsafe impl Send for PTChannelManager {}
68
69unsafe impl Sync for PTChannelManager {}
70
71extern_conformance!(
72 unsafe impl NSObjectProtocol for PTChannelManager {}
73);
74
75impl PTChannelManager {
76 extern_methods!(
77 #[cfg(all(
78 feature = "PTChannelManagerDelegate",
79 feature = "PTChannelRestorationDelegate",
80 feature = "block2"
81 ))]
82 #[unsafe(method(channelManagerWithDelegate:restorationDelegate:completionHandler:))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn channelManagerWithDelegate_restorationDelegate_completionHandler(
86 delegate: &ProtocolObject<dyn PTChannelManagerDelegate>,
87 restoration_delegate: &ProtocolObject<dyn PTChannelRestorationDelegate>,
88 completion_handler: &block2::DynBlock<dyn Fn(*mut PTChannelManager, *mut NSError)>,
89 );
90
91 #[unsafe(method(new))]
92 #[unsafe(method_family = new)]
93 pub unsafe fn new() -> Retained<Self>;
94
95 #[unsafe(method(init))]
96 #[unsafe(method_family = init)]
97 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
98
99 #[unsafe(method(activeChannelUUID))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn activeChannelUUID(&self) -> Option<Retained<NSUUID>>;
105
106 #[cfg(feature = "PTChannelDescriptor")]
107 #[unsafe(method(requestJoinChannelWithUUID:descriptor:))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn requestJoinChannelWithUUID_descriptor(
111 &self,
112 channel_uuid: &NSUUID,
113 descriptor: &PTChannelDescriptor,
114 );
115
116 #[unsafe(method(requestBeginTransmittingWithChannelUUID:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn requestBeginTransmittingWithChannelUUID(&self, channel_uuid: &NSUUID);
120
121 #[unsafe(method(stopTransmittingWithChannelUUID:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn stopTransmittingWithChannelUUID(&self, channel_uuid: &NSUUID);
125
126 #[unsafe(method(leaveChannelWithUUID:))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn leaveChannelWithUUID(&self, channel_uuid: &NSUUID);
130
131 #[cfg(all(feature = "PTChannelDescriptor", feature = "block2"))]
132 #[unsafe(method(setChannelDescriptor:forChannelUUID:completionHandler:))]
134 #[unsafe(method_family = none)]
135 pub unsafe fn setChannelDescriptor_forChannelUUID_completionHandler(
136 &self,
137 channel_descriptor: &PTChannelDescriptor,
138 channel_uuid: &NSUUID,
139 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
140 );
141
142 #[cfg(all(feature = "PTParticipant", feature = "block2"))]
143 #[unsafe(method(setActiveRemoteParticipant:forChannelUUID:completionHandler:))]
145 #[unsafe(method_family = none)]
146 pub unsafe fn setActiveRemoteParticipant_forChannelUUID_completionHandler(
147 &self,
148 participant: Option<&PTParticipant>,
149 channel_uuid: &NSUUID,
150 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
151 );
152
153 #[cfg(feature = "block2")]
154 #[unsafe(method(setServiceStatus:forChannelUUID:completionHandler:))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn setServiceStatus_forChannelUUID_completionHandler(
158 &self,
159 status: PTServiceStatus,
160 channel_uuid: &NSUUID,
161 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
162 );
163
164 #[cfg(feature = "block2")]
165 #[unsafe(method(setTransmissionMode:forChannelUUID:completionHandler:))]
167 #[unsafe(method_family = none)]
168 pub unsafe fn setTransmissionMode_forChannelUUID_completionHandler(
169 &self,
170 transmission_mode: PTTransmissionMode,
171 channel_uuid: &NSUUID,
172 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
173 );
174
175 #[cfg(feature = "block2")]
176 #[unsafe(method(setAccessoryButtonEventsEnabled:forChannelUUID:completionHandler:))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn setAccessoryButtonEventsEnabled_forChannelUUID_completionHandler(
180 &self,
181 enabled: bool,
182 channel_uuid: &NSUUID,
183 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
184 );
185 );
186}