use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSController, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSController")]
pub struct NSUserDefaultsController;
);
#[cfg(feature = "NSController")]
extern_conformance!(
unsafe impl NSCoding for NSUserDefaultsController {}
);
#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
extern_conformance!(
unsafe impl NSEditor for NSUserDefaultsController {}
);
#[cfg(all(feature = "NSController", feature = "NSKeyValueBinding"))]
extern_conformance!(
unsafe impl NSEditorRegistration for NSUserDefaultsController {}
);
#[cfg(feature = "NSController")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSUserDefaultsController {}
);
#[cfg(feature = "NSController")]
impl NSUserDefaultsController {
extern_methods!(
#[unsafe(method(sharedUserDefaultsController))]
#[unsafe(method_family = none)]
pub fn sharedUserDefaultsController(
mtm: MainThreadMarker,
) -> Retained<NSUserDefaultsController>;
#[unsafe(method(initWithDefaults:initialValues:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithDefaults_initialValues(
this: Allocated<Self>,
defaults: Option<&NSUserDefaults>,
initial_values: Option<&NSDictionary<NSString, AnyObject>>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[unsafe(method(defaults))]
#[unsafe(method_family = none)]
pub fn defaults(&self) -> Retained<NSUserDefaults>;
#[unsafe(method(initialValues))]
#[unsafe(method_family = none)]
pub fn initialValues(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
#[unsafe(method(setInitialValues:))]
#[unsafe(method_family = none)]
pub unsafe fn setInitialValues(
&self,
initial_values: Option<&NSDictionary<NSString, AnyObject>>,
);
#[unsafe(method(appliesImmediately))]
#[unsafe(method_family = none)]
pub fn appliesImmediately(&self) -> bool;
#[unsafe(method(setAppliesImmediately:))]
#[unsafe(method_family = none)]
pub fn setAppliesImmediately(&self, applies_immediately: bool);
#[unsafe(method(hasUnappliedChanges))]
#[unsafe(method_family = none)]
pub fn hasUnappliedChanges(&self) -> bool;
#[unsafe(method(values))]
#[unsafe(method_family = none)]
pub fn values(&self) -> Retained<AnyObject>;
#[unsafe(method(revert:))]
#[unsafe(method_family = none)]
pub unsafe fn revert(&self, sender: Option<&AnyObject>);
#[unsafe(method(save:))]
#[unsafe(method_family = none)]
pub unsafe fn save(&self, sender: Option<&AnyObject>);
#[unsafe(method(revertToInitialValues:))]
#[unsafe(method_family = none)]
pub unsafe fn revertToInitialValues(&self, sender: Option<&AnyObject>);
);
}
#[cfg(feature = "NSController")]
impl NSUserDefaultsController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "NSController")]
impl NSUserDefaultsController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}