objc2_io_bluetooth/generated/objc2/IOBluetoothHandsFree.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::*;
6#[cfg(feature = "objc2-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11/// Hands free superclass. Superclass of IOBluetoothHandsFreeDevice or IOBluetoothHandsFreeAudioGateway.
12/// Contains the common code used to support the Bluetoooth hands free profile.
13///
14/// (c) 2010 by Apple Inc. All rights reserved.
15///
16/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreedevicefeatures?language=objc)
17// NS_ENUM
18#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct IOBluetoothHandsFreeDeviceFeatures(pub u32);
21impl IOBluetoothHandsFreeDeviceFeatures {
22 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureNone")]
23 pub const None: Self = Self(0);
24 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureECAndOrNRFunction")]
25 pub const ECAndOrNRFunction: Self = Self(1 << 0);
26 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureThreeWayCalling")]
27 pub const ThreeWayCalling: Self = Self(1 << 1);
28 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureCLIPresentation")]
29 pub const CLIPresentation: Self = Self(1 << 2);
30 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureVoiceRecognition")]
31 pub const VoiceRecognition: Self = Self(1 << 3);
32 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureRemoteVolumeControl")]
33 pub const RemoteVolumeControl: Self = Self(1 << 4);
34 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureEnhancedCallStatus")]
35 pub const EnhancedCallStatus: Self = Self(1 << 5);
36 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureEnhancedCallControl")]
37 pub const EnhancedCallControl: Self = Self(1 << 6);
38 #[doc(alias = "IOBluetoothHandsFreeDeviceFeatureCodecNegotiation")]
39 pub const CodecNegotiation: Self = Self(1 << 7);
40}
41
42unsafe impl Encode for IOBluetoothHandsFreeDeviceFeatures {
43 const ENCODING: Encoding = u32::ENCODING;
44}
45
46unsafe impl RefEncode for IOBluetoothHandsFreeDeviceFeatures {
47 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
48}
49
50/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeaudiogatewayfeatures?language=objc)
51// NS_ENUM
52#[repr(transparent)]
53#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
54pub struct IOBluetoothHandsFreeAudioGatewayFeatures(pub u32);
55impl IOBluetoothHandsFreeAudioGatewayFeatures {
56 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureNone")]
57 pub const None: Self = Self(0);
58 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureThreeWayCalling")]
59 pub const ThreeWayCalling: Self = Self(1 << 0);
60 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureECAndOrNRFunction")]
61 pub const ECAndOrNRFunction: Self = Self(1 << 1);
62 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureVoiceRecognition")]
63 pub const VoiceRecognition: Self = Self(1 << 2);
64 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureInBandRingTone")]
65 pub const InBandRingTone: Self = Self(1 << 3);
66 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureAttachedNumberToVoiceTag")]
67 pub const AttachedNumberToVoiceTag: Self = Self(1 << 4);
68 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureRejectCallCapability")]
69 pub const RejectCallCapability: Self = Self(1 << 5);
70 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureEnhancedCallStatus")]
71 pub const EnhancedCallStatus: Self = Self(1 << 6);
72 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureEnhancedCallControl")]
73 pub const EnhancedCallControl: Self = Self(1 << 7);
74 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureExtendedErrorResultCodes")]
75 pub const ExtendedErrorResultCodes: Self = Self(1 << 8);
76 #[doc(alias = "IOBluetoothHandsFreeAudioGatewayFeatureCodecNegotiation")]
77 pub const CodecNegotiation: Self = Self(1 << 9);
78}
79
80unsafe impl Encode for IOBluetoothHandsFreeAudioGatewayFeatures {
81 const ENCODING: Encoding = u32::ENCODING;
82}
83
84unsafe impl RefEncode for IOBluetoothHandsFreeAudioGatewayFeatures {
85 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
86}
87
88/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallholdmodes?language=objc)
89// NS_ENUM
90#[repr(transparent)]
91#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
92pub struct IOBluetoothHandsFreeCallHoldModes(pub NSUInteger);
93impl IOBluetoothHandsFreeCallHoldModes {
94 #[doc(alias = "IOBluetoothHandsFreeCallHoldMode0")]
95 pub const Mode0: Self = Self(1 << 0);
96 #[doc(alias = "IOBluetoothHandsFreeCallHoldMode1")]
97 pub const Mode1: Self = Self(1 << 1);
98 #[doc(alias = "IOBluetoothHandsFreeCallHoldMode1idx")]
99 pub const Mode1idx: Self = Self(1 << 2);
100 #[doc(alias = "IOBluetoothHandsFreeCallHoldMode2")]
101 pub const Mode2: Self = Self(1 << 3);
102 #[doc(alias = "IOBluetoothHandsFreeCallHoldMode2idx")]
103 pub const Mode2idx: Self = Self(1 << 4);
104 #[doc(alias = "IOBluetoothHandsFreeCallHoldMode3")]
105 pub const Mode3: Self = Self(1 << 5);
106 #[doc(alias = "IOBluetoothHandsFreeCallHoldMode4")]
107 pub const Mode4: Self = Self(1 << 6);
108}
109
110unsafe impl Encode for IOBluetoothHandsFreeCallHoldModes {
111 const ENCODING: Encoding = NSUInteger::ENCODING;
112}
113
114unsafe impl RefEncode for IOBluetoothHandsFreeCallHoldModes {
115 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
116}
117
118/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecodecid?language=objc)
119// NS_ENUM
120#[repr(transparent)]
121#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
122pub struct IOBluetoothHandsFreeCodecID(pub u8);
123impl IOBluetoothHandsFreeCodecID {
124 #[doc(alias = "IOBluetoothHandsFreeCodecIDCVSD")]
125 pub const IDCVSD: Self = Self(0x01);
126 #[doc(alias = "IOBluetoothHandsFreeCodecIDmSBC")]
127 pub const IDmSBC: Self = Self(0x02);
128 #[doc(alias = "IOBluetoothHandsFreeCodecIDAACELD")]
129 pub const IDAACELD: Self = Self(0x80);
130}
131
132unsafe impl Encode for IOBluetoothHandsFreeCodecID {
133 const ENCODING: Encoding = u8::ENCODING;
134}
135
136unsafe impl RefEncode for IOBluetoothHandsFreeCodecID {
137 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
138}
139
140extern "C" {
141 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorservice?language=objc)
142 #[cfg(feature = "objc2-foundation")]
143 pub static IOBluetoothHandsFreeIndicatorService: Option<&'static NSString>;
144}
145
146extern "C" {
147 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorcall?language=objc)
148 #[cfg(feature = "objc2-foundation")]
149 pub static IOBluetoothHandsFreeIndicatorCall: Option<&'static NSString>;
150}
151
152extern "C" {
153 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorcallsetup?language=objc)
154 #[cfg(feature = "objc2-foundation")]
155 pub static IOBluetoothHandsFreeIndicatorCallSetup: Option<&'static NSString>;
156}
157
158extern "C" {
159 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorcallheld?language=objc)
160 #[cfg(feature = "objc2-foundation")]
161 pub static IOBluetoothHandsFreeIndicatorCallHeld: Option<&'static NSString>;
162}
163
164extern "C" {
165 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorsignal?language=objc)
166 #[cfg(feature = "objc2-foundation")]
167 pub static IOBluetoothHandsFreeIndicatorSignal: Option<&'static NSString>;
168}
169
170extern "C" {
171 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorroam?language=objc)
172 #[cfg(feature = "objc2-foundation")]
173 pub static IOBluetoothHandsFreeIndicatorRoam: Option<&'static NSString>;
174}
175
176extern "C" {
177 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreeindicatorbattchg?language=objc)
178 #[cfg(feature = "objc2-foundation")]
179 pub static IOBluetoothHandsFreeIndicatorBattChg: Option<&'static NSString>;
180}
181
182extern "C" {
183 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallindex?language=objc)
184 #[cfg(feature = "objc2-foundation")]
185 pub static IOBluetoothHandsFreeCallIndex: Option<&'static NSString>;
186}
187
188extern "C" {
189 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecalldirection?language=objc)
190 #[cfg(feature = "objc2-foundation")]
191 pub static IOBluetoothHandsFreeCallDirection: Option<&'static NSString>;
192}
193
194extern "C" {
195 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallstatus?language=objc)
196 #[cfg(feature = "objc2-foundation")]
197 pub static IOBluetoothHandsFreeCallStatus: Option<&'static NSString>;
198}
199
200extern "C" {
201 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallmode?language=objc)
202 #[cfg(feature = "objc2-foundation")]
203 pub static IOBluetoothHandsFreeCallMode: Option<&'static NSString>;
204}
205
206extern "C" {
207 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallmultiparty?language=objc)
208 #[cfg(feature = "objc2-foundation")]
209 pub static IOBluetoothHandsFreeCallMultiparty: Option<&'static NSString>;
210}
211
212extern "C" {
213 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallnumber?language=objc)
214 #[cfg(feature = "objc2-foundation")]
215 pub static IOBluetoothHandsFreeCallNumber: Option<&'static NSString>;
216}
217
218extern "C" {
219 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecalltype?language=objc)
220 #[cfg(feature = "objc2-foundation")]
221 pub static IOBluetoothHandsFreeCallType: Option<&'static NSString>;
222}
223
224extern "C" {
225 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreecallname?language=objc)
226 #[cfg(feature = "objc2-foundation")]
227 pub static IOBluetoothHandsFreeCallName: Option<&'static NSString>;
228}
229
230/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothsmsmode?language=objc)
231// NS_ENUM
232#[repr(transparent)]
233#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
234pub struct IOBluetoothSMSMode(pub NSUInteger);
235impl IOBluetoothSMSMode {
236 #[doc(alias = "IOBluetoothSMSModePDU")]
237 pub const PDU: Self = Self(0);
238 #[doc(alias = "IOBluetoothSMSModeText")]
239 pub const Text: Self = Self(1);
240}
241
242unsafe impl Encode for IOBluetoothSMSMode {
243 const ENCODING: Encoding = NSUInteger::ENCODING;
244}
245
246unsafe impl RefEncode for IOBluetoothSMSMode {
247 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
248}
249
250/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreesmssupport?language=objc)
251// NS_ENUM
252#[repr(transparent)]
253#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
254pub struct IOBluetoothHandsFreeSMSSupport(pub NSUInteger);
255impl IOBluetoothHandsFreeSMSSupport {
256 #[doc(alias = "IOBluetoothHandsFreePhase2SMSSupport")]
257 pub const Phase2SMSSupport: Self = Self(1 << 0);
258 #[doc(alias = "IOBluetoothHandsFreePhase2pSMSSupport")]
259 pub const Phase2pSMSSupport: Self = Self(1 << 1);
260 #[doc(alias = "IOBluetoothHandsFreeManufactureSpecificSMSSupport")]
261 pub const ManufactureSpecificSMSSupport: Self = Self(1 << 2);
262}
263
264unsafe impl Encode for IOBluetoothHandsFreeSMSSupport {
265 const ENCODING: Encoding = NSUInteger::ENCODING;
266}
267
268unsafe impl RefEncode for IOBluetoothHandsFreeSMSSupport {
269 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
270}
271
272/// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreepdumessagestatus?language=objc)
273// NS_ENUM
274#[repr(transparent)]
275#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
276pub struct IOBluetoothHandsFreePDUMessageStatus(pub NSUInteger);
277impl IOBluetoothHandsFreePDUMessageStatus {
278 #[doc(alias = "IOBluetoothHandsFreePDUStatusRecUnread")]
279 pub const StatusRecUnread: Self = Self(0);
280 #[doc(alias = "IOBluetoothHandsFreePDUStatusRecRead")]
281 pub const StatusRecRead: Self = Self(1);
282 #[doc(alias = "IOBluetoothHandsFreePDUStatusStoUnsent")]
283 pub const StatusStoUnsent: Self = Self(2);
284 #[doc(alias = "IOBluetoothHandsFreePDUStatusStoSent")]
285 pub const StatusStoSent: Self = Self(3);
286 #[doc(alias = "IOBluetoothHandsFreePDUStatusAll")]
287 pub const StatusAll: Self = Self(4);
288}
289
290unsafe impl Encode for IOBluetoothHandsFreePDUMessageStatus {
291 const ENCODING: Encoding = NSUInteger::ENCODING;
292}
293
294unsafe impl RefEncode for IOBluetoothHandsFreePDUMessageStatus {
295 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
296}
297
298extern "C" {
299 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduserviccenteraddress?language=objc)
300 #[cfg(feature = "objc2-foundation")]
301 pub static IOBluetoothPDUServicCenterAddress: Option<&'static NSString>;
302}
303
304extern "C" {
305 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduservicecenteraddresstype?language=objc)
306 #[cfg(feature = "objc2-foundation")]
307 pub static IOBluetoothPDUServiceCenterAddressType: Option<&'static NSString>;
308}
309
310extern "C" {
311 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpdutype?language=objc)
312 #[cfg(feature = "objc2-foundation")]
313 pub static IOBluetoothPDUType: Option<&'static NSString>;
314}
315
316extern "C" {
317 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduoriginatingaddress?language=objc)
318 #[cfg(feature = "objc2-foundation")]
319 pub static IOBluetoothPDUOriginatingAddress: Option<&'static NSString>;
320}
321
322extern "C" {
323 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduoriginatingaddresstype?language=objc)
324 #[cfg(feature = "objc2-foundation")]
325 pub static IOBluetoothPDUOriginatingAddressType: Option<&'static NSString>;
326}
327
328extern "C" {
329 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduprotocolid?language=objc)
330 #[cfg(feature = "objc2-foundation")]
331 pub static IOBluetoothPDUProtocolID: Option<&'static NSString>;
332}
333
334extern "C" {
335 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpdutimestamp?language=objc)
336 #[cfg(feature = "objc2-foundation")]
337 pub static IOBluetoothPDUTimestamp: Option<&'static NSString>;
338}
339
340extern "C" {
341 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduencoding?language=objc)
342 #[cfg(feature = "objc2-foundation")]
343 pub static IOBluetoothPDUEncoding: Option<&'static NSString>;
344}
345
346extern "C" {
347 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothpduuserdata?language=objc)
348 #[cfg(feature = "objc2-foundation")]
349 pub static IOBluetoothPDUUserData: Option<&'static NSString>;
350}
351
352extern_class!(
353 /// Hands free profile class.
354 ///
355 /// Superclass of IOBluetoothHandsFreeDevice and IOBluetoothHandsFreeAudioGateway classes.
356 /// Contains the common code used to support the bluetoooth hands free profile.
357 ///
358 /// IOBluetoothHandsFreeDevice
359 ///
360 /// IOBluetoothHandsFreeAudioGateway
361 ///
362 /// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfree?language=objc)
363 #[unsafe(super(NSObject))]
364 #[derive(Debug, PartialEq, Eq, Hash)]
365 pub struct IOBluetoothHandsFree;
366);
367
368extern_conformance!(
369 unsafe impl NSObjectProtocol for IOBluetoothHandsFree {}
370);
371
372impl IOBluetoothHandsFree {
373 extern_methods!(
374 /// Return supported features
375 ///
376 /// Returns the supported features bitmap. The values are described in “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
377 ///
378 /// Returns: The supported features bitmap
379 ///
380 ///
381 ///
382 /// Set the supported features
383 ///
384 /// Sets the supported features bitmap. The values are described in “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
385 ///
386 /// Parameter `featuresBitmap`: The features bitmap
387 #[unsafe(method(supportedFeatures))]
388 #[unsafe(method_family = none)]
389 pub unsafe fn supportedFeatures(&self) -> u32;
390
391 /// Setter for [`supportedFeatures`][Self::supportedFeatures].
392 #[unsafe(method(setSupportedFeatures:))]
393 #[unsafe(method_family = none)]
394 pub unsafe fn setSupportedFeatures(&self, supported_features: u32);
395
396 /// Return the input volume
397 ///
398 /// Returns the input volume between 0 and 1. 0 is the same as mute.
399 ///
400 /// Returns: The input volume
401 ///
402 ///
403 ///
404 /// Set the input volume
405 ///
406 /// Sets the input volume between 0 and 1. 0 is the same as mute.
407 ///
408 /// Parameter `newVolume`: The new input volume
409 #[unsafe(method(inputVolume))]
410 #[unsafe(method_family = none)]
411 pub unsafe fn inputVolume(&self) -> c_float;
412
413 /// Setter for [`inputVolume`][Self::inputVolume].
414 #[unsafe(method(setInputVolume:))]
415 #[unsafe(method_family = none)]
416 pub unsafe fn setInputVolume(&self, input_volume: c_float);
417
418 /// Return the input mute state.
419 ///
420 /// Returns the inputs mute state.
421 ///
422 /// Returns: YES if muted; otherwise NO.
423 ///
424 ///
425 ///
426 /// Set the input mute state.
427 ///
428 /// Sets the inputs mute state.
429 ///
430 /// Parameter `muted`: YES if muted; otherwise NO.
431 #[unsafe(method(isInputMuted))]
432 #[unsafe(method_family = none)]
433 pub unsafe fn isInputMuted(&self) -> bool;
434
435 /// Setter for [`isInputMuted`][Self::isInputMuted].
436 #[unsafe(method(setInputMuted:))]
437 #[unsafe(method_family = none)]
438 pub unsafe fn setInputMuted(&self, input_muted: bool);
439
440 /// Return the output volume
441 ///
442 /// Returns the output volume between 0 and 1. 0 is the same as mute.
443 ///
444 /// Returns: The output volume
445 ///
446 ///
447 ///
448 /// Set the output volume
449 ///
450 /// Sets the output volume between 0 and 1. 0 is the same as mute.
451 ///
452 /// Parameter `newVolume`: The new output volume
453 #[unsafe(method(outputVolume))]
454 #[unsafe(method_family = none)]
455 pub unsafe fn outputVolume(&self) -> c_float;
456
457 /// Setter for [`outputVolume`][Self::outputVolume].
458 #[unsafe(method(setOutputVolume:))]
459 #[unsafe(method_family = none)]
460 pub unsafe fn setOutputVolume(&self, output_volume: c_float);
461
462 /// Return the output mute state.
463 ///
464 /// Returns the outputs mute state.
465 ///
466 /// Returns: YES if muted; otherwise NO.
467 ///
468 ///
469 ///
470 /// Set the output mute state.
471 ///
472 /// Sets the outputs mute state.
473 ///
474 /// Parameter `muted`: YES if muted; otherwise NO.
475 #[unsafe(method(isOutputMuted))]
476 #[unsafe(method_family = none)]
477 pub unsafe fn isOutputMuted(&self) -> bool;
478
479 /// Setter for [`isOutputMuted`][Self::isOutputMuted].
480 #[unsafe(method(setOutputMuted:))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn setOutputMuted(&self, output_muted: bool);
483
484 #[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
485 /// Return the IOBluetoothDevice.
486 ///
487 /// Returns the IOBluetoothDevice to connect with.
488 ///
489 /// Returns: The IOBluetoothDevice object
490 #[unsafe(method(device))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn device(&self) -> Option<Retained<IOBluetoothDevice>>;
493
494 /// Return the device's supported features.
495 ///
496 /// Returns the device's supported features bitmap. The values are described in “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
497 ///
498 /// Returns: The device features bitmap
499 #[unsafe(method(deviceSupportedFeatures))]
500 #[unsafe(method_family = none)]
501 pub unsafe fn deviceSupportedFeatures(&self) -> u32;
502
503 /// Return the device's supported SMS services.
504 ///
505 /// Returns the device's supported SMS services bitmap. The values are described in “IOBluetoothHandsFreeSMSSupport.”
506 ///
507 /// Returns: The SMS services supported
508 #[unsafe(method(deviceSupportedSMSServices))]
509 #[unsafe(method_family = none)]
510 pub unsafe fn deviceSupportedSMSServices(&self) -> u32;
511
512 /// Return the device's supported call hold modes.
513 ///
514 /// Returns the device's supported call hold modes bitmap. The values are described in “IOBluetoothHandsFreeCallHoldModes.”
515 ///
516 /// Returns: The SMS services supported
517 #[unsafe(method(deviceCallHoldModes))]
518 #[unsafe(method_family = none)]
519 pub unsafe fn deviceCallHoldModes(&self) -> u32;
520
521 /// Return the device's SMS mode.
522 ///
523 /// Returns the device's SMS mode. The values are described in “IOBluetoothSMSMode.”
524 ///
525 /// Returns: The SMS mode
526 #[unsafe(method(SMSMode))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn SMSMode(&self) -> IOBluetoothSMSMode;
529
530 /// Return YES if the device has SMS enabled.
531 ///
532 /// Returns YES if the device has SMS enabled (by responding to a CMGF command). NO if the device has not set an SMS mode or doesn't support SMS.
533 ///
534 /// Returns: YES if the device has SMSEnabled; otherwise, NO.
535 #[unsafe(method(isSMSEnabled))]
536 #[unsafe(method_family = none)]
537 pub unsafe fn isSMSEnabled(&self) -> bool;
538
539 /// Return the delegate
540 ///
541 /// Returns the hands free object's delegate.
542 ///
543 /// Returns: The delegate for the hands free object or nil if it doesn't have a delegate.
544 ///
545 ///
546 ///
547 /// Sets the hands free object’s delegate to a given object or removes an existing delegate.
548 ///
549 /// A IOBluetoothHandsFree delegate can optionally respond to any of the delegate methods in IOBluetoothHandsFreeDelegate and any subclasses delegates.
550 ///
551 /// Parameter `newDelegate`: The delegate for the hands free object. Pass nil to remove an existing delegate.
552 ///
553 /// # Safety
554 ///
555 /// This is not retained internally, you must ensure the object is still alive.
556 #[unsafe(method(delegate))]
557 #[unsafe(method_family = none)]
558 pub unsafe fn delegate(
559 &self,
560 ) -> Option<Retained<ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>>;
561
562 /// Setter for [`delegate`][Self::delegate].
563 ///
564 /// # Safety
565 ///
566 /// - `delegate` might not allow `None`.
567 /// - This is unretained, you must ensure the object is kept alive while in use.
568 #[unsafe(method(setDelegate:))]
569 #[unsafe(method_family = none)]
570 pub unsafe fn setDelegate(
571 &self,
572 delegate: Option<&ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>,
573 );
574
575 #[cfg(feature = "objc2-foundation")]
576 /// Return an indicator's value
577 ///
578 /// Returns an indicator's value.
579 ///
580 /// Parameter `indicatorName`: See “Hands free indicator constants," for standard indicator names.
581 ///
582 /// # Safety
583 ///
584 /// `indicator_name` might not allow `None`.
585 #[unsafe(method(indicator:))]
586 #[unsafe(method_family = none)]
587 pub unsafe fn indicator(&self, indicator_name: Option<&NSString>) -> c_int;
588
589 #[cfg(feature = "objc2-foundation")]
590 /// Set an indicator's value
591 ///
592 /// Sets an indicator's value.
593 ///
594 /// Parameter `indicatorName`: See “Hands free indicator constants," for standard indicator names.
595 ///
596 /// Parameter `indicatorValue`: Will set the indicator value as long as it is within the min and max values allowed.
597 ///
598 /// # Safety
599 ///
600 /// `indicator_name` might not allow `None`.
601 #[unsafe(method(setIndicator:value:))]
602 #[unsafe(method_family = none)]
603 pub unsafe fn setIndicator_value(
604 &self,
605 indicator_name: Option<&NSString>,
606 indicator_value: c_int,
607 );
608
609 #[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
610 /// Create a new IOBluetoothHandsFree object
611 ///
612 /// This method should be called on a subclass (IOBluetoothHandsFreeDevice or IOBluetoothHandsFreeAudioGateway) to get full functionality.
613 ///
614 /// Parameter `device`: An IOBluetoothDevice
615 ///
616 /// Parameter `inDelegate`: An object to act as delegate that implements the IOBluetoothHandsFreeDelegate protocol.
617 ///
618 /// Returns: A newly created IOBluetoothHandsFreeAudioGateway object on success, nil on failure
619 ///
620 /// # Safety
621 ///
622 /// - `device` might not allow `None`.
623 /// - `in_delegate` might not allow `None`.
624 #[unsafe(method(initWithDevice:delegate:))]
625 #[unsafe(method_family = init)]
626 pub unsafe fn initWithDevice_delegate(
627 this: Allocated<Self>,
628 device: Option<&IOBluetoothDevice>,
629 in_delegate: Option<&ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>,
630 ) -> Option<Retained<Self>>;
631
632 /// Connect to the device
633 ///
634 /// Connects to the device and sets up a service level connection (RFCOMM channel).
635 /// Delegate methods will be called once the connection is complete or a failure occurs.
636 #[unsafe(method(connect))]
637 #[unsafe(method_family = none)]
638 pub unsafe fn connect(&self);
639
640 /// Disconnect from the device
641 ///
642 /// Disconnects from the device, closes the SCO and service level connection if they are connected.
643 /// Delegate methods will be called once the disconnection is complete.
644 #[unsafe(method(disconnect))]
645 #[unsafe(method_family = none)]
646 pub unsafe fn disconnect(&self);
647
648 /// Determine if there is a serivice level connection to the device
649 ///
650 /// Determines if there is a serivice level connection to the device.
651 ///
652 /// Returns: YES if there is a serivice level connection to the device; otherwise, NO.
653 #[unsafe(method(isConnected))]
654 #[unsafe(method_family = none)]
655 pub unsafe fn isConnected(&self) -> bool;
656
657 /// Open a SCO connection with the device
658 ///
659 /// Opens a SCO connection with the device. The device must already have a service level connection or this will return immediately.
660 /// Delegate methods will be called once the connection is complete of a failure occurs.
661 #[unsafe(method(connectSCO))]
662 #[unsafe(method_family = none)]
663 pub unsafe fn connectSCO(&self);
664
665 /// Disconnect the SCO connection with the device
666 ///
667 /// Disconnects the SCO connection with the device (if one exists).
668 /// Delegate methods will be called once the disconnection is complete.
669 #[unsafe(method(disconnectSCO))]
670 #[unsafe(method_family = none)]
671 pub unsafe fn disconnectSCO(&self);
672
673 /// Determine if there is a SCO connection to the device
674 ///
675 /// Determines if there is a SCO connection to the device.
676 ///
677 /// Returns: YES if there is a SCO connection to the device; otherwise, NO.
678 #[unsafe(method(isSCOConnected))]
679 #[unsafe(method_family = none)]
680 pub unsafe fn isSCOConnected(&self) -> bool;
681 );
682}
683
684/// Methods declared on superclass `NSObject`.
685impl IOBluetoothHandsFree {
686 extern_methods!(
687 #[unsafe(method(init))]
688 #[unsafe(method_family = init)]
689 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
690
691 #[unsafe(method(new))]
692 #[unsafe(method_family = new)]
693 pub unsafe fn new() -> Retained<Self>;
694 );
695}
696
697extern_protocol!(
698 /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreedelegate?language=objc)
699 pub unsafe trait IOBluetoothHandsFreeDelegate: NSObjectProtocol {
700 #[cfg(feature = "objc2-foundation")]
701 /// Tells the delegate that the hands free service level connection is complete.
702 ///
703 /// Parameter `device`: The IOBluetoothHandsFree object that was being connected
704 ///
705 /// Parameter `status`: The result of the connection attempt. An IOReturn result returned in an NSNumber object.
706 ///
707 /// # Safety
708 ///
709 /// - `device` might not allow `None`.
710 /// - `status` might not allow `None`.
711 #[optional]
712 #[unsafe(method(handsFree:connected:))]
713 #[unsafe(method_family = none)]
714 unsafe fn handsFree_connected(
715 &self,
716 device: Option<&IOBluetoothHandsFree>,
717 status: Option<&NSNumber>,
718 );
719
720 #[cfg(feature = "objc2-foundation")]
721 /// Tells the delegate that the hands free service level connection was disconnected.
722 ///
723 /// Parameter `device`: The IOBluetoothHandsFree object whose service level connection was disconnected
724 ///
725 /// Parameter `status`: The result of the disconnection attempt. An IOReturn result returned in an NSNumber object.
726 ///
727 /// # Safety
728 ///
729 /// - `device` might not allow `None`.
730 /// - `status` might not allow `None`.
731 #[optional]
732 #[unsafe(method(handsFree:disconnected:))]
733 #[unsafe(method_family = none)]
734 unsafe fn handsFree_disconnected(
735 &self,
736 device: Option<&IOBluetoothHandsFree>,
737 status: Option<&NSNumber>,
738 );
739
740 #[cfg(feature = "objc2-foundation")]
741 /// Tells the delegate that the SCO connection is complete.
742 ///
743 /// Parameter `device`: The IOBluetoothHandsFree object that was being connected
744 ///
745 /// Parameter `status`: The result of the connection attempt. An IOReturn result returned in an NSNumber object.
746 ///
747 /// # Safety
748 ///
749 /// - `device` might not allow `None`.
750 /// - `status` might not allow `None`.
751 #[optional]
752 #[unsafe(method(handsFree:scoConnectionOpened:))]
753 #[unsafe(method_family = none)]
754 unsafe fn handsFree_scoConnectionOpened(
755 &self,
756 device: Option<&IOBluetoothHandsFree>,
757 status: Option<&NSNumber>,
758 );
759
760 #[cfg(feature = "objc2-foundation")]
761 /// Tells the delegate that the SCO connection was closed.
762 ///
763 /// Parameter `device`: The IOBluetoothHandsFree object whose SCO connection was closed
764 ///
765 /// Parameter `status`: The result of the disconnection attempt. An IOReturn result returned in an NSNumber object.
766 ///
767 /// # Safety
768 ///
769 /// - `device` might not allow `None`.
770 /// - `status` might not allow `None`.
771 #[optional]
772 #[unsafe(method(handsFree:scoConnectionClosed:))]
773 #[unsafe(method_family = none)]
774 unsafe fn handsFree_scoConnectionClosed(
775 &self,
776 device: Option<&IOBluetoothHandsFree>,
777 status: Option<&NSNumber>,
778 );
779 }
780);
781
782/// HandsFreeDeviceAdditions.
783#[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
784impl IOBluetoothDevice {
785 extern_methods!(
786 #[cfg(feature = "objc2-foundation")]
787 /// Return the hands free gateway driver ID
788 ///
789 /// Returns the hands free gateway driver ID which is unique based on BT Address.
790 ///
791 /// Returns: The hands free gateway driver ID
792 #[deprecated]
793 #[unsafe(method(handsFreeAudioGatewayDriverID))]
794 #[unsafe(method_family = none)]
795 pub unsafe fn handsFreeAudioGatewayDriverID(&self) -> Option<Retained<NSString>>;
796
797 #[cfg(feature = "IOBluetoothSDPServiceRecord")]
798 /// Return the hands free gateway SDP record
799 ///
800 /// Returns the hands free gateway SDP record.
801 ///
802 /// Returns: The hands free gateway SDP record
803 #[unsafe(method(handsFreeAudioGatewayServiceRecord))]
804 #[unsafe(method_family = none)]
805 pub unsafe fn handsFreeAudioGatewayServiceRecord(
806 &self,
807 ) -> Option<Retained<IOBluetoothSDPServiceRecord>>;
808
809 /// Return the devices support for hands free gateway
810 ///
811 /// Returns the devices support for hands free gateway (obtained from the devices SDP record).
812 ///
813 /// Returns: YES if the device supports hands free gateway; otherwise, NO.
814 #[unsafe(method(isHandsFreeAudioGateway))]
815 #[unsafe(method_family = none)]
816 pub unsafe fn isHandsFreeAudioGateway(&self) -> bool;
817
818 #[cfg(feature = "objc2-foundation")]
819 /// Return the hands free device driver ID
820 ///
821 /// Returns the hands free device driver ID which is unique based on BT Address.
822 ///
823 /// Returns: The hands free device driver ID
824 #[deprecated]
825 #[unsafe(method(handsFreeDeviceDriverID))]
826 #[unsafe(method_family = none)]
827 pub unsafe fn handsFreeDeviceDriverID(&self) -> Option<Retained<NSString>>;
828
829 #[cfg(feature = "IOBluetoothSDPServiceRecord")]
830 /// Return the hands free device SDP record
831 ///
832 /// Returns the hands free device SDP record.
833 ///
834 /// Returns: The hands free device SDP record
835 #[unsafe(method(handsFreeDeviceServiceRecord))]
836 #[unsafe(method_family = none)]
837 pub unsafe fn handsFreeDeviceServiceRecord(
838 &self,
839 ) -> Option<Retained<IOBluetoothSDPServiceRecord>>;
840
841 /// Return the devices support for hands free device
842 ///
843 /// Returns the devices support for hands free device (obtained from the devices SDP record).
844 ///
845 /// Returns: YES if the device supports hands free device; otherwise, NO.
846 #[unsafe(method(isHandsFreeDevice))]
847 #[unsafe(method_family = none)]
848 pub unsafe fn isHandsFreeDevice(&self) -> bool;
849 );
850}
851
852/// HandsFreeSDPServiceRecordAdditions.
853#[cfg(feature = "IOBluetoothSDPServiceRecord")]
854impl IOBluetoothSDPServiceRecord {
855 extern_methods!(
856 /// Return the hands free supported features
857 ///
858 /// Returns the hands free supported features bitmap stored in the SDP record. See “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
859 ///
860 /// Returns: The supported features bitmap.
861 #[unsafe(method(handsFreeSupportedFeatures))]
862 #[unsafe(method_family = none)]
863 pub unsafe fn handsFreeSupportedFeatures(&self) -> u16;
864 );
865}