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")]
21extern_conformance!(
22    unsafe impl NSCoding for AMBundleAction {}
23);
24
25#[cfg(feature = "AMAction")]
26extern_conformance!(
27    unsafe impl NSCopying for AMBundleAction {}
28);
29
30#[cfg(feature = "AMAction")]
31unsafe impl CopyingHelper for AMBundleAction {
32    type Result = Self;
33}
34
35#[cfg(feature = "AMAction")]
36extern_conformance!(
37    unsafe impl NSObjectProtocol for AMBundleAction {}
38);
39
40#[cfg(feature = "AMAction")]
41extern_conformance!(
42    unsafe impl NSSecureCoding for AMBundleAction {}
43);
44
45#[cfg(feature = "AMAction")]
46impl AMBundleAction {
47    extern_methods!(
48        #[unsafe(method(awakeFromBundle))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn awakeFromBundle(&self);
51
52        #[unsafe(method(hasView))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn hasView(&self) -> bool;
55
56        #[cfg(feature = "objc2-app-kit")]
57        #[unsafe(method(view))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn view(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
60
61        #[unsafe(method(bundle))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn bundle(&self) -> Retained<NSBundle>;
64
65        /// # Safety
66        ///
67        /// The returned generic should be of the correct type.
68        #[unsafe(method(parameters))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn parameters(
71            &self,
72        ) -> Option<Retained<NSMutableDictionary<NSString, AnyObject>>>;
73
74        /// Setter for [`parameters`][Self::parameters].
75        ///
76        /// # Safety
77        ///
78        /// `parameters` generic should be of the correct type.
79        #[unsafe(method(setParameters:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn setParameters(
82            &self,
83            parameters: Option<&NSMutableDictionary<NSString, AnyObject>>,
84        );
85    );
86}
87
88/// Methods declared on superclass `AMAction`.
89#[cfg(feature = "AMAction")]
90impl AMBundleAction {
91    extern_methods!(
92        /// # Safety
93        ///
94        /// `dict` generic should be of the correct type.
95        #[unsafe(method(initWithDefinition:fromArchive:))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn initWithDefinition_fromArchive(
98            this: Allocated<Self>,
99            dict: Option<&NSDictionary<NSString, AnyObject>>,
100            archived: bool,
101        ) -> Option<Retained<Self>>;
102
103        #[unsafe(method(initWithContentsOfURL:error:_))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn initWithContentsOfURL_error(
106            this: Allocated<Self>,
107            file_url: &NSURL,
108        ) -> Result<Retained<Self>, Retained<NSError>>;
109    );
110}
111
112/// Methods declared on superclass `NSObject`.
113#[cfg(feature = "AMAction")]
114impl AMBundleAction {
115    extern_methods!(
116        #[unsafe(method(init))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
119
120        #[unsafe(method(new))]
121        #[unsafe(method_family = new)]
122        pub unsafe fn new() -> Retained<Self>;
123    );
124}