objc2_ui_kit/generated/
UIPointerAccessory.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
12#[cfg(feature = "objc2-core-foundation")]
14#[repr(C)]
15#[derive(Clone, Copy, Debug, PartialEq)]
16pub struct UIPointerAccessoryPosition {
17 pub offset: CGFloat,
19 pub angle: CGFloat,
21}
22
23#[cfg(feature = "objc2-core-foundation")]
24unsafe impl Encode for UIPointerAccessoryPosition {
25 const ENCODING: Encoding = Encoding::Struct("?", &[<CGFloat>::ENCODING, <CGFloat>::ENCODING]);
26}
27
28#[cfg(feature = "objc2-core-foundation")]
29unsafe impl RefEncode for UIPointerAccessoryPosition {
30 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
31}
32
33#[cfg(feature = "objc2-core-foundation")]
34unsafe impl Send for UIPointerAccessoryPosition {}
35
36#[cfg(feature = "objc2-core-foundation")]
37unsafe impl Sync for UIPointerAccessoryPosition {}
38
39#[cfg(feature = "objc2-core-foundation")]
40impl UIPointerAccessoryPosition {
41 }
43
44extern "C" {
45 #[cfg(feature = "objc2-core-foundation")]
47 pub static UIPointerAccessoryPositionTop: UIPointerAccessoryPosition;
48}
49
50extern "C" {
51 #[cfg(feature = "objc2-core-foundation")]
53 pub static UIPointerAccessoryPositionTopRight: UIPointerAccessoryPosition;
54}
55
56extern "C" {
57 #[cfg(feature = "objc2-core-foundation")]
59 pub static UIPointerAccessoryPositionRight: UIPointerAccessoryPosition;
60}
61
62extern "C" {
63 #[cfg(feature = "objc2-core-foundation")]
65 pub static UIPointerAccessoryPositionBottomRight: UIPointerAccessoryPosition;
66}
67
68extern "C" {
69 #[cfg(feature = "objc2-core-foundation")]
71 pub static UIPointerAccessoryPositionBottom: UIPointerAccessoryPosition;
72}
73
74extern "C" {
75 #[cfg(feature = "objc2-core-foundation")]
77 pub static UIPointerAccessoryPositionBottomLeft: UIPointerAccessoryPosition;
78}
79
80extern "C" {
81 #[cfg(feature = "objc2-core-foundation")]
83 pub static UIPointerAccessoryPositionLeft: UIPointerAccessoryPosition;
84}
85
86extern "C" {
87 #[cfg(feature = "objc2-core-foundation")]
89 pub static UIPointerAccessoryPositionTopLeft: UIPointerAccessoryPosition;
90}
91
92extern_class!(
93 #[unsafe(super(NSObject))]
95 #[thread_kind = MainThreadOnly]
96 #[derive(Debug, PartialEq, Eq, Hash)]
97 pub struct UIPointerAccessory;
98);
99
100extern_conformance!(
101 unsafe impl NSCopying for UIPointerAccessory {}
102);
103
104unsafe impl CopyingHelper for UIPointerAccessory {
105 type Result = Self;
106}
107
108extern_conformance!(
109 unsafe impl NSObjectProtocol for UIPointerAccessory {}
110);
111
112impl UIPointerAccessory {
113 extern_methods!(
114 #[cfg(feature = "UIPointerStyle")]
115 #[unsafe(method(shape))]
117 #[unsafe(method_family = none)]
118 pub fn shape(&self) -> Retained<UIPointerShape>;
119
120 #[cfg(feature = "objc2-core-foundation")]
121 #[unsafe(method(position))]
123 #[unsafe(method_family = none)]
124 pub fn position(&self) -> UIPointerAccessoryPosition;
125
126 #[unsafe(method(orientationMatchesAngle))]
129 #[unsafe(method_family = none)]
130 pub fn orientationMatchesAngle(&self) -> bool;
131
132 #[unsafe(method(setOrientationMatchesAngle:))]
134 #[unsafe(method_family = none)]
135 pub fn setOrientationMatchesAngle(&self, orientation_matches_angle: bool);
136
137 #[cfg(all(feature = "UIPointerStyle", feature = "objc2-core-foundation"))]
138 #[unsafe(method(accessoryWithShape:position:))]
145 #[unsafe(method_family = none)]
146 pub fn accessoryWithShape_position(
147 shape: &UIPointerShape,
148 position: UIPointerAccessoryPosition,
149 ) -> Retained<Self>;
150
151 #[cfg(feature = "objc2-core-foundation")]
152 #[unsafe(method(arrowAccessoryWithPosition:))]
154 #[unsafe(method_family = none)]
155 pub fn arrowAccessoryWithPosition(
156 position: UIPointerAccessoryPosition,
157 mtm: MainThreadMarker,
158 ) -> Retained<Self>;
159
160 #[unsafe(method(init))]
161 #[unsafe(method_family = init)]
162 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
163
164 #[unsafe(method(new))]
165 #[unsafe(method_family = new)]
166 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
167 );
168}