objc2_browser_engine_kit/generated/
BEScrollView.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10use objc2_quartz_core::*;
11use objc2_ui_kit::*;
12
13use crate::*;
14
15extern_protocol!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bescrollviewdelegate?language=objc)
17    pub unsafe trait BEScrollViewDelegate: UIScrollViewDelegate + MainThreadOnly {
18        #[cfg(feature = "block2")]
19        #[optional]
20        #[unsafe(method(scrollView:handleScrollUpdate:completion:))]
21        #[unsafe(method_family = none)]
22        unsafe fn scrollView_handleScrollUpdate_completion(
23            &self,
24            scroll_view: &BEScrollView,
25            scroll_update: &BEScrollViewScrollUpdate,
26            completion: &block2::DynBlock<dyn Fn(Bool)>,
27        );
28
29        #[optional]
30        #[unsafe(method(parentScrollViewForScrollView:))]
31        #[unsafe(method_family = none)]
32        unsafe fn parentScrollViewForScrollView(
33            &self,
34            scroll_view: &BEScrollView,
35        ) -> Option<Retained<BEScrollView>>;
36    }
37);
38
39extern_class!(
40    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bescrollview?language=objc)
41    #[unsafe(super(UIScrollView, UIView, UIResponder, NSObject))]
42    #[thread_kind = MainThreadOnly]
43    #[derive(Debug, PartialEq, Eq, Hash)]
44    pub struct BEScrollView;
45);
46
47#[cfg(feature = "objc2-quartz-core")]
48extern_conformance!(
49    unsafe impl CALayerDelegate for BEScrollView {}
50);
51
52extern_conformance!(
53    unsafe impl NSCoding for BEScrollView {}
54);
55
56extern_conformance!(
57    unsafe impl NSObjectProtocol for BEScrollView {}
58);
59
60extern_conformance!(
61    unsafe impl UIAppearance for BEScrollView {}
62);
63
64extern_conformance!(
65    unsafe impl UIAppearanceContainer for BEScrollView {}
66);
67
68extern_conformance!(
69    unsafe impl UICoordinateSpace for BEScrollView {}
70);
71
72extern_conformance!(
73    unsafe impl UIDynamicItem for BEScrollView {}
74);
75
76extern_conformance!(
77    unsafe impl UIFocusEnvironment for BEScrollView {}
78);
79
80extern_conformance!(
81    unsafe impl UIFocusItem for BEScrollView {}
82);
83
84extern_conformance!(
85    unsafe impl UIFocusItemContainer for BEScrollView {}
86);
87
88extern_conformance!(
89    unsafe impl UIFocusItemScrollableContainer for BEScrollView {}
90);
91
92extern_conformance!(
93    unsafe impl UIResponderStandardEditActions for BEScrollView {}
94);
95
96extern_conformance!(
97    unsafe impl UITraitEnvironment for BEScrollView {}
98);
99
100impl BEScrollView {
101    extern_methods!(
102        #[unsafe(method(delegate))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn delegate(&self)
105            -> Option<Retained<ProtocolObject<dyn BEScrollViewDelegate>>>;
106
107        /// Setter for [`delegate`][Self::delegate].
108        ///
109        /// This is a [weak property][objc2::topics::weak_property].
110        #[unsafe(method(setDelegate:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setDelegate(
113            &self,
114            delegate: Option<&ProtocolObject<dyn BEScrollViewDelegate>>,
115        );
116    );
117}
118
119/// Methods declared on superclass `UIView`.
120impl BEScrollView {
121    extern_methods!(
122        #[cfg(feature = "objc2-core-foundation")]
123        #[unsafe(method(initWithFrame:))]
124        #[unsafe(method_family = init)]
125        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
126
127        /// # Safety
128        ///
129        /// `coder` possibly has further requirements.
130        #[unsafe(method(initWithCoder:))]
131        #[unsafe(method_family = init)]
132        pub unsafe fn initWithCoder(
133            this: Allocated<Self>,
134            coder: &NSCoder,
135        ) -> Option<Retained<Self>>;
136
137        #[unsafe(method(init))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
140    );
141}
142
143/// Methods declared on superclass `NSObject`.
144impl BEScrollView {
145    extern_methods!(
146        #[unsafe(method(new))]
147        #[unsafe(method_family = new)]
148        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
149    );
150}
151
152/// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bescrollviewscrollupdatephase?language=objc)
153// NS_ENUM
154#[repr(transparent)]
155#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
156pub struct BEScrollViewScrollUpdatePhase(pub NSInteger);
157impl BEScrollViewScrollUpdatePhase {
158    #[doc(alias = "BEScrollViewScrollUpdatePhaseBegan")]
159    pub const Began: Self = Self(0);
160    #[doc(alias = "BEScrollViewScrollUpdatePhaseChanged")]
161    pub const Changed: Self = Self(1);
162    #[doc(alias = "BEScrollViewScrollUpdatePhaseEnded")]
163    pub const Ended: Self = Self(2);
164    #[doc(alias = "BEScrollViewScrollUpdatePhaseCancelled")]
165    pub const Cancelled: Self = Self(3);
166}
167
168unsafe impl Encode for BEScrollViewScrollUpdatePhase {
169    const ENCODING: Encoding = NSInteger::ENCODING;
170}
171
172unsafe impl RefEncode for BEScrollViewScrollUpdatePhase {
173    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
174}
175
176extern_class!(
177    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bescrollviewscrollupdate?language=objc)
178    #[unsafe(super(NSObject))]
179    #[thread_kind = MainThreadOnly]
180    #[derive(Debug, PartialEq, Eq, Hash)]
181    pub struct BEScrollViewScrollUpdate;
182);
183
184extern_conformance!(
185    unsafe impl NSObjectProtocol for BEScrollViewScrollUpdate {}
186);
187
188impl BEScrollViewScrollUpdate {
189    extern_methods!(
190        #[unsafe(method(init))]
191        #[unsafe(method_family = init)]
192        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
193
194        #[unsafe(method(new))]
195        #[unsafe(method_family = new)]
196        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
197
198        #[unsafe(method(timestamp))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn timestamp(&self) -> NSTimeInterval;
201
202        #[unsafe(method(phase))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn phase(&self) -> BEScrollViewScrollUpdatePhase;
205
206        #[cfg(feature = "objc2-core-foundation")]
207        #[unsafe(method(locationInView:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn locationInView(&self, view: Option<&UIView>) -> CGPoint;
210
211        #[cfg(feature = "objc2-core-foundation")]
212        #[unsafe(method(translationInView:))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn translationInView(&self, view: Option<&UIView>) -> CGPoint;
215    );
216}