objc2_foundation/generated/
NSListFormatter.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nslistformatter?language=objc)
11    #[unsafe(super(NSFormatter, NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    #[cfg(feature = "NSFormatter")]
14    pub struct NSListFormatter;
15);
16
17#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
18extern_conformance!(
19    unsafe impl NSCoding for NSListFormatter {}
20);
21
22#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
23extern_conformance!(
24    unsafe impl NSCopying for NSListFormatter {}
25);
26
27#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
28unsafe impl CopyingHelper for NSListFormatter {
29    type Result = Self;
30}
31
32#[cfg(feature = "NSFormatter")]
33extern_conformance!(
34    unsafe impl NSObjectProtocol for NSListFormatter {}
35);
36
37#[cfg(feature = "NSFormatter")]
38impl NSListFormatter {
39    extern_methods!(
40        #[cfg(feature = "NSLocale")]
41        #[unsafe(method(locale))]
42        #[unsafe(method_family = none)]
43        pub fn locale(&self) -> Retained<NSLocale>;
44
45        #[cfg(feature = "NSLocale")]
46        /// Setter for [`locale`][Self::locale].
47        ///
48        /// This is [copied][crate::NSCopying::copy] when set.
49        #[unsafe(method(setLocale:))]
50        #[unsafe(method_family = none)]
51        pub fn setLocale(&self, locale: Option<&NSLocale>);
52
53        #[unsafe(method(itemFormatter))]
54        #[unsafe(method_family = none)]
55        pub fn itemFormatter(&self) -> Option<Retained<NSFormatter>>;
56
57        /// Setter for [`itemFormatter`][Self::itemFormatter].
58        ///
59        /// This is [copied][crate::NSCopying::copy] when set.
60        #[unsafe(method(setItemFormatter:))]
61        #[unsafe(method_family = none)]
62        pub fn setItemFormatter(&self, item_formatter: Option<&NSFormatter>);
63
64        #[cfg(all(feature = "NSArray", feature = "NSString"))]
65        #[unsafe(method(localizedStringByJoiningStrings:))]
66        #[unsafe(method_family = none)]
67        pub fn localizedStringByJoiningStrings(strings: &NSArray<NSString>) -> Retained<NSString>;
68
69        #[cfg(all(feature = "NSArray", feature = "NSString"))]
70        /// # Safety
71        ///
72        /// `items` generic should be of the correct type.
73        #[unsafe(method(stringFromItems:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn stringFromItems(&self, items: &NSArray) -> Option<Retained<NSString>>;
76
77        #[cfg(feature = "NSString")]
78        /// # Safety
79        ///
80        /// `obj` should be of the correct type.
81        #[unsafe(method(stringForObjectValue:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn stringForObjectValue(
84            &self,
85            obj: Option<&AnyObject>,
86        ) -> Option<Retained<NSString>>;
87    );
88}
89
90/// Methods declared on superclass `NSObject`.
91#[cfg(feature = "NSFormatter")]
92impl NSListFormatter {
93    extern_methods!(
94        #[unsafe(method(init))]
95        #[unsafe(method_family = init)]
96        pub fn init(this: Allocated<Self>) -> Retained<Self>;
97
98        #[unsafe(method(new))]
99        #[unsafe(method_family = new)]
100        pub fn new() -> Retained<Self>;
101    );
102}
103
104#[cfg(feature = "NSFormatter")]
105impl DefaultRetained for NSListFormatter {
106    #[inline]
107    fn default_retained() -> Retained<Self> {
108        Self::new()
109    }
110}