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

use crate::*;

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

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

impl NSScriptSuiteRegistry {
    extern_methods!(
        #[unsafe(method(sharedScriptSuiteRegistry))]
        #[unsafe(method_family = none)]
        pub fn sharedScriptSuiteRegistry() -> Retained<NSScriptSuiteRegistry>;

        #[unsafe(method(setSharedScriptSuiteRegistry:))]
        #[unsafe(method_family = none)]
        pub fn setSharedScriptSuiteRegistry(registry: &NSScriptSuiteRegistry);

        #[cfg(feature = "NSBundle")]
        #[unsafe(method(loadSuitesFromBundle:))]
        #[unsafe(method_family = none)]
        pub fn loadSuitesFromBundle(&self, bundle: &NSBundle);

        #[cfg(all(feature = "NSBundle", feature = "NSDictionary"))]
        /// # Safety
        ///
        /// `suite_declaration` generic should be of the correct type.
        #[unsafe(method(loadSuiteWithDictionary:fromBundle:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadSuiteWithDictionary_fromBundle(
            &self,
            suite_declaration: &NSDictionary,
            bundle: &NSBundle,
        );

        #[cfg(all(feature = "NSClassDescription", feature = "NSScriptClassDescription"))]
        #[unsafe(method(registerClassDescription:))]
        #[unsafe(method_family = none)]
        pub fn registerClassDescription(&self, class_description: &NSScriptClassDescription);

        #[cfg(feature = "NSScriptCommandDescription")]
        #[unsafe(method(registerCommandDescription:))]
        #[unsafe(method_family = none)]
        pub fn registerCommandDescription(&self, command_description: &NSScriptCommandDescription);

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

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

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

        #[cfg(all(
            feature = "NSClassDescription",
            feature = "NSDictionary",
            feature = "NSScriptClassDescription",
            feature = "NSString"
        ))]
        #[unsafe(method(classDescriptionsInSuite:))]
        #[unsafe(method_family = none)]
        pub fn classDescriptionsInSuite(
            &self,
            suite_name: &NSString,
        ) -> Option<Retained<NSDictionary<NSString, NSScriptClassDescription>>>;

        #[cfg(all(
            feature = "NSDictionary",
            feature = "NSScriptCommandDescription",
            feature = "NSString"
        ))]
        #[unsafe(method(commandDescriptionsInSuite:))]
        #[unsafe(method_family = none)]
        pub fn commandDescriptionsInSuite(
            &self,
            suite_name: &NSString,
        ) -> Option<Retained<NSDictionary<NSString, NSScriptCommandDescription>>>;

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

        #[cfg(all(feature = "NSClassDescription", feature = "NSScriptClassDescription"))]
        #[unsafe(method(classDescriptionWithAppleEventCode:))]
        #[unsafe(method_family = none)]
        pub fn classDescriptionWithAppleEventCode(
            &self,
            apple_event_code: FourCharCode,
        ) -> Option<Retained<NSScriptClassDescription>>;

        #[cfg(feature = "NSScriptCommandDescription")]
        #[unsafe(method(commandDescriptionWithAppleEventClass:andAppleEventCode:))]
        #[unsafe(method_family = none)]
        pub fn commandDescriptionWithAppleEventClass_andAppleEventCode(
            &self,
            apple_event_class_code: FourCharCode,
            apple_event_id_code: FourCharCode,
        ) -> Option<Retained<NSScriptCommandDescription>>;

        #[cfg(all(feature = "NSData", feature = "NSString"))]
        #[unsafe(method(aeteResource:))]
        #[unsafe(method_family = none)]
        pub fn aeteResource(&self, language_name: &NSString) -> Option<Retained<NSData>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSScriptSuiteRegistry {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSScriptSuiteRegistry {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}
