objc2_automator/generated/
AMWorkflowController.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::*;
6#[cfg(feature = "objc2-app-kit")]
7use objc2_app_kit::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/automator/amworkflowcontroller?language=objc)
14    #[unsafe(super(NSController, NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "objc2-app-kit")]
18    pub struct AMWorkflowController;
19);
20
21#[cfg(feature = "objc2-app-kit")]
22extern_conformance!(
23    unsafe impl NSCoding for AMWorkflowController {}
24);
25
26#[cfg(feature = "objc2-app-kit")]
27extern_conformance!(
28    unsafe impl NSEditor for AMWorkflowController {}
29);
30
31#[cfg(feature = "objc2-app-kit")]
32extern_conformance!(
33    unsafe impl NSEditorRegistration for AMWorkflowController {}
34);
35
36#[cfg(feature = "objc2-app-kit")]
37extern_conformance!(
38    unsafe impl NSObjectProtocol for AMWorkflowController {}
39);
40
41#[cfg(feature = "objc2-app-kit")]
42impl AMWorkflowController {
43    extern_methods!(
44        #[cfg(feature = "AMWorkflow")]
45        #[unsafe(method(workflow))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn workflow(&self) -> Option<Retained<AMWorkflow>>;
48
49        #[cfg(feature = "AMWorkflow")]
50        /// Setter for [`workflow`][Self::workflow].
51        #[unsafe(method(setWorkflow:))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn setWorkflow(&self, workflow: Option<&AMWorkflow>);
54
55        #[cfg(feature = "AMWorkflowView")]
56        #[unsafe(method(workflowView))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn workflowView(&self) -> Option<Retained<AMWorkflowView>>;
59
60        #[cfg(feature = "AMWorkflowView")]
61        /// Setter for [`workflowView`][Self::workflowView].
62        #[unsafe(method(setWorkflowView:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setWorkflowView(&self, workflow_view: Option<&AMWorkflowView>);
65
66        #[unsafe(method(delegate))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn delegate(
69            &self,
70        ) -> Option<Retained<ProtocolObject<dyn AMWorkflowControllerDelegate>>>;
71
72        /// Setter for [`delegate`][Self::delegate].
73        ///
74        /// This is a [weak property][objc2::topics::weak_property].
75        #[unsafe(method(setDelegate:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn setDelegate(
78            &self,
79            delegate: Option<&ProtocolObject<dyn AMWorkflowControllerDelegate>>,
80        );
81
82        #[unsafe(method(canRun))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn canRun(&self) -> bool;
85
86        #[unsafe(method(isRunning))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn isRunning(&self) -> bool;
89
90        #[unsafe(method(isPaused))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn isPaused(&self) -> bool;
93
94        /// # Safety
95        ///
96        /// `sender` should be of the correct type.
97        #[unsafe(method(run:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn run(&self, sender: &AnyObject);
100
101        /// # Safety
102        ///
103        /// `sender` should be of the correct type.
104        #[unsafe(method(stop:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn stop(&self, sender: &AnyObject);
107
108        /// # Safety
109        ///
110        /// `sender` should be of the correct type.
111        #[unsafe(method(pause:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn pause(&self, sender: &AnyObject);
114
115        /// # Safety
116        ///
117        /// `sender` should be of the correct type.
118        #[unsafe(method(step:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn step(&self, sender: &AnyObject);
121
122        /// # Safety
123        ///
124        /// `sender` should be of the correct type.
125        #[unsafe(method(reset:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn reset(&self, sender: &AnyObject);
128    );
129}
130
131/// Methods declared on superclass `NSController`.
132#[cfg(feature = "objc2-app-kit")]
133impl AMWorkflowController {
134    extern_methods!(
135        #[unsafe(method(init))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138
139        /// # Safety
140        ///
141        /// `coder` possibly has further requirements.
142        #[unsafe(method(initWithCoder:))]
143        #[unsafe(method_family = init)]
144        pub unsafe fn initWithCoder(
145            this: Allocated<Self>,
146            coder: &NSCoder,
147        ) -> Option<Retained<Self>>;
148    );
149}
150
151/// Methods declared on superclass `NSObject`.
152#[cfg(feature = "objc2-app-kit")]
153impl AMWorkflowController {
154    extern_methods!(
155        #[unsafe(method(new))]
156        #[unsafe(method_family = new)]
157        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
158    );
159}
160
161extern_protocol!(
162    /// [Apple's documentation](https://developer.apple.com/documentation/automator/amworkflowcontrollerdelegate?language=objc)
163    pub unsafe trait AMWorkflowControllerDelegate: NSObjectProtocol {
164        #[cfg(feature = "objc2-app-kit")]
165        #[optional]
166        #[unsafe(method(workflowControllerWillRun:))]
167        #[unsafe(method_family = none)]
168        unsafe fn workflowControllerWillRun(&self, controller: &AMWorkflowController);
169
170        #[cfg(feature = "objc2-app-kit")]
171        #[optional]
172        #[unsafe(method(workflowControllerWillStop:))]
173        #[unsafe(method_family = none)]
174        unsafe fn workflowControllerWillStop(&self, controller: &AMWorkflowController);
175
176        #[cfg(feature = "objc2-app-kit")]
177        #[optional]
178        #[unsafe(method(workflowControllerDidRun:))]
179        #[unsafe(method_family = none)]
180        unsafe fn workflowControllerDidRun(&self, controller: &AMWorkflowController);
181
182        #[cfg(feature = "objc2-app-kit")]
183        #[optional]
184        #[unsafe(method(workflowControllerDidStop:))]
185        #[unsafe(method_family = none)]
186        unsafe fn workflowControllerDidStop(&self, controller: &AMWorkflowController);
187
188        #[cfg(all(feature = "AMAction", feature = "objc2-app-kit"))]
189        #[optional]
190        #[unsafe(method(workflowController:willRunAction:))]
191        #[unsafe(method_family = none)]
192        unsafe fn workflowController_willRunAction(
193            &self,
194            controller: &AMWorkflowController,
195            action: &AMAction,
196        );
197
198        #[cfg(all(feature = "AMAction", feature = "objc2-app-kit"))]
199        #[optional]
200        #[unsafe(method(workflowController:didRunAction:))]
201        #[unsafe(method_family = none)]
202        unsafe fn workflowController_didRunAction(
203            &self,
204            controller: &AMWorkflowController,
205            action: &AMAction,
206        );
207
208        #[cfg(feature = "objc2-app-kit")]
209        #[optional]
210        #[unsafe(method(workflowController:didError:))]
211        #[unsafe(method_family = none)]
212        unsafe fn workflowController_didError(
213            &self,
214            controller: &AMWorkflowController,
215            error: &NSError,
216        );
217    }
218);