//! 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/nslistformatter?language=objc)
    #[unsafe(super(NSFormatter, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSFormatter")]
    pub struct NSListFormatter;
);

#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
unsafe impl NSCoding for NSListFormatter {}

#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
unsafe impl NSCopying for NSListFormatter {}

#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
unsafe impl CopyingHelper for NSListFormatter {
    type Result = Self;
}

#[cfg(feature = "NSFormatter")]
unsafe impl NSObjectProtocol for NSListFormatter {}

#[cfg(feature = "NSFormatter")]
impl NSListFormatter {
    extern_methods!(
        #[cfg(feature = "NSLocale")]
        #[unsafe(method(locale))]
        #[unsafe(method_family = none)]
        pub unsafe fn locale(&self) -> Retained<NSLocale>;

        #[cfg(feature = "NSLocale")]
        /// Setter for [`locale`][Self::locale].
        #[unsafe(method(setLocale:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setLocale(&self, locale: Option<&NSLocale>);

        #[unsafe(method(itemFormatter))]
        #[unsafe(method_family = none)]
        pub unsafe fn itemFormatter(&self) -> Option<Retained<NSFormatter>>;

        /// Setter for [`itemFormatter`][Self::itemFormatter].
        #[unsafe(method(setItemFormatter:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setItemFormatter(&self, item_formatter: Option<&NSFormatter>);

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

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

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

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "NSFormatter")]
impl NSListFormatter {
    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>;
    );
}
