1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSController")]
    pub struct NSUserDefaultsController;

    #[cfg(feature = "NSController")]
    unsafe impl ClassType for NSUserDefaultsController {
        #[inherits(NSObject)]
        type Super = NSController;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(feature = "NSController")]
unsafe impl NSCoding for NSUserDefaultsController {}

#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
unsafe impl NSEditor for NSUserDefaultsController {}

#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
unsafe impl NSEditorRegistration for NSUserDefaultsController {}

#[cfg(feature = "NSController")]
unsafe impl NSObjectProtocol for NSUserDefaultsController {}

extern_methods!(
    #[cfg(feature = "NSController")]
    unsafe impl NSUserDefaultsController {
        #[method_id(@__retain_semantics Other sharedUserDefaultsController)]
        pub unsafe fn sharedUserDefaultsController(
            mtm: MainThreadMarker,
        ) -> Retained<NSUserDefaultsController>;

        #[method_id(@__retain_semantics Init initWithDefaults:initialValues:)]
        pub unsafe fn initWithDefaults_initialValues(
            this: Allocated<Self>,
            defaults: Option<&NSUserDefaults>,
            initial_values: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other defaults)]
        pub unsafe fn defaults(&self) -> Retained<NSUserDefaults>;

        #[method_id(@__retain_semantics Other initialValues)]
        pub unsafe fn initialValues(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;

        #[method(setInitialValues:)]
        pub unsafe fn setInitialValues(
            &self,
            initial_values: Option<&NSDictionary<NSString, AnyObject>>,
        );

        #[method(appliesImmediately)]
        pub unsafe fn appliesImmediately(&self) -> bool;

        #[method(setAppliesImmediately:)]
        pub unsafe fn setAppliesImmediately(&self, applies_immediately: bool);

        #[method(hasUnappliedChanges)]
        pub unsafe fn hasUnappliedChanges(&self) -> bool;

        #[method_id(@__retain_semantics Other values)]
        pub unsafe fn values(&self) -> Retained<AnyObject>;

        #[method(revert:)]
        pub unsafe fn revert(&self, sender: Option<&AnyObject>);

        #[method(save:)]
        pub unsafe fn save(&self, sender: Option<&AnyObject>);

        #[method(revertToInitialValues:)]
        pub unsafe fn revertToInitialValues(&self, sender: Option<&AnyObject>);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSController`
    #[cfg(feature = "NSController")]
    unsafe impl NSUserDefaultsController {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "NSController")]
    unsafe impl NSUserDefaultsController {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);