use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct EABluetoothAccessoryPickerErrorCode(pub NSInteger);
impl EABluetoothAccessoryPickerErrorCode {
#[doc(alias = "EABluetoothAccessoryPickerAlreadyConnected")]
pub const AlreadyConnected: Self = Self(0);
#[doc(alias = "EABluetoothAccessoryPickerResultNotFound")]
pub const ResultNotFound: Self = Self(1);
#[doc(alias = "EABluetoothAccessoryPickerResultCancelled")]
pub const ResultCancelled: Self = Self(2);
#[doc(alias = "EABluetoothAccessoryPickerResultFailed")]
pub const ResultFailed: Self = Self(3);
}
unsafe impl Encode for EABluetoothAccessoryPickerErrorCode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for EABluetoothAccessoryPickerErrorCode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern "C" {
pub static EABluetoothAccessoryPickerErrorDomain: &'static NSString;
}
#[cfg(feature = "block2")]
pub type EABluetoothAccessoryPickerCompletion = *mut block2::DynBlock<dyn Fn(*mut NSError)>;
extern "C" {
pub static EAAccessoryDidConnectNotification: &'static NSString;
}
extern "C" {
pub static EAAccessoryDidDisconnectNotification: &'static NSString;
}
extern "C" {
pub static EAAccessoryKey: &'static NSString;
}
extern "C" {
pub static EAAccessorySelectedKey: &'static NSString;
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct EAAccessoryManager;
);
extern_conformance!(
unsafe impl NSObjectProtocol for EAAccessoryManager {}
);
impl EAAccessoryManager {
extern_methods!(
#[unsafe(method(sharedAccessoryManager))]
#[unsafe(method_family = none)]
pub unsafe fn sharedAccessoryManager() -> Retained<EAAccessoryManager>;
#[cfg(feature = "block2")]
#[unsafe(method(showBluetoothAccessoryPickerWithNameFilter:completion:))]
#[unsafe(method_family = none)]
pub unsafe fn showBluetoothAccessoryPickerWithNameFilter_completion(
&self,
predicate: Option<&NSPredicate>,
completion: EABluetoothAccessoryPickerCompletion,
);
#[unsafe(method(registerForLocalNotifications))]
#[unsafe(method_family = none)]
pub unsafe fn registerForLocalNotifications(&self);
#[unsafe(method(unregisterForLocalNotifications))]
#[unsafe(method_family = none)]
pub unsafe fn unregisterForLocalNotifications(&self);
#[cfg(feature = "EAAccessory")]
#[unsafe(method(connectedAccessories))]
#[unsafe(method_family = none)]
pub unsafe fn connectedAccessories(&self) -> Retained<NSArray<EAAccessory>>;
);
}
impl EAAccessoryManager {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}