objc2_automator/generated/
AMAppleScriptAction.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#[cfg(feature = "objc2-osa-kit")]
8use objc2_osa_kit::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/automator/amapplescriptaction?language=objc)
14    #[unsafe(super(AMBundleAction, AMAction, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
17    pub struct AMAppleScriptAction;
18);
19
20#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
21extern_conformance!(
22    unsafe impl NSCoding for AMAppleScriptAction {}
23);
24
25#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
26extern_conformance!(
27    unsafe impl NSCopying for AMAppleScriptAction {}
28);
29
30#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
31unsafe impl CopyingHelper for AMAppleScriptAction {
32    type Result = Self;
33}
34
35#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for AMAppleScriptAction {}
38);
39
40#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
41extern_conformance!(
42    unsafe impl NSSecureCoding for AMAppleScriptAction {}
43);
44
45#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
46impl AMAppleScriptAction {
47    extern_methods!(
48        #[cfg(feature = "objc2-osa-kit")]
49        #[unsafe(method(script))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn script(&self) -> Option<Retained<OSAScript>>;
52
53        #[cfg(feature = "objc2-osa-kit")]
54        /// Setter for [`script`][Self::script].
55        #[unsafe(method(setScript:))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn setScript(&self, script: Option<&OSAScript>);
58    );
59}
60
61/// Methods declared on superclass `AMAction`.
62#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
63impl AMAppleScriptAction {
64    extern_methods!(
65        #[unsafe(method(initWithDefinition:fromArchive:))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn initWithDefinition_fromArchive(
68            this: Allocated<Self>,
69            dict: Option<&NSDictionary<NSString, AnyObject>>,
70            archived: bool,
71        ) -> Option<Retained<Self>>;
72
73        #[unsafe(method(initWithContentsOfURL:error:_))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn initWithContentsOfURL_error(
76            this: Allocated<Self>,
77            file_url: &NSURL,
78        ) -> Result<Retained<Self>, Retained<NSError>>;
79    );
80}
81
82/// Methods declared on superclass `NSObject`.
83#[cfg(all(feature = "AMAction", feature = "AMBundleAction"))]
84impl AMAppleScriptAction {
85    extern_methods!(
86        #[unsafe(method(init))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
89
90        #[unsafe(method(new))]
91        #[unsafe(method_family = new)]
92        pub unsafe fn new() -> Retained<Self>;
93    );
94}