use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use objc2_ui_kit::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct BEKeyPressState(pub NSInteger);
impl BEKeyPressState {
#[doc(alias = "BEKeyPressStateDown")]
pub const Down: Self = Self(1);
#[doc(alias = "BEKeyPressStateUp")]
pub const Up: Self = Self(2);
}
unsafe impl Encode for BEKeyPressState {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for BEKeyPressState {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct BEKeyEntry;
);
extern_conformance!(
unsafe impl NSObjectProtocol for BEKeyEntry {}
);
impl BEKeyEntry {
extern_methods!(
#[unsafe(method(key))]
#[unsafe(method_family = none)]
pub unsafe fn key(&self, mtm: MainThreadMarker) -> Retained<UIKey>;
#[unsafe(method(state))]
#[unsafe(method_family = none)]
pub unsafe fn state(&self) -> BEKeyPressState;
#[unsafe(method(isKeyRepeating))]
#[unsafe(method_family = none)]
pub unsafe fn isKeyRepeating(&self) -> bool;
#[unsafe(method(timestamp))]
#[unsafe(method_family = none)]
pub unsafe fn timestamp(&self) -> NSTimeInterval;
#[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>;
);
}