use core::cell::UnsafeCell;
use core::ffi::*;
use core::marker::{PhantomData, PhantomPinned};
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use crate::*;
#[repr(C)]
pub struct IOBluetoothDeviceSelectorControllerRef {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
#[cfg(feature = "objc2-core-foundation")]
cf_type!(
unsafe impl IOBluetoothDeviceSelectorControllerRef {}
);
cf_objc2_type!(
unsafe impl RefEncode<"OpaqueIOBluetoothObjectRef"> for IOBluetoothDeviceSelectorControllerRef {}
);
#[repr(C)]
pub struct IOBluetoothPairingControllerRef {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
#[cfg(feature = "objc2-core-foundation")]
cf_type!(
unsafe impl IOBluetoothPairingControllerRef {}
);
cf_objc2_type!(
unsafe impl RefEncode<"OpaqueIOBluetoothObjectRef"> for IOBluetoothPairingControllerRef {}
);
#[repr(C)]
pub struct IOBluetoothServiceBrowserControllerRef {
inner: [u8; 0],
_p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
}
#[cfg(feature = "objc2-core-foundation")]
cf_type!(
unsafe impl IOBluetoothServiceBrowserControllerRef {}
);
cf_objc2_type!(
unsafe impl RefEncode<"OpaqueIOBluetoothObjectRef"> for IOBluetoothServiceBrowserControllerRef {}
);
pub type IOBluetoothServiceBrowserControllerOptions = u32;
pub const kIOBluetoothServiceBrowserControllerOptionsNone: c_uint = 0;
pub const kIOBluetoothServiceBrowserControllerOptionsAutoStartInquiry: c_uint = 1 << 0;
pub const kIOBluetoothServiceBrowserControllerOptionsDisconnectWhenDone: c_uint = 1 << 1;
pub const kIOBluetoothUISuccess: c_int = -1000;
pub const kIOBluetoothUIUserCanceledErr: c_int = -1001;
extern "C-unwind" {
#[cfg(feature = "objc2-core-foundation")]
pub fn IOBluetoothValidateHardwareWithDescription(
cancel_button_title: Option<&CFString>,
description_text: Option<&CFString>,
) -> IOReturn;
}
#[cfg(feature = "objc2-core-foundation")]
#[inline]
pub unsafe extern "C-unwind" fn IOBluetoothGetPairingController(
) -> Option<CFRetained<IOBluetoothPairingControllerRef>> {
extern "C-unwind" {
fn IOBluetoothGetPairingController() -> Option<NonNull<IOBluetoothPairingControllerRef>>;
}
let ret = unsafe { IOBluetoothGetPairingController() };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}
#[cfg(feature = "objc2-core-foundation")]
#[inline]
pub unsafe extern "C-unwind" fn IOBluetoothGetDeviceSelectorController(
) -> Option<CFRetained<IOBluetoothDeviceSelectorControllerRef>> {
extern "C-unwind" {
fn IOBluetoothGetDeviceSelectorController(
) -> Option<NonNull<IOBluetoothDeviceSelectorControllerRef>>;
}
let ret = unsafe { IOBluetoothGetDeviceSelectorController() };
ret.map(|ret| unsafe { CFRetained::retain(ret) })
}