objc2_app_kit/generated/
NSTintConfiguration.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstintconfiguration?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct NSTintConfiguration;
14);
15
16extern_conformance!(
17    unsafe impl NSCoding for NSTintConfiguration {}
18);
19
20extern_conformance!(
21    unsafe impl NSCopying for NSTintConfiguration {}
22);
23
24unsafe impl CopyingHelper for NSTintConfiguration {
25    type Result = Self;
26}
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for NSTintConfiguration {}
30);
31
32extern_conformance!(
33    unsafe impl NSSecureCoding for NSTintConfiguration {}
34);
35
36impl NSTintConfiguration {
37    extern_methods!(
38        /// Specifies that content should be tinted using the system default for its context.
39        /// For example, a source list icon's default tint matches the active Accent Color.
40        #[unsafe(method(defaultTintConfiguration))]
41        #[unsafe(method_family = none)]
42        pub fn defaultTintConfiguration() -> Retained<NSTintConfiguration>;
43
44        /// Specifies that content should prefer a monochrome appearance.
45        /// Monochrome content remains monochrome regardless of the system Accent Color.
46        #[unsafe(method(monochromeTintConfiguration))]
47        #[unsafe(method_family = none)]
48        pub fn monochromeTintConfiguration() -> Retained<NSTintConfiguration>;
49
50        #[cfg(feature = "NSColor")]
51        /// Specifies that content should be tinted with a particular color whenever the app's preferred Accent Color is in use, i.e. when the system Accent Color is configured to "Multicolor". If the system Accent Color is configured to any other color, this tint configuration defers to the Accent Color.
52        ///
53        /// This type of configuration should be used for custom colors that are designed to match an app-specific Accent Color, but would mismatch a user-selected color.
54        #[unsafe(method(tintConfigurationWithPreferredColor:))]
55        #[unsafe(method_family = none)]
56        pub fn tintConfigurationWithPreferredColor(color: &NSColor) -> Retained<Self>;
57
58        #[cfg(feature = "NSColor")]
59        /// Specifies that content should be tinted with a specific color value.
60        /// The specified color value is used regardless of the system Accent Color.
61        #[unsafe(method(tintConfigurationWithFixedColor:))]
62        #[unsafe(method_family = none)]
63        pub fn tintConfigurationWithFixedColor(color: &NSColor) -> Retained<Self>;
64
65        #[cfg(feature = "NSColor")]
66        /// The base NSColor supplied when creating the tint configuration object. If the receiver wasn't created using a base NSColor, this property returns nil.
67        #[unsafe(method(baseTintColor))]
68        #[unsafe(method_family = none)]
69        pub fn baseTintColor(&self) -> Option<Retained<NSColor>>;
70
71        #[cfg(feature = "NSColor")]
72        /// An equivalent NSColor matching the effective content tint of the receiver. If the receiver can't be represented as a NSColor, this property returns nil.
73        #[unsafe(method(equivalentContentTintColor))]
74        #[unsafe(method_family = none)]
75        pub fn equivalentContentTintColor(&self) -> Option<Retained<NSColor>>;
76
77        /// If YES, the tint configuration alters its effect based on the user's preferred Accent Color. Otherwise, the tint configuration produces a constant effect regardless of the Accent Color preference.
78        #[unsafe(method(adaptsToUserAccentColor))]
79        #[unsafe(method_family = none)]
80        pub fn adaptsToUserAccentColor(&self) -> bool;
81    );
82}
83
84/// Methods declared on superclass `NSObject`.
85impl NSTintConfiguration {
86    extern_methods!(
87        #[unsafe(method(init))]
88        #[unsafe(method_family = init)]
89        pub fn init(this: Allocated<Self>) -> Retained<Self>;
90
91        #[unsafe(method(new))]
92        #[unsafe(method_family = new)]
93        pub fn new() -> Retained<Self>;
94    );
95}
96
97impl DefaultRetained for NSTintConfiguration {
98    #[inline]
99    fn default_retained() -> Retained<Self> {
100        Self::new()
101    }
102}