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