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!(
#[cfg(feature = "NSController")]
unsafe impl NSUserDefaultsController {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
}
);
extern_methods!(
#[cfg(feature = "NSController")]
unsafe impl NSUserDefaultsController {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
}
);