objc2_automator/generated/
AMBundleAction.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/ambundleaction?language=objc)
14    #[unsafe(super(AMAction, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "AMAction")]
17    pub struct AMBundleAction;
18);
19
20#[cfg(feature = "AMAction")]
21unsafe impl NSCoding for AMBundleAction {}
22
23#[cfg(feature = "AMAction")]
24unsafe impl NSCopying for AMBundleAction {}
25
26#[cfg(feature = "AMAction")]
27unsafe impl CopyingHelper for AMBundleAction {
28    type Result = Self;
29}
30
31#[cfg(feature = "AMAction")]
32unsafe impl NSObjectProtocol for AMBundleAction {}
33
34#[cfg(feature = "AMAction")]
35unsafe impl NSSecureCoding for AMBundleAction {}
36
37#[cfg(feature = "AMAction")]
38impl AMBundleAction {
39    extern_methods!(
40        #[unsafe(method(awakeFromBundle))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn awakeFromBundle(&self);
43
44        #[unsafe(method(hasView))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn hasView(&self) -> bool;
47
48        #[cfg(feature = "objc2-app-kit")]
49        #[unsafe(method(view))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn view(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
52
53        #[unsafe(method(bundle))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn bundle(&self) -> Retained<NSBundle>;
56
57        #[unsafe(method(parameters))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn parameters(
60            &self,
61        ) -> Option<Retained<NSMutableDictionary<NSString, AnyObject>>>;
62
63        /// Setter for [`parameters`][Self::parameters].
64        #[unsafe(method(setParameters:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn setParameters(
67            &self,
68            parameters: Option<&NSMutableDictionary<NSString, AnyObject>>,
69        );
70    );
71}
72
73/// Methods declared on superclass `AMAction`.
74#[cfg(feature = "AMAction")]
75impl AMBundleAction {
76    extern_methods!(
77        #[unsafe(method(initWithDefinition:fromArchive:))]
78        #[unsafe(method_family = init)]
79        pub unsafe fn initWithDefinition_fromArchive(
80            this: Allocated<Self>,
81            dict: Option<&NSDictionary<NSString, AnyObject>>,
82            archived: bool,
83        ) -> Option<Retained<Self>>;
84
85        #[unsafe(method(initWithContentsOfURL:error:_))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn initWithContentsOfURL_error(
88            this: Allocated<Self>,
89            file_url: &NSURL,
90        ) -> Result<Retained<Self>, Retained<NSError>>;
91    );
92}
93
94/// Methods declared on superclass `NSObject`.
95#[cfg(feature = "AMAction")]
96impl AMBundleAction {
97    extern_methods!(
98        #[unsafe(method(init))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
101
102        #[unsafe(method(new))]
103        #[unsafe(method_family = new)]
104        pub unsafe fn new() -> Retained<Self>;
105    );
106}