icrate 0.1.2

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::AppKit::*;
use crate::Automator::*;
use crate::Foundation::*;
use crate::OSAKit::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Automator_AMBundleAction")]
    pub struct AMBundleAction;

    #[cfg(feature = "Automator_AMBundleAction")]
    unsafe impl ClassType for AMBundleAction {
        #[inherits(NSObject)]
        type Super = AMAction;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Automator_AMBundleAction")]
unsafe impl NSCoding for AMBundleAction {}

#[cfg(feature = "Automator_AMBundleAction")]
unsafe impl NSCopying for AMBundleAction {}

#[cfg(feature = "Automator_AMBundleAction")]
unsafe impl NSObjectProtocol for AMBundleAction {}

#[cfg(feature = "Automator_AMBundleAction")]
unsafe impl NSSecureCoding for AMBundleAction {}

extern_methods!(
    #[cfg(feature = "Automator_AMBundleAction")]
    unsafe impl AMBundleAction {
        #[method(awakeFromBundle)]
        pub unsafe fn awakeFromBundle(&self);

        #[method(hasView)]
        pub unsafe fn hasView(&self) -> bool;

        #[cfg(feature = "AppKit_NSView")]
        #[method_id(@__retain_semantics Other view)]
        pub unsafe fn view(&self, mtm: MainThreadMarker) -> Option<Id<NSView>>;

        #[cfg(feature = "Foundation_NSBundle")]
        #[method_id(@__retain_semantics Other bundle)]
        pub unsafe fn bundle(&self) -> Id<NSBundle>;

        #[cfg(all(
            feature = "Foundation_NSMutableDictionary",
            feature = "Foundation_NSString"
        ))]
        #[method_id(@__retain_semantics Other parameters)]
        pub unsafe fn parameters(&self) -> Option<Id<NSMutableDictionary<NSString, AnyObject>>>;

        #[cfg(all(
            feature = "Foundation_NSMutableDictionary",
            feature = "Foundation_NSString"
        ))]
        #[method(setParameters:)]
        pub unsafe fn setParameters(
            &self,
            parameters: Option<&NSMutableDictionary<NSString, AnyObject>>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `AMAction`
    #[cfg(feature = "Automator_AMBundleAction")]
    unsafe impl AMBundleAction {
        #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Init initWithDefinition:fromArchive:)]
        pub unsafe fn initWithDefinition_fromArchive(
            this: Allocated<Self>,
            dict: Option<&NSDictionary<NSString, AnyObject>>,
            archived: bool,
        ) -> Option<Id<Self>>;

        #[cfg(all(feature = "Foundation_NSError", feature = "Foundation_NSURL"))]
        #[method_id(@__retain_semantics Init initWithContentsOfURL:error:_)]
        pub unsafe fn initWithContentsOfURL_error(
            this: Allocated<Self>,
            file_url: &NSURL,
        ) -> Result<Id<Self>, Id<NSError>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Automator_AMBundleAction")]
    unsafe impl AMBundleAction {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);