objc2_app_kit/generated/
NSUserDefaultsController.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsuserdefaultscontroller?language=objc)
12    #[unsafe(super(NSController, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "NSController")]
16    pub struct NSUserDefaultsController;
17);
18
19#[cfg(feature = "NSController")]
20unsafe impl NSCoding for NSUserDefaultsController {}
21
22#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
23unsafe impl NSEditor for NSUserDefaultsController {}
24
25#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
26unsafe impl NSEditorRegistration for NSUserDefaultsController {}
27
28#[cfg(feature = "NSController")]
29unsafe impl NSObjectProtocol for NSUserDefaultsController {}
30
31#[cfg(feature = "NSController")]
32impl NSUserDefaultsController {
33    extern_methods!(
34        #[unsafe(method(sharedUserDefaultsController))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn sharedUserDefaultsController(
37            mtm: MainThreadMarker,
38        ) -> Retained<NSUserDefaultsController>;
39
40        #[unsafe(method(initWithDefaults:initialValues:))]
41        #[unsafe(method_family = init)]
42        pub unsafe fn initWithDefaults_initialValues(
43            this: Allocated<Self>,
44            defaults: Option<&NSUserDefaults>,
45            initial_values: Option<&NSDictionary<NSString, AnyObject>>,
46        ) -> Retained<Self>;
47
48        #[unsafe(method(initWithCoder:))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn initWithCoder(
51            this: Allocated<Self>,
52            coder: &NSCoder,
53        ) -> Option<Retained<Self>>;
54
55        #[unsafe(method(defaults))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn defaults(&self) -> Retained<NSUserDefaults>;
58
59        #[unsafe(method(initialValues))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn initialValues(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
62
63        /// Setter for [`initialValues`][Self::initialValues].
64        #[unsafe(method(setInitialValues:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setInitialValues(
67            &self,
68            initial_values: Option<&NSDictionary<NSString, AnyObject>>,
69        );
70
71        #[unsafe(method(appliesImmediately))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn appliesImmediately(&self) -> bool;
74
75        /// Setter for [`appliesImmediately`][Self::appliesImmediately].
76        #[unsafe(method(setAppliesImmediately:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setAppliesImmediately(&self, applies_immediately: bool);
79
80        #[unsafe(method(hasUnappliedChanges))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn hasUnappliedChanges(&self) -> bool;
83
84        #[unsafe(method(values))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn values(&self) -> Retained<AnyObject>;
87
88        #[unsafe(method(revert:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn revert(&self, sender: Option<&AnyObject>);
91
92        #[unsafe(method(save:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn save(&self, sender: Option<&AnyObject>);
95
96        #[unsafe(method(revertToInitialValues:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn revertToInitialValues(&self, sender: Option<&AnyObject>);
99    );
100}
101
102/// Methods declared on superclass `NSController`.
103#[cfg(feature = "NSController")]
104impl NSUserDefaultsController {
105    extern_methods!(
106        #[unsafe(method(init))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
109    );
110}
111
112/// Methods declared on superclass `NSObject`.
113#[cfg(feature = "NSController")]
114impl NSUserDefaultsController {
115    extern_methods!(
116        #[unsafe(method(new))]
117        #[unsafe(method_family = new)]
118        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
119    );
120}