objc2_automator/generated/
AMWorkflow.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/automator/amworkflow?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct AMWorkflow;
15);
16
17extern_conformance!(
18    unsafe impl NSCopying for AMWorkflow {}
19);
20
21unsafe impl CopyingHelper for AMWorkflow {
22    type Result = Self;
23}
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for AMWorkflow {}
27);
28
29impl AMWorkflow {
30    extern_methods!(
31        /// # Safety
32        ///
33        /// `input` should be of the correct type.
34        #[unsafe(method(runWorkflowAtURL:withInput:error:_))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn runWorkflowAtURL_withInput_error(
37            file_url: &NSURL,
38            input: Option<&AnyObject>,
39        ) -> Result<Retained<AnyObject>, Retained<NSError>>;
40
41        #[unsafe(method(init))]
42        #[unsafe(method_family = init)]
43        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
44
45        #[unsafe(method(initWithContentsOfURL:error:_))]
46        #[unsafe(method_family = init)]
47        pub unsafe fn initWithContentsOfURL_error(
48            this: Allocated<Self>,
49            file_url: &NSURL,
50        ) -> Result<Retained<Self>, Retained<NSError>>;
51
52        #[unsafe(method(writeToURL:error:_))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn writeToURL_error(&self, file_url: &NSURL) -> Result<(), Retained<NSError>>;
55
56        /// # Safety
57        ///
58        /// `value` should be of the correct type.
59        #[unsafe(method(setValue:forVariableWithName:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setValue_forVariableWithName(
62            &self,
63            value: Option<&AnyObject>,
64            variable_name: &NSString,
65        ) -> bool;
66
67        #[unsafe(method(valueForVariableWithName:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn valueForVariableWithName(
70            &self,
71            variable_name: &NSString,
72        ) -> Option<Retained<AnyObject>>;
73
74        #[cfg(feature = "AMAction")]
75        #[unsafe(method(addAction:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn addAction(&self, action: &AMAction);
78
79        #[cfg(feature = "AMAction")]
80        #[unsafe(method(removeAction:))]
81        #[unsafe(method_family = none)]
82        pub unsafe fn removeAction(&self, action: &AMAction);
83
84        #[cfg(feature = "AMAction")]
85        #[unsafe(method(insertAction:atIndex:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn insertAction_atIndex(&self, action: &AMAction, index: NSUInteger);
88
89        #[unsafe(method(moveActionAtIndex:toIndex:))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn moveActionAtIndex_toIndex(
92            &self,
93            start_index: NSUInteger,
94            end_index: NSUInteger,
95        );
96
97        #[unsafe(method(fileURL))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn fileURL(&self) -> Option<Retained<NSURL>>;
100
101        #[cfg(feature = "AMAction")]
102        #[unsafe(method(actions))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn actions(&self) -> Retained<NSArray<AMAction>>;
105
106        #[unsafe(method(input))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn input(&self) -> Option<Retained<AnyObject>>;
109
110        /// Setter for [`input`][Self::input].
111        ///
112        /// # Safety
113        ///
114        /// `input` should be of the correct type.
115        #[unsafe(method(setInput:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn setInput(&self, input: Option<&AnyObject>);
118
119        #[unsafe(method(output))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn output(&self) -> Option<Retained<AnyObject>>;
122    );
123}
124
125/// Methods declared on superclass `NSObject`.
126impl AMWorkflow {
127    extern_methods!(
128        #[unsafe(method(new))]
129        #[unsafe(method_family = new)]
130        pub unsafe fn new() -> Retained<Self>;
131    );
132}