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