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        /// This is a [weak property][objc2::topics::weak_property].
108        /// Setter for [`delegate`][Self::delegate].
109        #[unsafe(method(setDelegate:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn setDelegate(
112            &self,
113            delegate: Option<&ProtocolObject<dyn BEScrollViewDelegate>>,
114        );
115    );
116}
117
118/// Methods declared on superclass `UIView`.
119impl BEScrollView {
120    extern_methods!(
121        #[cfg(feature = "objc2-core-foundation")]
122        #[unsafe(method(initWithFrame:))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
125
126        #[unsafe(method(initWithCoder:))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn initWithCoder(
129            this: Allocated<Self>,
130            coder: &NSCoder,
131        ) -> Option<Retained<Self>>;
132    );
133}
134
135/// Methods declared on superclass `NSObject`.
136impl BEScrollView {
137    extern_methods!(
138        #[unsafe(method(init))]
139        #[unsafe(method_family = init)]
140        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
141
142        #[unsafe(method(new))]
143        #[unsafe(method_family = new)]
144        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
145    );
146}
147
148/// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bescrollviewscrollupdatephase?language=objc)
149// NS_ENUM
150#[repr(transparent)]
151#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
152pub struct BEScrollViewScrollUpdatePhase(pub NSInteger);
153impl BEScrollViewScrollUpdatePhase {
154    #[doc(alias = "BEScrollViewScrollUpdatePhaseBegan")]
155    pub const Began: Self = Self(0);
156    #[doc(alias = "BEScrollViewScrollUpdatePhaseChanged")]
157    pub const Changed: Self = Self(1);
158    #[doc(alias = "BEScrollViewScrollUpdatePhaseEnded")]
159    pub const Ended: Self = Self(2);
160    #[doc(alias = "BEScrollViewScrollUpdatePhaseCancelled")]
161    pub const Cancelled: Self = Self(3);
162}
163
164unsafe impl Encode for BEScrollViewScrollUpdatePhase {
165    const ENCODING: Encoding = NSInteger::ENCODING;
166}
167
168unsafe impl RefEncode for BEScrollViewScrollUpdatePhase {
169    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
170}
171
172extern_class!(
173    /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bescrollviewscrollupdate?language=objc)
174    #[unsafe(super(NSObject))]
175    #[thread_kind = MainThreadOnly]
176    #[derive(Debug, PartialEq, Eq, Hash)]
177    pub struct BEScrollViewScrollUpdate;
178);
179
180extern_conformance!(
181    unsafe impl NSObjectProtocol for BEScrollViewScrollUpdate {}
182);
183
184impl BEScrollViewScrollUpdate {
185    extern_methods!(
186        #[unsafe(method(init))]
187        #[unsafe(method_family = init)]
188        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
189
190        #[unsafe(method(new))]
191        #[unsafe(method_family = new)]
192        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
193
194        #[unsafe(method(timestamp))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn timestamp(&self) -> NSTimeInterval;
197
198        #[unsafe(method(phase))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn phase(&self) -> BEScrollViewScrollUpdatePhase;
201
202        #[cfg(feature = "objc2-core-foundation")]
203        #[unsafe(method(locationInView:))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn locationInView(&self, view: Option<&UIView>) -> CGPoint;
206
207        #[cfg(feature = "objc2-core-foundation")]
208        #[unsafe(method(translationInView:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn translationInView(&self, view: Option<&UIView>) -> CGPoint;
211    );
212}