objc2_ui_kit/generated/
UIKey.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[thread_kind = MainThreadOnly]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct UIKey;
15);
16
17extern_conformance!(
18 unsafe impl NSCoding for UIKey {}
19);
20
21extern_conformance!(
22 unsafe impl NSCopying for UIKey {}
23);
24
25unsafe impl CopyingHelper for UIKey {
26 type Result = Self;
27}
28
29extern_conformance!(
30 unsafe impl NSObjectProtocol for UIKey {}
31);
32
33impl UIKey {
34 extern_methods!(
35 #[unsafe(method(characters))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn characters(&self) -> Retained<NSString>;
43
44 #[unsafe(method(charactersIgnoringModifiers))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn charactersIgnoringModifiers(&self) -> Retained<NSString>;
52
53 #[cfg(feature = "UICommand")]
54 #[unsafe(method(modifierFlags))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn modifierFlags(&self) -> UIKeyModifierFlags;
58
59 #[cfg(all(feature = "UIKeyConstants", feature = "objc2-core-foundation"))]
60 #[unsafe(method(keyCode))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn keyCode(&self) -> UIKeyboardHIDUsage;
64 );
65}
66
67impl UIKey {
69 extern_methods!(
70 #[unsafe(method(init))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74 #[unsafe(method(new))]
75 #[unsafe(method_family = new)]
76 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
77 );
78}