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        /// This is a [weak property][objc2::topics::weak_property].
73        /// Setter for [`delegate`][Self::delegate].
74        #[unsafe(method(setDelegate:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setDelegate(
77            &self,
78            delegate: Option<&ProtocolObject<dyn AMWorkflowControllerDelegate>>,
79        );
80
81        #[unsafe(method(canRun))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn canRun(&self) -> bool;
84
85        #[unsafe(method(isRunning))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn isRunning(&self) -> bool;
88
89        #[unsafe(method(isPaused))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn isPaused(&self) -> bool;
92
93        #[unsafe(method(run:))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn run(&self, sender: &AnyObject);
96
97        #[unsafe(method(stop:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn stop(&self, sender: &AnyObject);
100
101        #[unsafe(method(pause:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn pause(&self, sender: &AnyObject);
104
105        #[unsafe(method(step:))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn step(&self, sender: &AnyObject);
108
109        #[unsafe(method(reset:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn reset(&self, sender: &AnyObject);
112    );
113}
114
115/// Methods declared on superclass `NSController`.
116#[cfg(feature = "objc2-app-kit")]
117impl AMWorkflowController {
118    extern_methods!(
119        #[unsafe(method(init))]
120        #[unsafe(method_family = init)]
121        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
122
123        #[unsafe(method(initWithCoder:))]
124        #[unsafe(method_family = init)]
125        pub unsafe fn initWithCoder(
126            this: Allocated<Self>,
127            coder: &NSCoder,
128        ) -> Option<Retained<Self>>;
129    );
130}
131
132/// Methods declared on superclass `NSObject`.
133#[cfg(feature = "objc2-app-kit")]
134impl AMWorkflowController {
135    extern_methods!(
136        #[unsafe(method(new))]
137        #[unsafe(method_family = new)]
138        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
139    );
140}
141
142extern_protocol!(
143    /// [Apple's documentation](https://developer.apple.com/documentation/automator/amworkflowcontrollerdelegate?language=objc)
144    pub unsafe trait AMWorkflowControllerDelegate: NSObjectProtocol {
145        #[cfg(feature = "objc2-app-kit")]
146        #[optional]
147        #[unsafe(method(workflowControllerWillRun:))]
148        #[unsafe(method_family = none)]
149        unsafe fn workflowControllerWillRun(&self, controller: &AMWorkflowController);
150
151        #[cfg(feature = "objc2-app-kit")]
152        #[optional]
153        #[unsafe(method(workflowControllerWillStop:))]
154        #[unsafe(method_family = none)]
155        unsafe fn workflowControllerWillStop(&self, controller: &AMWorkflowController);
156
157        #[cfg(feature = "objc2-app-kit")]
158        #[optional]
159        #[unsafe(method(workflowControllerDidRun:))]
160        #[unsafe(method_family = none)]
161        unsafe fn workflowControllerDidRun(&self, controller: &AMWorkflowController);
162
163        #[cfg(feature = "objc2-app-kit")]
164        #[optional]
165        #[unsafe(method(workflowControllerDidStop:))]
166        #[unsafe(method_family = none)]
167        unsafe fn workflowControllerDidStop(&self, controller: &AMWorkflowController);
168
169        #[cfg(all(feature = "AMAction", feature = "objc2-app-kit"))]
170        #[optional]
171        #[unsafe(method(workflowController:willRunAction:))]
172        #[unsafe(method_family = none)]
173        unsafe fn workflowController_willRunAction(
174            &self,
175            controller: &AMWorkflowController,
176            action: &AMAction,
177        );
178
179        #[cfg(all(feature = "AMAction", feature = "objc2-app-kit"))]
180        #[optional]
181        #[unsafe(method(workflowController:didRunAction:))]
182        #[unsafe(method_family = none)]
183        unsafe fn workflowController_didRunAction(
184            &self,
185            controller: &AMWorkflowController,
186            action: &AMAction,
187        );
188
189        #[cfg(feature = "objc2-app-kit")]
190        #[optional]
191        #[unsafe(method(workflowController:didError:))]
192        #[unsafe(method_family = none)]
193        unsafe fn workflowController_didError(
194            &self,
195            controller: &AMWorkflowController,
196            error: &NSError,
197        );
198    }
199);