objc2_app_kit/generated/
NSShadow.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/appkit/nsshadow?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct NSShadow;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for NSShadow {}
21);
22
23extern_conformance!(
24    unsafe impl NSCopying for NSShadow {}
25);
26
27unsafe impl CopyingHelper for NSShadow {
28    type Result = Self;
29}
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for NSShadow {}
33);
34
35extern_conformance!(
36    unsafe impl NSSecureCoding for NSShadow {}
37);
38
39impl NSShadow {
40    extern_methods!(
41        #[unsafe(method(init))]
42        #[unsafe(method_family = init)]
43        pub fn init(this: Allocated<Self>) -> Retained<Self>;
44
45        #[unsafe(method(shadowOffset))]
46        #[unsafe(method_family = none)]
47        pub fn shadowOffset(&self) -> NSSize;
48
49        /// Setter for [`shadowOffset`][Self::shadowOffset].
50        #[unsafe(method(setShadowOffset:))]
51        #[unsafe(method_family = none)]
52        pub fn setShadowOffset(&self, shadow_offset: NSSize);
53
54        #[cfg(feature = "objc2-core-foundation")]
55        #[unsafe(method(shadowBlurRadius))]
56        #[unsafe(method_family = none)]
57        pub fn shadowBlurRadius(&self) -> CGFloat;
58
59        #[cfg(feature = "objc2-core-foundation")]
60        /// Setter for [`shadowBlurRadius`][Self::shadowBlurRadius].
61        #[unsafe(method(setShadowBlurRadius:))]
62        #[unsafe(method_family = none)]
63        pub fn setShadowBlurRadius(&self, shadow_blur_radius: CGFloat);
64
65        #[cfg(feature = "NSColor")]
66        #[unsafe(method(shadowColor))]
67        #[unsafe(method_family = none)]
68        pub fn shadowColor(&self) -> Option<Retained<NSColor>>;
69
70        #[cfg(feature = "NSColor")]
71        /// Setter for [`shadowColor`][Self::shadowColor].
72        ///
73        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
74        #[unsafe(method(setShadowColor:))]
75        #[unsafe(method_family = none)]
76        pub fn setShadowColor(&self, shadow_color: Option<&NSColor>);
77
78        #[unsafe(method(set))]
79        #[unsafe(method_family = none)]
80        pub fn set(&self);
81    );
82}
83
84/// Methods declared on superclass `NSObject`.
85impl NSShadow {
86    extern_methods!(
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub fn new() -> Retained<Self>;
90    );
91}
92
93impl DefaultRetained for NSShadow {
94    #[inline]
95    fn default_retained() -> Retained<Self> {
96        Self::new()
97    }
98}