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")]
20extern_conformance!(
21    unsafe impl NSCoding for NSUserDefaultsController {}
22);
23
24#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
25extern_conformance!(
26    unsafe impl NSEditor for NSUserDefaultsController {}
27);
28
29#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
30extern_conformance!(
31    unsafe impl NSEditorRegistration for NSUserDefaultsController {}
32);
33
34#[cfg(feature = "NSController")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for NSUserDefaultsController {}
37);
38
39#[cfg(feature = "NSController")]
40impl NSUserDefaultsController {
41    extern_methods!(
42        #[unsafe(method(sharedUserDefaultsController))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn sharedUserDefaultsController(
45            mtm: MainThreadMarker,
46        ) -> Retained<NSUserDefaultsController>;
47
48        #[unsafe(method(initWithDefaults:initialValues:))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn initWithDefaults_initialValues(
51            this: Allocated<Self>,
52            defaults: Option<&NSUserDefaults>,
53            initial_values: Option<&NSDictionary<NSString, AnyObject>>,
54        ) -> Retained<Self>;
55
56        #[unsafe(method(initWithCoder:))]
57        #[unsafe(method_family = init)]
58        pub unsafe fn initWithCoder(
59            this: Allocated<Self>,
60            coder: &NSCoder,
61        ) -> Option<Retained<Self>>;
62
63        #[unsafe(method(defaults))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn defaults(&self) -> Retained<NSUserDefaults>;
66
67        #[unsafe(method(initialValues))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn initialValues(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
70
71        /// Setter for [`initialValues`][Self::initialValues].
72        #[unsafe(method(setInitialValues:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setInitialValues(
75            &self,
76            initial_values: Option<&NSDictionary<NSString, AnyObject>>,
77        );
78
79        #[unsafe(method(appliesImmediately))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn appliesImmediately(&self) -> bool;
82
83        /// Setter for [`appliesImmediately`][Self::appliesImmediately].
84        #[unsafe(method(setAppliesImmediately:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setAppliesImmediately(&self, applies_immediately: bool);
87
88        #[unsafe(method(hasUnappliedChanges))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn hasUnappliedChanges(&self) -> bool;
91
92        #[unsafe(method(values))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn values(&self) -> Retained<AnyObject>;
95
96        #[unsafe(method(revert:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn revert(&self, sender: Option<&AnyObject>);
99
100        #[unsafe(method(save:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn save(&self, sender: Option<&AnyObject>);
103
104        #[unsafe(method(revertToInitialValues:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn revertToInitialValues(&self, sender: Option<&AnyObject>);
107    );
108}
109
110/// Methods declared on superclass `NSController`.
111#[cfg(feature = "NSController")]
112impl NSUserDefaultsController {
113    extern_methods!(
114        #[unsafe(method(init))]
115        #[unsafe(method_family = init)]
116        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
117    );
118}
119
120/// Methods declared on superclass `NSObject`.
121#[cfg(feature = "NSController")]
122impl NSUserDefaultsController {
123    extern_methods!(
124        #[unsafe(method(new))]
125        #[unsafe(method_family = new)]
126        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
127    );
128}