objc2_io_bluetooth_ui/generated/
IOBluetoothUIUserLib.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7use objc2::__framework_prelude::*;
8#[cfg(feature = "objc2-core-foundation")]
9use objc2_core_foundation::*;
10
11use crate::*;
12
13/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/iobluetoothdeviceselectorcontrollerref?language=objc)
14#[repr(C)]
15pub struct IOBluetoothDeviceSelectorControllerRef {
16    inner: [u8; 0],
17    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
18}
19
20#[cfg(feature = "objc2-core-foundation")]
21cf_type!(
22    unsafe impl IOBluetoothDeviceSelectorControllerRef {}
23);
24cf_objc2_type!(
25    unsafe impl RefEncode<"OpaqueIOBluetoothObjectRef"> for IOBluetoothDeviceSelectorControllerRef {}
26);
27
28/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/iobluetoothpairingcontrollerref?language=objc)
29#[repr(C)]
30pub struct IOBluetoothPairingControllerRef {
31    inner: [u8; 0],
32    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
33}
34
35#[cfg(feature = "objc2-core-foundation")]
36cf_type!(
37    unsafe impl IOBluetoothPairingControllerRef {}
38);
39cf_objc2_type!(
40    unsafe impl RefEncode<"OpaqueIOBluetoothObjectRef"> for IOBluetoothPairingControllerRef {}
41);
42
43/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/iobluetoothservicebrowsercontrollerref?language=objc)
44#[repr(C)]
45pub struct IOBluetoothServiceBrowserControllerRef {
46    inner: [u8; 0],
47    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
48}
49
50#[cfg(feature = "objc2-core-foundation")]
51cf_type!(
52    unsafe impl IOBluetoothServiceBrowserControllerRef {}
53);
54cf_objc2_type!(
55    unsafe impl RefEncode<"OpaqueIOBluetoothObjectRef"> for IOBluetoothServiceBrowserControllerRef {}
56);
57
58/// Option values to customize the behavior of an IOBluetoothServiceBrowserController object.
59///
60/// See also [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/iobluetoothservicebrowsercontrolleroptions?language=objc)
61pub type IOBluetoothServiceBrowserControllerOptions = u32;
62
63/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/kiobluetoothservicebrowsercontrolleroptionsnone?language=objc)
64pub const kIOBluetoothServiceBrowserControllerOptionsNone: c_uint = 0;
65/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/kiobluetoothservicebrowsercontrolleroptionsautostartinquiry?language=objc)
66pub const kIOBluetoothServiceBrowserControllerOptionsAutoStartInquiry: c_uint = 1 << 0;
67/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/kiobluetoothservicebrowsercontrolleroptionsdisconnectwhendone?language=objc)
68pub const kIOBluetoothServiceBrowserControllerOptionsDisconnectWhenDone: c_uint = 1 << 1;
69
70/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/kiobluetoothuisuccess?language=objc)
71pub const kIOBluetoothUISuccess: c_int = -1000;
72/// [Apple's documentation](https://developer.apple.com/documentation/iobluetoothui/kiobluetoothuiusercancelederr?language=objc)
73pub const kIOBluetoothUIUserCanceledErr: c_int = -1001;
74
75extern "C-unwind" {
76    /// # Safety
77    ///
78    /// - `cancel_button_title` might not allow `None`.
79    /// - `description_text` might not allow `None`.
80    #[cfg(feature = "objc2-core-foundation")]
81    pub fn IOBluetoothValidateHardwareWithDescription(
82        cancel_button_title: Option<&CFString>,
83        description_text: Option<&CFString>,
84    ) -> IOReturn;
85}
86
87#[cfg(feature = "objc2-core-foundation")]
88#[inline]
89pub unsafe extern "C-unwind" fn IOBluetoothGetPairingController(
90) -> Option<CFRetained<IOBluetoothPairingControllerRef>> {
91    extern "C-unwind" {
92        fn IOBluetoothGetPairingController() -> Option<NonNull<IOBluetoothPairingControllerRef>>;
93    }
94    let ret = unsafe { IOBluetoothGetPairingController() };
95    ret.map(|ret| unsafe { CFRetained::retain(ret) })
96}
97
98#[cfg(feature = "objc2-core-foundation")]
99#[inline]
100pub unsafe extern "C-unwind" fn IOBluetoothGetDeviceSelectorController(
101) -> Option<CFRetained<IOBluetoothDeviceSelectorControllerRef>> {
102    extern "C-unwind" {
103        fn IOBluetoothGetDeviceSelectorController(
104        ) -> Option<NonNull<IOBluetoothDeviceSelectorControllerRef>>;
105    }
106    let ret = unsafe { IOBluetoothGetDeviceSelectorController() };
107    ret.map(|ret| unsafe { CFRetained::retain(ret) })
108}