objc2_security_interface/generated/
SFKeychainSettingsPanel.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_app_kit::*;
7use objc2_foundation::*;
8#[cfg(feature = "objc2-security")]
9use objc2_security::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/securityinterface/sfkeychainsettingspanel?language=objc)
15    #[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct SFKeychainSettingsPanel;
18);
19
20extern_conformance!(
21    unsafe impl NSAccessibility for SFKeychainSettingsPanel {}
22);
23
24extern_conformance!(
25    unsafe impl NSAccessibilityElementProtocol for SFKeychainSettingsPanel {}
26);
27
28extern_conformance!(
29    unsafe impl NSAnimatablePropertyContainer for SFKeychainSettingsPanel {}
30);
31
32extern_conformance!(
33    unsafe impl NSAppearanceCustomization for SFKeychainSettingsPanel {}
34);
35
36extern_conformance!(
37    unsafe impl NSCoding for SFKeychainSettingsPanel {}
38);
39
40extern_conformance!(
41    unsafe impl NSMenuItemValidation for SFKeychainSettingsPanel {}
42);
43
44extern_conformance!(
45    unsafe impl NSObjectProtocol for SFKeychainSettingsPanel {}
46);
47
48extern_conformance!(
49    unsafe impl NSUserInterfaceItemIdentification for SFKeychainSettingsPanel {}
50);
51
52extern_conformance!(
53    unsafe impl NSUserInterfaceValidations for SFKeychainSettingsPanel {}
54);
55
56impl SFKeychainSettingsPanel {
57    extern_methods!(
58        /// Returns a global instance of SFKeychainSettingsPanel object.
59        #[unsafe(method(sharedKeychainSettingsPanel))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn sharedKeychainSettingsPanel(
62            mtm: MainThreadMarker,
63        ) -> Option<Retained<SFKeychainSettingsPanel>>;
64
65        #[cfg(feature = "objc2-security")]
66        /// Changes the keychain settings using the settings panel. The panel contains settings such as "lock on sleep", "automatic lock", etc. If the user attempts to change the settings of a locked keychain, the unlock panel will be presented. It returns NSOKButton or NSCancelButton.
67        ///
68        /// Parameter `settings`: A pointer to a keychain settings structure. Since this structure is versioned, you must preallocate it and fill in the version of the structure.
69        ///
70        /// Parameter `keychain`: The keychain that will have its settings changed.
71        #[unsafe(method(runModalForSettings:keychain:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn runModalForSettings_keychain(
74            &self,
75            settings: *mut SecKeychainSettings,
76            keychain: Option<&SecKeychain>,
77        ) -> NSInteger;
78
79        #[cfg(feature = "objc2-security")]
80        /// Presents a sheet version of SFKeychainSettingsPanel. The didEndSelector returnCode will contain either NSOKButton or NSCancelButton.
81        ///
82        /// Parameter `docWindow`: The panel in which the settings sheet slides down; acting as a document modal window. If docWindow is nil, the behavior defaults to a standalone modal window.
83        ///
84        /// Parameter `delegate`: Delegate object in which didEndSelector is a method.
85        ///
86        /// Parameter `didEndSelector`: The didEndSelector method is optional. If implemented by the delegate, this method is invoked after the modal session has ended, but before dismissing the same panel. The didEndSelector may dismiss the keychain panel itself; otherwise it will be dismissed on return from the method. The didEndSelector should have the following signature:
87        /// - (void)settingsPanelDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
88        ///
89        /// Parameter `contextInfo`: A client-defined context.
90        ///
91        /// Parameter `settings`: A pointer to a keychain settings structure. Since this structure is versioned, you must preallocate it and fill in the version of the structure.
92        ///
93        /// Parameter `keychain`: The keychain that will have its settings changed.
94        #[unsafe(method(beginSheetForWindow:modalDelegate:didEndSelector:contextInfo:settings:keychain:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn beginSheetForWindow_modalDelegate_didEndSelector_contextInfo_settings_keychain(
97            &self,
98            doc_window: Option<&NSWindow>,
99            delegate: Option<&AnyObject>,
100            did_end_selector: Option<Sel>,
101            context_info: *mut c_void,
102            settings: *mut SecKeychainSettings,
103            keychain: Option<&SecKeychain>,
104        );
105    );
106}
107
108/// Methods declared on superclass `NSWindow`.
109impl SFKeychainSettingsPanel {
110    extern_methods!(
111        #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn initWithContentRect_styleMask_backing_defer(
114            this: Allocated<Self>,
115            content_rect: NSRect,
116            style: NSWindowStyleMask,
117            backing_store_type: NSBackingStoreType,
118            flag: bool,
119        ) -> Retained<Self>;
120
121        #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
122        #[unsafe(method_family = init)]
123        pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
124            this: Allocated<Self>,
125            content_rect: NSRect,
126            style: NSWindowStyleMask,
127            backing_store_type: NSBackingStoreType,
128            flag: bool,
129            screen: Option<&NSScreen>,
130        ) -> Retained<Self>;
131
132        #[unsafe(method(initWithCoder:))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
135
136        /// Convenience method for creating an autoreleased titled window with the given contentViewController. A basic NSWindow with the following attributes is made: titled, closable, resizable, miniaturizable. The window's title is automatically bound to the contentViewController's title. The size of the window can easily be controlled by utilizing autolayout and applying size constraints to the view (or its subviews). The window has isReleasedWhenClosed set to NO, and it must be explicitly retained to keep the window instance alive. To have it automatically be freed when it is closed, do the following: [window retain] and [window setReleasedWhenClosed:YES].
137        #[unsafe(method(windowWithContentViewController:))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn windowWithContentViewController(
140            content_view_controller: &NSViewController,
141        ) -> Retained<Self>;
142    );
143}
144
145/// Methods declared on superclass `NSResponder`.
146impl SFKeychainSettingsPanel {
147    extern_methods!(
148        #[unsafe(method(init))]
149        #[unsafe(method_family = init)]
150        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
151    );
152}
153
154/// Methods declared on superclass `NSObject`.
155impl SFKeychainSettingsPanel {
156    extern_methods!(
157        #[unsafe(method(new))]
158        #[unsafe(method_family = new)]
159        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
160    );
161}