objc2_ui_kit/generated/
UIShadowProperties.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
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uishadowproperties?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UIShadowProperties;
18);
19
20unsafe impl NSCoding for UIShadowProperties {}
21
22unsafe impl NSCopying for UIShadowProperties {}
23
24unsafe impl CopyingHelper for UIShadowProperties {
25    type Result = Self;
26}
27
28unsafe impl NSObjectProtocol for UIShadowProperties {}
29
30unsafe impl NSSecureCoding for UIShadowProperties {}
31
32impl UIShadowProperties {
33    extern_methods!(
34        #[cfg(feature = "UIColor")]
35        /// The color to use when rendering the shadow. Defaults to `UIColor.blackColor`.
36        #[unsafe(method(color))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn color(&self) -> Retained<UIColor>;
39
40        #[cfg(feature = "UIColor")]
41        /// Setter for [`color`][Self::color].
42        #[unsafe(method(setColor:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn setColor(&self, color: &UIColor);
45
46        #[cfg(feature = "objc2-core-foundation")]
47        /// The shadow's opacity. Defaults to `0.0`.
48        #[unsafe(method(opacity))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn opacity(&self) -> CGFloat;
51
52        #[cfg(feature = "objc2-core-foundation")]
53        /// Setter for [`opacity`][Self::opacity].
54        #[unsafe(method(setOpacity:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn setOpacity(&self, opacity: CGFloat);
57
58        #[cfg(feature = "objc2-core-foundation")]
59        /// The blur radius, in points, used to render the shadow. Defaults to `0.0`.
60        #[unsafe(method(radius))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn radius(&self) -> CGFloat;
63
64        #[cfg(feature = "objc2-core-foundation")]
65        /// Setter for [`radius`][Self::radius].
66        #[unsafe(method(setRadius:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setRadius(&self, radius: CGFloat);
69
70        #[cfg(feature = "objc2-core-foundation")]
71        /// The offset, in points, of the layer's shadow. Defaults to `CGSizeZero`.
72        #[unsafe(method(offset))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn offset(&self) -> CGSize;
75
76        #[cfg(feature = "objc2-core-foundation")]
77        /// Setter for [`offset`][Self::offset].
78        #[unsafe(method(setOffset:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn setOffset(&self, offset: CGSize);
81
82        #[cfg(feature = "UIBezierPath")]
83        /// The path that is used to create the shadow. When `nil`, the shadow will be rendered to match
84        /// the bounds of the view that it is applied to.
85        /// Defaults to `nil`.
86        #[unsafe(method(path))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn path(&self) -> Option<Retained<UIBezierPath>>;
89
90        #[cfg(feature = "UIBezierPath")]
91        /// Setter for [`path`][Self::path].
92        #[unsafe(method(setPath:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setPath(&self, path: Option<&UIBezierPath>);
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl UIShadowProperties {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
108    );
109}