objc2_foundation/generated/
NSTermOfAddress.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8extern_class!(
9    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nstermofaddress?language=objc)
10    #[unsafe(super(NSObject))]
11    #[derive(Debug, PartialEq, Eq, Hash)]
12    pub struct NSTermOfAddress;
13);
14
15#[cfg(feature = "NSObject")]
16unsafe impl NSCoding for NSTermOfAddress {}
17
18#[cfg(feature = "NSObject")]
19unsafe impl NSCopying for NSTermOfAddress {}
20
21#[cfg(feature = "NSObject")]
22unsafe impl CopyingHelper for NSTermOfAddress {
23    type Result = Self;
24}
25
26unsafe impl NSObjectProtocol for NSTermOfAddress {}
27
28#[cfg(feature = "NSObject")]
29unsafe impl NSSecureCoding for NSTermOfAddress {}
30
31impl NSTermOfAddress {
32    extern_methods!(
33        /// Term of address that uses gender-neutral pronouns (e.g. they/them/theirs in
34        /// English), and an epicene grammatical gender when inflecting verbs and
35        /// adjectives referring to the person
36        #[unsafe(method(neutral))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn neutral() -> Retained<Self>;
39
40        /// Term of address that uses feminine pronouns (e.g. she/her/hers in English),
41        /// and a feminine grammatical gender when inflecting verbs and adjectives
42        /// referring to the person
43        #[unsafe(method(feminine))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn feminine() -> Retained<Self>;
46
47        /// Term of address that uses masculine pronouns (e.g. he/him/his in English),
48        /// and a masculine grammatical gender when inflecting verbs and adjectives
49        /// referring to the person
50        #[unsafe(method(masculine))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn masculine() -> Retained<Self>;
53
54        /// The term of address that should be used for addressing the user
55        ///
56        /// This term of address will only compare equal to another `+[NSTermOfAddress currentUser]`
57        #[unsafe(method(currentUser))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn currentUser() -> Retained<Self>;
60
61        #[cfg(all(feature = "NSArray", feature = "NSMorphology", feature = "NSString"))]
62        /// A term of address restricted to a given language
63        ///
64        /// Parameter `language`: ISO language code identifier for the language
65        ///
66        /// Parameter `pronouns`: A list of pronouns in the target language that can be used to
67        /// refer to the person.
68        #[unsafe(method(localizedForLanguageIdentifier:withPronouns:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn localizedForLanguageIdentifier_withPronouns(
71            language: &NSString,
72            pronouns: &NSArray<NSMorphologyPronoun>,
73        ) -> Retained<Self>;
74
75        #[unsafe(method(new))]
76        #[unsafe(method_family = new)]
77        pub unsafe fn new() -> Retained<Self>;
78
79        #[unsafe(method(init))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
82
83        #[cfg(feature = "NSString")]
84        /// The ISO language code if this is a localized term of address
85        #[unsafe(method(languageIdentifier))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn languageIdentifier(&self) -> Option<Retained<NSString>>;
88
89        #[cfg(all(feature = "NSArray", feature = "NSMorphology"))]
90        /// A list of pronouns for a localized term of address
91        #[unsafe(method(pronouns))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn pronouns(&self) -> Option<Retained<NSArray<NSMorphologyPronoun>>>;
94    );
95}