//! 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 objc2_foundation::*;

use crate::*;

extern_class!(
    /// The CIPlugIn class is responsible for loading Image Units.
    ///
    /// The implementation of the CIPlugIn objects is private.
    /// An application can, however, call the 2 public class method to load plug-ins.
    ///
    /// Loading executable CIFilter plugins is deprecated starting in macOS 10.15.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreimage/ciplugin?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIPlugIn;
);

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

impl CIPlugIn {
    extern_methods!(
        /// This call will scan for plugins with the extension .plugin in
        /// /Library/Graphics/Image Units
        /// ~Library/Graphics/Image Units
        /// If called more than once, newly added plug-ins will be loaded but you cannot remove a plug-in and its filters.
        #[deprecated]
        #[unsafe(method(loadAllPlugIns))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadAllPlugIns();

        /// Same as loadAllPlugIns does not load filters that contain executable code.
        #[unsafe(method(loadNonExecutablePlugIns))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadNonExecutablePlugIns();

        /// Loads a plug-in specified by its URL.
        ///
        /// # Safety
        ///
        /// `url` might not allow `None`.
        #[deprecated]
        #[unsafe(method(loadPlugIn:allowNonExecutable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadPlugIn_allowNonExecutable(
            url: Option<&NSURL>,
            allow_non_executable: bool,
        );

        /// Loads a plug-in specified by its URL.
        /// If allowExecutableCode is NO, filters containing executable code will not be loaded. If YES, any kind of filter will be loaded.
        ///
        /// # Safety
        ///
        /// `url` might not allow `None`.
        #[deprecated]
        #[unsafe(method(loadPlugIn:allowExecutableCode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadPlugIn_allowExecutableCode(
            url: Option<&NSURL>,
            allow_executable_code: bool,
        );

        /// Loads a non-executable plug-in specified by its URL.
        /// If the filters containing executable code, it will not be loaded.
        ///
        /// # Safety
        ///
        /// `url` might not allow `None`.
        #[unsafe(method(loadNonExecutablePlugIn:))]
        #[unsafe(method_family = none)]
        pub unsafe fn loadNonExecutablePlugIn(url: Option<&NSURL>);
    );
}

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

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