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
16unsafe impl NSCoding for NSTintConfiguration {}
17
18unsafe impl NSCopying for NSTintConfiguration {}
19
20unsafe impl CopyingHelper for NSTintConfiguration {
21    type Result = Self;
22}
23
24unsafe impl NSObjectProtocol for NSTintConfiguration {}
25
26unsafe impl NSSecureCoding for NSTintConfiguration {}
27
28impl NSTintConfiguration {
29    extern_methods!(
30        /// Specifies that content should be tinted using the system default for its context.
31        /// For example, a source list icon's default tint matches the active Accent Color.
32        #[unsafe(method(defaultTintConfiguration))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn defaultTintConfiguration() -> Retained<NSTintConfiguration>;
35
36        /// Specifies that content should prefer a monochrome appearance.
37        /// Monochrome content remains monochrome regardless of the system Accent Color.
38        #[unsafe(method(monochromeTintConfiguration))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn monochromeTintConfiguration() -> Retained<NSTintConfiguration>;
41
42        #[cfg(feature = "NSColor")]
43        /// 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.
44        ///
45        /// 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.
46        #[unsafe(method(tintConfigurationWithPreferredColor:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn tintConfigurationWithPreferredColor(color: &NSColor) -> Retained<Self>;
49
50        #[cfg(feature = "NSColor")]
51        /// Specifies that content should be tinted with a specific color value.
52        /// The specified color value is used regardless of the system Accent Color.
53        #[unsafe(method(tintConfigurationWithFixedColor:))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn tintConfigurationWithFixedColor(color: &NSColor) -> Retained<Self>;
56
57        #[cfg(feature = "NSColor")]
58        /// The base NSColor supplied when creating the tint configuration object. If the receiver wasn't created using a base NSColor, this property returns nil.
59        #[unsafe(method(baseTintColor))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn baseTintColor(&self) -> Option<Retained<NSColor>>;
62
63        #[cfg(feature = "NSColor")]
64        /// 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.
65        #[unsafe(method(equivalentContentTintColor))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn equivalentContentTintColor(&self) -> Option<Retained<NSColor>>;
68
69        /// 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.
70        #[unsafe(method(adaptsToUserAccentColor))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn adaptsToUserAccentColor(&self) -> bool;
73    );
74}
75
76/// Methods declared on superclass `NSObject`.
77impl NSTintConfiguration {
78    extern_methods!(
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[unsafe(method(new))]
84        #[unsafe(method_family = new)]
85        pub unsafe fn new() -> Retained<Self>;
86    );
87}