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 fn scrollToPoint(&self, p: CGPoint);
51
52        #[cfg(feature = "objc2-core-foundation")]
53        #[unsafe(method(scrollToRect:))]
54        #[unsafe(method_family = none)]
55        pub fn scrollToRect(&self, r: CGRect);
56
57        #[unsafe(method(scrollMode))]
58        #[unsafe(method_family = none)]
59        pub fn scrollMode(&self) -> Retained<CAScrollLayerScrollMode>;
60
61        /// Setter for [`scrollMode`][Self::scrollMode].
62        ///
63        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
64        #[unsafe(method(setScrollMode:))]
65        #[unsafe(method_family = none)]
66        pub fn setScrollMode(&self, scroll_mode: &CAScrollLayerScrollMode);
67    );
68}
69
70/// Methods declared on superclass `CALayer`.
71#[cfg(feature = "CALayer")]
72impl CAScrollLayer {
73    extern_methods!(
74        /// Layer creation and initialization. *
75        #[unsafe(method(layer))]
76        #[unsafe(method_family = none)]
77        pub fn layer() -> Retained<Self>;
78
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        /// # Safety
84        ///
85        /// `layer` should be of the correct type.
86        #[unsafe(method(initWithLayer:))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn initWithLayer(this: Allocated<Self>, layer: &AnyObject) -> Retained<Self>;
89    );
90}
91
92/// Methods declared on superclass `NSObject`.
93#[cfg(feature = "CALayer")]
94impl CAScrollLayer {
95    extern_methods!(
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub fn new() -> Retained<Self>;
99    );
100}
101
102#[cfg(feature = "CALayer")]
103impl DefaultRetained for CAScrollLayer {
104    #[inline]
105    fn default_retained() -> Retained<Self> {
106        Self::new()
107    }
108}
109
110/// CALayerScrolling.
111#[cfg(feature = "CALayer")]
112impl CALayer {
113    extern_methods!(
114        #[cfg(feature = "objc2-core-foundation")]
115        #[unsafe(method(scrollPoint:))]
116        #[unsafe(method_family = none)]
117        pub fn scrollPoint(&self, p: CGPoint);
118
119        #[cfg(feature = "objc2-core-foundation")]
120        #[unsafe(method(scrollRectToVisible:))]
121        #[unsafe(method_family = none)]
122        pub fn scrollRectToVisible(&self, r: CGRect);
123
124        #[cfg(feature = "objc2-core-foundation")]
125        #[unsafe(method(visibleRect))]
126        #[unsafe(method_family = none)]
127        pub fn visibleRect(&self) -> CGRect;
128    );
129}
130
131extern "C" {
132    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollnone?language=objc)
133    pub static kCAScrollNone: &'static CAScrollLayerScrollMode;
134}
135
136extern "C" {
137    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollvertically?language=objc)
138    pub static kCAScrollVertically: &'static CAScrollLayerScrollMode;
139}
140
141extern "C" {
142    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollhorizontally?language=objc)
143    pub static kCAScrollHorizontally: &'static CAScrollLayerScrollMode;
144}
145
146extern "C" {
147    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcascrollboth?language=objc)
148    pub static kCAScrollBoth: &'static CAScrollLayerScrollMode;
149}