use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(CBAttribute, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CBAttribute")]
pub struct CBService;
);
#[cfg(feature = "CBAttribute")]
extern_conformance!(
unsafe impl NSObjectProtocol for CBService {}
);
#[cfg(feature = "CBAttribute")]
impl CBService {
extern_methods!(
#[cfg(all(feature = "CBPeer", feature = "CBPeripheral"))]
#[unsafe(method(peripheral))]
#[unsafe(method_family = none)]
pub unsafe fn peripheral(&self) -> Option<Retained<CBPeripheral>>;
#[unsafe(method(isPrimary))]
#[unsafe(method_family = none)]
pub unsafe fn isPrimary(&self) -> bool;
#[unsafe(method(includedServices))]
#[unsafe(method_family = none)]
pub unsafe fn includedServices(&self) -> Option<Retained<NSArray<CBService>>>;
#[cfg(feature = "CBCharacteristic")]
#[unsafe(method(characteristics))]
#[unsafe(method_family = none)]
pub unsafe fn characteristics(&self) -> Option<Retained<NSArray<CBCharacteristic>>>;
);
}
#[cfg(feature = "CBAttribute")]
impl CBService {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "CBAttribute")]
impl CBService {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(CBService, CBAttribute, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CBAttribute")]
pub struct CBMutableService;
);
#[cfg(feature = "CBAttribute")]
extern_conformance!(
unsafe impl NSObjectProtocol for CBMutableService {}
);
#[cfg(feature = "CBAttribute")]
impl CBMutableService {
extern_methods!(
#[unsafe(method(includedServices))]
#[unsafe(method_family = none)]
pub unsafe fn includedServices(&self) -> Option<Retained<NSArray<CBService>>>;
#[unsafe(method(setIncludedServices:))]
#[unsafe(method_family = none)]
pub unsafe fn setIncludedServices(&self, included_services: Option<&NSArray<CBService>>);
#[cfg(feature = "CBCharacteristic")]
#[unsafe(method(characteristics))]
#[unsafe(method_family = none)]
pub unsafe fn characteristics(&self) -> Option<Retained<NSArray<CBCharacteristic>>>;
#[cfg(feature = "CBCharacteristic")]
#[unsafe(method(setCharacteristics:))]
#[unsafe(method_family = none)]
pub unsafe fn setCharacteristics(
&self,
characteristics: Option<&NSArray<CBCharacteristic>>,
);
#[cfg(feature = "CBUUID")]
#[unsafe(method(initWithType:primary:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithType_primary(
this: Allocated<Self>,
uuid: &CBUUID,
is_primary: bool,
) -> Retained<Self>;
);
}
#[cfg(feature = "CBAttribute")]
impl CBMutableService {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "CBAttribute")]
impl CBMutableService {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}