objc2_quartz_core/generated/
CAScrollLayer.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
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cascrolllayerscrollmode?language=objc)
13// NS_TYPED_ENUM
14pub type CAScrollLayerScrollMode = NSString;
15
16extern_class!(
17    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/cascrolllayer?language=objc)
18    #[unsafe(super(CALayer, NSObject))]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(feature = "CALayer")]
21    pub struct CAScrollLayer;
22);
23
24#[cfg(all(feature = "CALayer", feature = "CAMediaTiming"))]
25extern_conformance!(
26    unsafe impl CAMediaTiming for CAScrollLayer {}
27);
28
29#[cfg(feature = "CALayer")]
30extern_conformance!(
31    unsafe impl NSCoding for CAScrollLayer {}
32);
33
34#[cfg(feature = "CALayer")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for CAScrollLayer {}
37);
38
39#[cfg(feature = "CALayer")]
40extern_conformance!(
41    unsafe impl NSSecureCoding for CAScrollLayer {}
42);
43
44#[cfg(feature = "CALayer")]
45impl CAScrollLayer {
46    extern_methods!(
47        #[cfg(feature = "objc2-core-foundation")]
48        #[unsafe(method(scrollToPoint:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn scrollToPoint(&self, p: CGPoint);
51
52        #[cfg(feature = "objc2-core-foundation")]
53        #[unsafe(method(scrollToRect:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn scrollToRect(&self, r: CGRect);
56
57        #[unsafe(method(scrollMode))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn scrollMode(&self) -> Retained<CAScrollLayerScrollMode>;
60
61        /// Setter for [`scrollMode`][Self::scrollMode].
62        #[unsafe(method(setScrollMode:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setScrollMode(&self, scroll_mode: &CAScrollLayerScrollMode);
65    );
66}
67
68/// Methods declared on superclass `CALayer`.
69#[cfg(feature = "CALayer")]
70impl CAScrollLayer {
71    extern_methods!(
72        /// Layer creation and initialization. *
73        #[unsafe(method(layer))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn layer() -> Retained<Self>;
76
77        #[unsafe(method(init))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
80
81        #[unsafe(method(initWithLayer:))]
82        #[unsafe(method_family = init)]
83        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
84    );
85}
86
87/// Methods declared on superclass `NSObject`.
88#[cfg(feature = "CALayer")]
89impl CAScrollLayer {
90    extern_methods!(
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub unsafe fn new() -> Retained<Self>;
94    );
95}
96
97/// CALayerScrolling.
98#[cfg(feature = "CALayer")]
99impl CALayer {
100    extern_methods!(
101        #[cfg(feature = "objc2-core-foundation")]
102        #[unsafe(method(scrollPoint:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn scrollPoint(&self, p: CGPoint);
105
106        #[cfg(feature = "objc2-core-foundation")]
107        #[unsafe(method(scrollRectToVisible:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn scrollRectToVisible(&self, r: CGRect);
110
111        #[cfg(feature = "objc2-core-foundation")]
112        #[unsafe(method(visibleRect))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn visibleRect(&self) -> CGRect;
115    );
116}
117
118extern "C" {
119    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollnone?language=objc)
120    pub static kCAScrollNone: &'static CAScrollLayerScrollMode;
121}
122
123extern "C" {
124    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollvertically?language=objc)
125    pub static kCAScrollVertically: &'static CAScrollLayerScrollMode;
126}
127
128extern "C" {
129    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollhorizontally?language=objc)
130    pub static kCAScrollHorizontally: &'static CAScrollLayerScrollMode;
131}
132
133extern "C" {
134    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollboth?language=objc)
135    pub static kCAScrollBoth: &'static CAScrollLayerScrollMode;
136}