objc2_app_kit/generated/
NSController.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_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscontroller?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct NSController;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for NSController {}
20);
21
22#[cfg(feature = "NSKeyValueBinding")]
23extern_conformance!(
24    unsafe impl NSEditor for NSController {}
25);
26
27#[cfg(feature = "NSKeyValueBinding")]
28extern_conformance!(
29    unsafe impl NSEditorRegistration for NSController {}
30);
31
32extern_conformance!(
33    unsafe impl NSObjectProtocol for NSController {}
34);
35
36impl NSController {
37    extern_methods!(
38        #[unsafe(method(init))]
39        #[unsafe(method_family = init)]
40        pub fn init(this: Allocated<Self>) -> Retained<Self>;
41
42        /// # Safety
43        ///
44        /// `coder` possibly has further requirements.
45        #[unsafe(method(initWithCoder:))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithCoder(
48            this: Allocated<Self>,
49            coder: &NSCoder,
50        ) -> Option<Retained<Self>>;
51
52        #[cfg(feature = "NSKeyValueBinding")]
53        #[unsafe(method(objectDidBeginEditing:))]
54        #[unsafe(method_family = none)]
55        pub fn objectDidBeginEditing(&self, editor: &ProtocolObject<dyn NSEditor>);
56
57        #[cfg(feature = "NSKeyValueBinding")]
58        #[unsafe(method(objectDidEndEditing:))]
59        #[unsafe(method_family = none)]
60        pub fn objectDidEndEditing(&self, editor: &ProtocolObject<dyn NSEditor>);
61
62        #[unsafe(method(discardEditing))]
63        #[unsafe(method_family = none)]
64        pub fn discardEditing(&self);
65
66        #[unsafe(method(commitEditing))]
67        #[unsafe(method_family = none)]
68        pub fn commitEditing(&self) -> bool;
69
70        /// # Safety
71        ///
72        /// - `delegate` should be of the correct type.
73        /// - `did_commit_selector` must be a valid selector.
74        /// - `context_info` must be a valid pointer or null.
75        #[unsafe(method(commitEditingWithDelegate:didCommitSelector:contextInfo:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn commitEditingWithDelegate_didCommitSelector_contextInfo(
78            &self,
79            delegate: Option<&AnyObject>,
80            did_commit_selector: Option<Sel>,
81            context_info: *mut c_void,
82        );
83
84        #[unsafe(method(isEditing))]
85        #[unsafe(method_family = none)]
86        pub fn isEditing(&self) -> bool;
87    );
88}
89
90/// Methods declared on superclass `NSObject`.
91impl NSController {
92    extern_methods!(
93        #[unsafe(method(new))]
94        #[unsafe(method_family = new)]
95        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
96    );
97}