objc2_screen_saver/generated/ScreenSaverDefaults.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10 /// A class that defines a set of methods for saving and restoring user defaults
11 /// for screen savers.
12 ///
13 /// ``ScreenSaverDefaults`` gives you access to preference values you need to
14 /// configure your screen saver. Because multiple apps can load a screen saver,
15 /// you can’t use the standard
16 /// <doc
17 /// ://com.apple.documentation/documentation/foundation/nsuserdefaults>
18 /// object to store preferences. Instead, instantiate this class using the
19 /// ``ScreenSaverDefaults/defaultsForModuleWithName:`` method, which takes your
20 /// screen saver’s bundle identifier as a parameter. The resulting object gives
21 /// you a way to store your preference values and associate them only with your
22 /// screen saver. Use the inherited
23 /// <doc
24 /// ://com.apple.documentation/documentation/foundation/nsuserdefaults>
25 /// methods to load, store, or modify values.
26 ///
27 /// See also [Apple's documentation](https://developer.apple.com/documentation/screensaver/screensaverdefaults?language=objc)
28 #[unsafe(super(NSUserDefaults, NSObject))]
29 #[derive(Debug, PartialEq, Eq, Hash)]
30 pub struct ScreenSaverDefaults;
31);
32
33unsafe impl NSObjectProtocol for ScreenSaverDefaults {}
34
35impl ScreenSaverDefaults {
36 extern_methods!(
37 /// Returns a screen saver defaults instance that reads and writes defaults for the specified
38 /// module.
39 ///
40 /// - Parameters:
41 /// - inModuleName: The bundle identifier for the module.
42 #[unsafe(method(defaultsForModuleWithName:))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn defaultsForModuleWithName(
45 in_module_name: &NSString,
46 ) -> Option<Retained<Self>>;
47 );
48}
49
50/// Methods declared on superclass `NSUserDefaults`.
51impl ScreenSaverDefaults {
52 extern_methods!(
53 /// -init is equivalent to -initWithSuiteName:nil
54 #[unsafe(method(init))]
55 #[unsafe(method_family = init)]
56 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
57
58 /// -initWithSuiteName: initializes an instance of NSUserDefaults that searches the shared preferences search list for the domain 'suitename'. For example, using the identifier of an application group will cause the receiver to search the preferences for that group. Passing the current application's bundle identifier, NSGlobalDomain, or the corresponding CFPreferences constants is an error. Passing nil will search the default search list.
59 #[unsafe(method(initWithSuiteName:))]
60 #[unsafe(method_family = init)]
61 pub unsafe fn initWithSuiteName(
62 this: Allocated<Self>,
63 suitename: Option<&NSString>,
64 ) -> Option<Retained<Self>>;
65
66 /// -initWithUser: is equivalent to -init
67 #[deprecated = "Use -init instead"]
68 #[unsafe(method(initWithUser:))]
69 #[unsafe(method_family = init)]
70 pub unsafe fn initWithUser(
71 this: Allocated<Self>,
72 username: &NSString,
73 ) -> Option<Retained<Self>>;
74 );
75}
76
77/// Methods declared on superclass `NSObject`.
78impl ScreenSaverDefaults {
79 extern_methods!(
80 #[unsafe(method(new))]
81 #[unsafe(method_family = new)]
82 pub unsafe fn new() -> Retained<Self>;
83 );
84}