objc2-foundation 0.3.2

Bindings to the Foundation framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsscriptcommanddescription?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSScriptCommandDescription;
);

#[cfg(feature = "NSObject")]
extern_conformance!(
    unsafe impl NSCoding for NSScriptCommandDescription {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for NSScriptCommandDescription {}
);

impl NSScriptCommandDescription {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
        /// # Safety
        ///
        /// `command_declaration` generic should be of the correct type.
        #[unsafe(method(initWithSuiteName:commandName:dictionary:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithSuiteName_commandName_dictionary(
            this: Allocated<Self>,
            suite_name: &NSString,
            command_name: &NSString,
            command_declaration: Option<&NSDictionary>,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "NSCoder")]
        /// # Safety
        ///
        /// `in_coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            in_coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(suiteName))]
        #[unsafe(method_family = none)]
        pub fn suiteName(&self) -> Retained<NSString>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(commandName))]
        #[unsafe(method_family = none)]
        pub fn commandName(&self) -> Retained<NSString>;

        #[unsafe(method(appleEventClassCode))]
        #[unsafe(method_family = none)]
        pub fn appleEventClassCode(&self) -> FourCharCode;

        #[unsafe(method(appleEventCode))]
        #[unsafe(method_family = none)]
        pub fn appleEventCode(&self) -> FourCharCode;

        #[cfg(feature = "NSString")]
        #[unsafe(method(commandClassName))]
        #[unsafe(method_family = none)]
        pub fn commandClassName(&self) -> Retained<NSString>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(returnType))]
        #[unsafe(method_family = none)]
        pub fn returnType(&self) -> Option<Retained<NSString>>;

        #[unsafe(method(appleEventCodeForReturnType))]
        #[unsafe(method_family = none)]
        pub fn appleEventCodeForReturnType(&self) -> FourCharCode;

        #[cfg(all(feature = "NSArray", feature = "NSString"))]
        #[unsafe(method(argumentNames))]
        #[unsafe(method_family = none)]
        pub fn argumentNames(&self) -> Retained<NSArray<NSString>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(typeForArgumentWithName:))]
        #[unsafe(method_family = none)]
        pub fn typeForArgumentWithName(
            &self,
            argument_name: &NSString,
        ) -> Option<Retained<NSString>>;

        #[cfg(feature = "NSString")]
        #[unsafe(method(appleEventCodeForArgumentWithName:))]
        #[unsafe(method_family = none)]
        pub fn appleEventCodeForArgumentWithName(&self, argument_name: &NSString) -> FourCharCode;

        #[cfg(feature = "NSString")]
        #[unsafe(method(isOptionalArgumentWithName:))]
        #[unsafe(method_family = none)]
        pub fn isOptionalArgumentWithName(&self, argument_name: &NSString) -> bool;

        #[cfg(feature = "NSScriptCommand")]
        #[unsafe(method(createCommandInstance))]
        #[unsafe(method_family = none)]
        pub fn createCommandInstance(&self) -> Retained<NSScriptCommand>;

        #[cfg(all(feature = "NSScriptCommand", feature = "NSZone"))]
        /// # Safety
        ///
        /// `zone` must be a valid pointer or null.
        #[unsafe(method(createCommandInstanceWithZone:))]
        #[unsafe(method_family = none)]
        pub unsafe fn createCommandInstanceWithZone(
            &self,
            zone: *mut NSZone,
        ) -> Retained<NSScriptCommand>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSScriptCommandDescription {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}