//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::rc::{Allocated, Retained};
use objc2::runtime::ProtocolObject;
use objc2::{extern_class, extern_conformance, extern_methods};
use objc2_foundation::{CopyingHelper, NSCopying, NSObject, NSObjectProtocol, NSString};

use crate::*;

extern_class!(
    /// Describes a shader function from a Metal library.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4libraryfunctiondescriptor?language=objc)
    #[unsafe(super(MTL4FunctionDescriptor, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTL4LibraryFunctionDescriptor;
);

extern_conformance!(
    unsafe impl NSCopying for MTL4LibraryFunctionDescriptor {}
);

unsafe impl CopyingHelper for MTL4LibraryFunctionDescriptor {
    type Result = Self;
}

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

impl MTL4LibraryFunctionDescriptor {
    extern_methods!(
        /// Assigns a name to the function.
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub fn name(&self) -> Option<Retained<NSString>>;

        /// Setter for [`name`][Self::name].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setName:))]
        #[unsafe(method_family = none)]
        pub fn set_name(&self, name: Option<&NSString>);

        /// Returns a reference to the library containing the function.
        #[unsafe(method(library))]
        #[unsafe(method_family = none)]
        pub fn library(&self) -> Option<Retained<ProtocolObject<dyn MTLLibrary>>>;

        /// Setter for [`library`][Self::library].
        #[unsafe(method(setLibrary:))]
        #[unsafe(method_family = none)]
        pub fn set_library(&self, library: Option<&ProtocolObject<dyn MTLLibrary>>);
    );
}

/// Methods declared on superclass `NSObject`.
impl MTL4LibraryFunctionDescriptor {
    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>;
    );
}
