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

use crate::*;

extern_class!(
    /// Groups together properties to configure and create a specialized function by passing it to a factory method.
    ///
    /// You can pass an instance of this class to any methods that accept a ``MTL4FunctionDescriptor`` parameter to
    /// provide extra configuration, such as function constants or a name.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4specializedfunctiondescriptor?language=objc)
    #[unsafe(super(MTL4FunctionDescriptor, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct MTL4SpecializedFunctionDescriptor;
);

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

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

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

impl MTL4SpecializedFunctionDescriptor {
    extern_methods!(
        /// Provides a descriptor that corresponds to a base function that the specialization applies to.
        #[unsafe(method(functionDescriptor))]
        #[unsafe(method_family = none)]
        pub fn function_descriptor(&self) -> Option<Retained<MTL4FunctionDescriptor>>;

        /// Setter for [`functionDescriptor`][Self::functionDescriptor].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setFunctionDescriptor:))]
        #[unsafe(method_family = none)]
        pub fn set_function_descriptor(
            &self,
            function_descriptor: Option<&MTL4FunctionDescriptor>,
        );

        /// Assigns an optional name to the specialized function.
        #[unsafe(method(specializedName))]
        #[unsafe(method_family = none)]
        pub fn specialized_name(&self) -> Option<Retained<NSString>>;

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

        /// Configures optional function constant values to associate with the function.
        #[unsafe(method(constantValues))]
        #[unsafe(method_family = none)]
        pub fn constant_values(&self) -> Option<Retained<MTLFunctionConstantValues>>;

        /// Setter for [`constantValues`][Self::constantValues].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setConstantValues:))]
        #[unsafe(method_family = none)]
        pub fn set_constant_values(&self, constant_values: Option<&MTLFunctionConstantValues>);
    );
}

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