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
39extern "C" {
42 #[cfg(feature = "objc2-core-foundation")]
44 pub static UIPointerAccessoryPositionTop: UIPointerAccessoryPosition;
45}
46
47extern "C" {
48 #[cfg(feature = "objc2-core-foundation")]
50 pub static UIPointerAccessoryPositionTopRight: UIPointerAccessoryPosition;
51}
52
53extern "C" {
54 #[cfg(feature = "objc2-core-foundation")]
56 pub static UIPointerAccessoryPositionRight: UIPointerAccessoryPosition;
57}
58
59extern "C" {
60 #[cfg(feature = "objc2-core-foundation")]
62 pub static UIPointerAccessoryPositionBottomRight: UIPointerAccessoryPosition;
63}
64
65extern "C" {
66 #[cfg(feature = "objc2-core-foundation")]
68 pub static UIPointerAccessoryPositionBottom: UIPointerAccessoryPosition;
69}
70
71extern "C" {
72 #[cfg(feature = "objc2-core-foundation")]
74 pub static UIPointerAccessoryPositionBottomLeft: UIPointerAccessoryPosition;
75}
76
77extern "C" {
78 #[cfg(feature = "objc2-core-foundation")]
80 pub static UIPointerAccessoryPositionLeft: UIPointerAccessoryPosition;
81}
82
83extern "C" {
84 #[cfg(feature = "objc2-core-foundation")]
86 pub static UIPointerAccessoryPositionTopLeft: UIPointerAccessoryPosition;
87}
88
89extern_class!(
90 #[unsafe(super(NSObject))]
92 #[thread_kind = MainThreadOnly]
93 #[derive(Debug, PartialEq, Eq, Hash)]
94 pub struct UIPointerAccessory;
95);
96
97unsafe impl NSCopying for UIPointerAccessory {}
98
99unsafe impl CopyingHelper for UIPointerAccessory {
100 type Result = Self;
101}
102
103unsafe impl NSObjectProtocol for UIPointerAccessory {}
104
105impl UIPointerAccessory {
106 extern_methods!(
107 #[cfg(feature = "UIPointerStyle")]
108 #[unsafe(method(shape))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn shape(&self) -> Retained<UIPointerShape>;
112
113 #[cfg(feature = "objc2-core-foundation")]
114 #[unsafe(method(position))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn position(&self) -> UIPointerAccessoryPosition;
118
119 #[unsafe(method(orientationMatchesAngle))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn orientationMatchesAngle(&self) -> bool;
124
125 #[unsafe(method(setOrientationMatchesAngle:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn setOrientationMatchesAngle(&self, orientation_matches_angle: bool);
129
130 #[cfg(all(feature = "UIPointerStyle", feature = "objc2-core-foundation"))]
131 #[unsafe(method(accessoryWithShape:position:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn accessoryWithShape_position(
140 shape: &UIPointerShape,
141 position: UIPointerAccessoryPosition,
142 ) -> Retained<Self>;
143
144 #[cfg(feature = "objc2-core-foundation")]
145 #[unsafe(method(arrowAccessoryWithPosition:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn arrowAccessoryWithPosition(
149 position: UIPointerAccessoryPosition,
150 mtm: MainThreadMarker,
151 ) -> Retained<Self>;
152
153 #[unsafe(method(init))]
154 #[unsafe(method_family = init)]
155 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
156
157 #[unsafe(method(new))]
158 #[unsafe(method_family = new)]
159 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
160 );
161}