objc2_ui_kit/generated/
UIToolTipInteraction.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[thread_kind = MainThreadOnly]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct UIToolTipInteraction;
18);
19
20unsafe impl NSObjectProtocol for UIToolTipInteraction {}
21
22#[cfg(feature = "UIInteraction")]
23unsafe impl UIInteraction for UIToolTipInteraction {}
24
25impl UIToolTipInteraction {
26 extern_methods!(
27 #[unsafe(method(delegate))]
29 #[unsafe(method_family = none)]
30 pub unsafe fn delegate(
31 &self,
32 ) -> Option<Retained<ProtocolObject<dyn UIToolTipInteractionDelegate>>>;
33
34 #[unsafe(method(setDelegate:))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn setDelegate(
39 &self,
40 delegate: Option<&ProtocolObject<dyn UIToolTipInteractionDelegate>>,
41 );
42
43 #[unsafe(method(isEnabled))]
45 #[unsafe(method_family = none)]
46 pub unsafe fn isEnabled(&self) -> bool;
47
48 #[unsafe(method(setEnabled:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn setEnabled(&self, enabled: bool);
52
53 #[unsafe(method(defaultToolTip))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn defaultToolTip(&self) -> Option<Retained<NSString>>;
57
58 #[unsafe(method(setDefaultToolTip:))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn setDefaultToolTip(&self, default_tool_tip: Option<&NSString>);
62
63 #[unsafe(method(init))]
65 #[unsafe(method_family = init)]
66 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
67
68 #[unsafe(method(initWithDefaultToolTip:))]
69 #[unsafe(method_family = init)]
70 pub unsafe fn initWithDefaultToolTip(
71 this: Allocated<Self>,
72 default_tool_tip: &NSString,
73 ) -> Retained<Self>;
74 );
75}
76
77impl UIToolTipInteraction {
79 extern_methods!(
80 #[unsafe(method(new))]
81 #[unsafe(method_family = new)]
82 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
83 );
84}
85
86extern_class!(
87 #[unsafe(super(NSObject))]
89 #[thread_kind = MainThreadOnly]
90 #[derive(Debug, PartialEq, Eq, Hash)]
91 pub struct UIToolTipConfiguration;
92);
93
94unsafe impl NSObjectProtocol for UIToolTipConfiguration {}
95
96impl UIToolTipConfiguration {
97 extern_methods!(
98 #[unsafe(method(toolTip))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn toolTip(&self) -> Retained<NSString>;
102
103 #[cfg(feature = "objc2-core-foundation")]
104 #[unsafe(method(sourceRect))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn sourceRect(&self) -> CGRect;
108
109 #[unsafe(method(configurationWithToolTip:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn configurationWithToolTip(
113 tool_tip: &NSString,
114 mtm: MainThreadMarker,
115 ) -> Retained<Self>;
116
117 #[cfg(feature = "objc2-core-foundation")]
118 #[unsafe(method(configurationWithToolTip:inRect:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn configurationWithToolTip_inRect(
122 tool_tip: &NSString,
123 source_rect: CGRect,
124 mtm: MainThreadMarker,
125 ) -> Retained<Self>;
126
127 #[unsafe(method(new))]
128 #[unsafe(method_family = new)]
129 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
130
131 #[unsafe(method(init))]
132 #[unsafe(method_family = init)]
133 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
134 );
135}
136
137extern_protocol!(
138 pub unsafe trait UIToolTipInteractionDelegate:
140 NSObjectProtocol + MainThreadOnly
141 {
142 #[cfg(feature = "objc2-core-foundation")]
143 #[optional]
151 #[unsafe(method(toolTipInteraction:configurationAtPoint:))]
152 #[unsafe(method_family = none)]
153 unsafe fn toolTipInteraction_configurationAtPoint(
154 &self,
155 interaction: &UIToolTipInteraction,
156 point: CGPoint,
157 ) -> Option<Retained<UIToolTipConfiguration>>;
158 }
159);