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        #[unsafe(method(delegate))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn delegate(
555            &self,
556        ) -> Option<Retained<ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>>;
557
558        /// Setter for [`delegate`][Self::delegate].
559        #[unsafe(method(setDelegate:))]
560        #[unsafe(method_family = none)]
561        pub unsafe fn setDelegate(
562            &self,
563            delegate: Option<&ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>,
564        );
565
566        #[cfg(feature = "objc2-foundation")]
567        /// Return an indicator's value
568        ///
569        /// Returns an indicator's value.
570        ///
571        /// Parameter `indicatorName`: See  “Hands free indicator constants," for standard indicator names.
572        #[unsafe(method(indicator:))]
573        #[unsafe(method_family = none)]
574        pub unsafe fn indicator(&self, indicator_name: Option<&NSString>) -> c_int;
575
576        #[cfg(feature = "objc2-foundation")]
577        /// Set an indicator's value
578        ///
579        /// Sets an indicator's value.
580        ///
581        /// Parameter `indicatorName`: See  “Hands free indicator constants," for standard indicator names.
582        ///
583        /// Parameter `indicatorValue`: Will set the indicator value as long as it is within the min and max values allowed.
584        #[unsafe(method(setIndicator:value:))]
585        #[unsafe(method_family = none)]
586        pub unsafe fn setIndicator_value(
587            &self,
588            indicator_name: Option<&NSString>,
589            indicator_value: c_int,
590        );
591
592        #[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
593        /// Create a new IOBluetoothHandsFree object
594        ///
595        /// This method should be called on a subclass (IOBluetoothHandsFreeDevice or IOBluetoothHandsFreeAudioGateway) to get full functionality.
596        ///
597        /// Parameter `device`: An IOBluetoothDevice
598        ///
599        /// Parameter `inDelegate`: An object to act as delegate that implements the IOBluetoothHandsFreeDelegate protocol.
600        ///
601        /// Returns: A newly created IOBluetoothHandsFreeAudioGateway object on success, nil on failure
602        #[unsafe(method(initWithDevice:delegate:))]
603        #[unsafe(method_family = init)]
604        pub unsafe fn initWithDevice_delegate(
605            this: Allocated<Self>,
606            device: Option<&IOBluetoothDevice>,
607            in_delegate: Option<&ProtocolObject<dyn IOBluetoothHandsFreeDelegate>>,
608        ) -> Option<Retained<Self>>;
609
610        /// Connect to the device
611        ///
612        /// Connects to the device and sets up a service level connection (RFCOMM channel).
613        /// Delegate methods will be called once the connection is complete or a failure occurs.
614        #[unsafe(method(connect))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn connect(&self);
617
618        /// Disconnect from the device
619        ///
620        /// Disconnects from the device, closes the SCO and service level connection if they are connected.
621        /// Delegate methods will be called once the disconnection is complete.
622        #[unsafe(method(disconnect))]
623        #[unsafe(method_family = none)]
624        pub unsafe fn disconnect(&self);
625
626        /// Determine if there is a serivice level connection to the device
627        ///
628        /// Determines if there is a serivice level connection to the device.
629        ///
630        /// Returns: YES if there is a serivice level connection to the device; otherwise, NO.
631        #[unsafe(method(isConnected))]
632        #[unsafe(method_family = none)]
633        pub unsafe fn isConnected(&self) -> bool;
634
635        /// Open a SCO connection with the device
636        ///
637        /// Opens a SCO connection with the device. The device must already have a service level connection or this will return immediately.
638        /// Delegate methods will be called once the connection is complete of a failure occurs.
639        #[unsafe(method(connectSCO))]
640        #[unsafe(method_family = none)]
641        pub unsafe fn connectSCO(&self);
642
643        /// Disconnect the SCO connection with the device
644        ///
645        /// Disconnects the SCO connection with the device (if one exists).
646        /// Delegate methods will be called once the disconnection is complete.
647        #[unsafe(method(disconnectSCO))]
648        #[unsafe(method_family = none)]
649        pub unsafe fn disconnectSCO(&self);
650
651        /// Determine if there is a SCO connection to the device
652        ///
653        /// Determines if there is a SCO connection to the device.
654        ///
655        /// Returns: YES if there is a SCO connection to the device; otherwise, NO.
656        #[unsafe(method(isSCOConnected))]
657        #[unsafe(method_family = none)]
658        pub unsafe fn isSCOConnected(&self) -> bool;
659    );
660}
661
662/// Methods declared on superclass `NSObject`.
663impl IOBluetoothHandsFree {
664    extern_methods!(
665        #[unsafe(method(init))]
666        #[unsafe(method_family = init)]
667        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
668
669        #[unsafe(method(new))]
670        #[unsafe(method_family = new)]
671        pub unsafe fn new() -> Retained<Self>;
672    );
673}
674
675extern_protocol!(
676    /// [Apple's documentation](https://developer.apple.com/documentation/iobluetooth/iobluetoothhandsfreedelegate?language=objc)
677    pub unsafe trait IOBluetoothHandsFreeDelegate: NSObjectProtocol {
678        #[cfg(feature = "objc2-foundation")]
679        /// Tells the delegate that the hands free service level connection is complete.
680        ///
681        /// Parameter `device`: The IOBluetoothHandsFree object that was being connected
682        ///
683        /// Parameter `status`: The result of the connection attempt. An IOReturn result returned in an NSNumber object.
684        #[optional]
685        #[unsafe(method(handsFree:connected:))]
686        #[unsafe(method_family = none)]
687        unsafe fn handsFree_connected(
688            &self,
689            device: Option<&IOBluetoothHandsFree>,
690            status: Option<&NSNumber>,
691        );
692
693        #[cfg(feature = "objc2-foundation")]
694        /// Tells the delegate that the hands free service level connection was disconnected.
695        ///
696        /// Parameter `device`: The IOBluetoothHandsFree object whose service level connection was disconnected
697        ///
698        /// Parameter `status`: The result of the disconnection attempt. An IOReturn result returned in an NSNumber object.
699        #[optional]
700        #[unsafe(method(handsFree:disconnected:))]
701        #[unsafe(method_family = none)]
702        unsafe fn handsFree_disconnected(
703            &self,
704            device: Option<&IOBluetoothHandsFree>,
705            status: Option<&NSNumber>,
706        );
707
708        #[cfg(feature = "objc2-foundation")]
709        /// Tells the delegate that the SCO connection is complete.
710        ///
711        /// Parameter `device`: The IOBluetoothHandsFree object that was being connected
712        ///
713        /// Parameter `status`: The result of the connection attempt. An IOReturn result returned in an NSNumber object.
714        #[optional]
715        #[unsafe(method(handsFree:scoConnectionOpened:))]
716        #[unsafe(method_family = none)]
717        unsafe fn handsFree_scoConnectionOpened(
718            &self,
719            device: Option<&IOBluetoothHandsFree>,
720            status: Option<&NSNumber>,
721        );
722
723        #[cfg(feature = "objc2-foundation")]
724        /// Tells the delegate that the SCO connection was closed.
725        ///
726        /// Parameter `device`: The IOBluetoothHandsFree object whose SCO connection was closed
727        ///
728        /// Parameter `status`: The result of the disconnection attempt. An IOReturn result returned in an NSNumber object.
729        #[optional]
730        #[unsafe(method(handsFree:scoConnectionClosed:))]
731        #[unsafe(method_family = none)]
732        unsafe fn handsFree_scoConnectionClosed(
733            &self,
734            device: Option<&IOBluetoothHandsFree>,
735            status: Option<&NSNumber>,
736        );
737    }
738);
739
740/// HandsFreeDeviceAdditions.
741#[cfg(all(feature = "IOBluetoothDevice", feature = "IOBluetoothObject"))]
742impl IOBluetoothDevice {
743    extern_methods!(
744        #[cfg(feature = "objc2-foundation")]
745        /// Return the hands free gateway driver ID
746        ///
747        /// Returns the hands free gateway driver ID which is unique based on BT Address.
748        ///
749        /// Returns: The hands free gateway driver ID
750        #[deprecated]
751        #[unsafe(method(handsFreeAudioGatewayDriverID))]
752        #[unsafe(method_family = none)]
753        pub unsafe fn handsFreeAudioGatewayDriverID(&self) -> Option<Retained<NSString>>;
754
755        #[cfg(feature = "IOBluetoothSDPServiceRecord")]
756        /// Return the hands free gateway SDP record
757        ///
758        /// Returns the hands free gateway SDP record.
759        ///
760        /// Returns: The hands free gateway SDP record
761        #[unsafe(method(handsFreeAudioGatewayServiceRecord))]
762        #[unsafe(method_family = none)]
763        pub unsafe fn handsFreeAudioGatewayServiceRecord(
764            &self,
765        ) -> Option<Retained<IOBluetoothSDPServiceRecord>>;
766
767        /// Return the devices support for hands free gateway
768        ///
769        /// Returns the devices support for hands free gateway (obtained from the devices SDP record).
770        ///
771        /// Returns: YES if the device supports hands free gateway; otherwise, NO.
772        #[unsafe(method(isHandsFreeAudioGateway))]
773        #[unsafe(method_family = none)]
774        pub unsafe fn isHandsFreeAudioGateway(&self) -> bool;
775
776        #[cfg(feature = "objc2-foundation")]
777        /// Return the hands free device driver ID
778        ///
779        /// Returns the hands free device driver ID which is unique based on BT Address.
780        ///
781        /// Returns: The hands free device driver ID
782        #[deprecated]
783        #[unsafe(method(handsFreeDeviceDriverID))]
784        #[unsafe(method_family = none)]
785        pub unsafe fn handsFreeDeviceDriverID(&self) -> Option<Retained<NSString>>;
786
787        #[cfg(feature = "IOBluetoothSDPServiceRecord")]
788        /// Return the hands free device SDP record
789        ///
790        /// Returns the hands free device SDP record.
791        ///
792        /// Returns: The hands free device SDP record
793        #[unsafe(method(handsFreeDeviceServiceRecord))]
794        #[unsafe(method_family = none)]
795        pub unsafe fn handsFreeDeviceServiceRecord(
796            &self,
797        ) -> Option<Retained<IOBluetoothSDPServiceRecord>>;
798
799        /// Return the devices support for hands free device
800        ///
801        /// Returns the devices support for hands free device (obtained from the devices SDP record).
802        ///
803        /// Returns: YES if the device supports hands free device; otherwise, NO.
804        #[unsafe(method(isHandsFreeDevice))]
805        #[unsafe(method_family = none)]
806        pub unsafe fn isHandsFreeDevice(&self) -> bool;
807    );
808}
809
810/// HandsFreeSDPServiceRecordAdditions.
811#[cfg(feature = "IOBluetoothSDPServiceRecord")]
812impl IOBluetoothSDPServiceRecord {
813    extern_methods!(
814        /// Return the hands free supported features
815        ///
816        /// Returns the hands free supported features bitmap stored in the SDP record. See “IOBluetoothHandsFreeDeviceFeatures and IOBluetoothHandsFreeAudioGatewayFeatures.”
817        ///
818        /// Returns: The supported features bitmap.
819        #[unsafe(method(handsFreeSupportedFeatures))]
820        #[unsafe(method_family = none)]
821        pub unsafe fn handsFreeSupportedFeatures(&self) -> u16;
822    );
823}