Source code

Revision control

Copy as Markdown

Other Tools

//! 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::*;
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalGender(pub NSInteger);
impl NSGrammaticalGender {
#[doc(alias = "NSGrammaticalGenderNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalGenderFeminine")]
pub const Feminine: Self = Self(1);
#[doc(alias = "NSGrammaticalGenderMasculine")]
pub const Masculine: Self = Self(2);
#[doc(alias = "NSGrammaticalGenderNeuter")]
pub const Neuter: Self = Self(3);
}
unsafe impl Encode for NSGrammaticalGender {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalGender {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalPartOfSpeech(pub NSInteger);
impl NSGrammaticalPartOfSpeech {
#[doc(alias = "NSGrammaticalPartOfSpeechNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalPartOfSpeechDeterminer")]
pub const Determiner: Self = Self(1);
#[doc(alias = "NSGrammaticalPartOfSpeechPronoun")]
pub const Pronoun: Self = Self(2);
#[doc(alias = "NSGrammaticalPartOfSpeechLetter")]
pub const Letter: Self = Self(3);
#[doc(alias = "NSGrammaticalPartOfSpeechAdverb")]
pub const Adverb: Self = Self(4);
#[doc(alias = "NSGrammaticalPartOfSpeechParticle")]
pub const Particle: Self = Self(5);
#[doc(alias = "NSGrammaticalPartOfSpeechAdjective")]
pub const Adjective: Self = Self(6);
#[doc(alias = "NSGrammaticalPartOfSpeechAdposition")]
pub const Adposition: Self = Self(7);
#[doc(alias = "NSGrammaticalPartOfSpeechVerb")]
pub const Verb: Self = Self(8);
#[doc(alias = "NSGrammaticalPartOfSpeechNoun")]
pub const Noun: Self = Self(9);
#[doc(alias = "NSGrammaticalPartOfSpeechConjunction")]
pub const Conjunction: Self = Self(10);
#[doc(alias = "NSGrammaticalPartOfSpeechNumeral")]
pub const Numeral: Self = Self(11);
#[doc(alias = "NSGrammaticalPartOfSpeechInterjection")]
pub const Interjection: Self = Self(12);
#[doc(alias = "NSGrammaticalPartOfSpeechPreposition")]
pub const Preposition: Self = Self(13);
#[doc(alias = "NSGrammaticalPartOfSpeechAbbreviation")]
pub const Abbreviation: Self = Self(14);
}
unsafe impl Encode for NSGrammaticalPartOfSpeech {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalPartOfSpeech {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalNumber(pub NSInteger);
impl NSGrammaticalNumber {
#[doc(alias = "NSGrammaticalNumberNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalNumberSingular")]
pub const Singular: Self = Self(1);
#[doc(alias = "NSGrammaticalNumberZero")]
pub const Zero: Self = Self(2);
#[doc(alias = "NSGrammaticalNumberPlural")]
pub const Plural: Self = Self(3);
#[doc(alias = "NSGrammaticalNumberPluralTwo")]
pub const PluralTwo: Self = Self(4);
#[doc(alias = "NSGrammaticalNumberPluralFew")]
pub const PluralFew: Self = Self(5);
#[doc(alias = "NSGrammaticalNumberPluralMany")]
pub const PluralMany: Self = Self(6);
}
unsafe impl Encode for NSGrammaticalNumber {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalNumber {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalCase(pub NSInteger);
impl NSGrammaticalCase {
#[doc(alias = "NSGrammaticalCaseNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalCaseNominative")]
pub const Nominative: Self = Self(1);
#[doc(alias = "NSGrammaticalCaseAccusative")]
pub const Accusative: Self = Self(2);
#[doc(alias = "NSGrammaticalCaseDative")]
pub const Dative: Self = Self(3);
#[doc(alias = "NSGrammaticalCaseGenitive")]
pub const Genitive: Self = Self(4);
#[doc(alias = "NSGrammaticalCasePrepositional")]
pub const Prepositional: Self = Self(5);
#[doc(alias = "NSGrammaticalCaseAblative")]
pub const Ablative: Self = Self(6);
#[doc(alias = "NSGrammaticalCaseAdessive")]
pub const Adessive: Self = Self(7);
#[doc(alias = "NSGrammaticalCaseAllative")]
pub const Allative: Self = Self(8);
#[doc(alias = "NSGrammaticalCaseElative")]
pub const Elative: Self = Self(9);
#[doc(alias = "NSGrammaticalCaseIllative")]
pub const Illative: Self = Self(10);
#[doc(alias = "NSGrammaticalCaseEssive")]
pub const Essive: Self = Self(11);
#[doc(alias = "NSGrammaticalCaseInessive")]
pub const Inessive: Self = Self(12);
#[doc(alias = "NSGrammaticalCaseLocative")]
pub const Locative: Self = Self(13);
#[doc(alias = "NSGrammaticalCaseTranslative")]
pub const Translative: Self = Self(14);
}
unsafe impl Encode for NSGrammaticalCase {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalCase {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalPronounType(pub NSInteger);
impl NSGrammaticalPronounType {
#[doc(alias = "NSGrammaticalPronounTypeNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalPronounTypePersonal")]
pub const Personal: Self = Self(1);
#[doc(alias = "NSGrammaticalPronounTypeReflexive")]
pub const Reflexive: Self = Self(2);
#[doc(alias = "NSGrammaticalPronounTypePossessive")]
pub const Possessive: Self = Self(3);
}
unsafe impl Encode for NSGrammaticalPronounType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalPronounType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalPerson(pub NSInteger);
impl NSGrammaticalPerson {
#[doc(alias = "NSGrammaticalPersonNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalPersonFirst")]
pub const First: Self = Self(1);
#[doc(alias = "NSGrammaticalPersonSecond")]
pub const Second: Self = Self(2);
#[doc(alias = "NSGrammaticalPersonThird")]
pub const Third: Self = Self(3);
}
unsafe impl Encode for NSGrammaticalPerson {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalPerson {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalDetermination(pub NSInteger);
impl NSGrammaticalDetermination {
#[doc(alias = "NSGrammaticalDeterminationNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalDeterminationIndependent")]
pub const Independent: Self = Self(1);
#[doc(alias = "NSGrammaticalDeterminationDependent")]
pub const Dependent: Self = Self(2);
}
unsafe impl Encode for NSGrammaticalDetermination {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalDetermination {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSGrammaticalDefiniteness(pub NSInteger);
impl NSGrammaticalDefiniteness {
#[doc(alias = "NSGrammaticalDefinitenessNotSet")]
pub const NotSet: Self = Self(0);
#[doc(alias = "NSGrammaticalDefinitenessIndefinite")]
pub const Indefinite: Self = Self(1);
#[doc(alias = "NSGrammaticalDefinitenessDefinite")]
pub const Definite: Self = Self(2);
}
unsafe impl Encode for NSGrammaticalDefiniteness {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for NSGrammaticalDefiniteness {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSMorphology;
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCoding for NSMorphology {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCopying for NSMorphology {}
);
#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSMorphology {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSMorphology {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSSecureCoding for NSMorphology {}
);
impl NSMorphology {
extern_methods!(
#[unsafe(method(grammaticalGender))]
#[unsafe(method_family = none)]
pub fn grammaticalGender(&self) -> NSGrammaticalGender;
/// Setter for [`grammaticalGender`][Self::grammaticalGender].
#[unsafe(method(setGrammaticalGender:))]
#[unsafe(method_family = none)]
pub fn setGrammaticalGender(&self, grammatical_gender: NSGrammaticalGender);
#[unsafe(method(partOfSpeech))]
#[unsafe(method_family = none)]
pub fn partOfSpeech(&self) -> NSGrammaticalPartOfSpeech;
/// Setter for [`partOfSpeech`][Self::partOfSpeech].
#[unsafe(method(setPartOfSpeech:))]
#[unsafe(method_family = none)]
pub fn setPartOfSpeech(&self, part_of_speech: NSGrammaticalPartOfSpeech);
#[unsafe(method(number))]
#[unsafe(method_family = none)]
pub fn number(&self) -> NSGrammaticalNumber;
/// Setter for [`number`][Self::number].
#[unsafe(method(setNumber:))]
#[unsafe(method_family = none)]
pub fn setNumber(&self, number: NSGrammaticalNumber);
#[unsafe(method(grammaticalCase))]
#[unsafe(method_family = none)]
pub fn grammaticalCase(&self) -> NSGrammaticalCase;
/// Setter for [`grammaticalCase`][Self::grammaticalCase].
#[unsafe(method(setGrammaticalCase:))]
#[unsafe(method_family = none)]
pub fn setGrammaticalCase(&self, grammatical_case: NSGrammaticalCase);
#[unsafe(method(determination))]
#[unsafe(method_family = none)]
pub fn determination(&self) -> NSGrammaticalDetermination;
/// Setter for [`determination`][Self::determination].
#[unsafe(method(setDetermination:))]
#[unsafe(method_family = none)]
pub fn setDetermination(&self, determination: NSGrammaticalDetermination);
#[unsafe(method(grammaticalPerson))]
#[unsafe(method_family = none)]
pub fn grammaticalPerson(&self) -> NSGrammaticalPerson;
/// Setter for [`grammaticalPerson`][Self::grammaticalPerson].
#[unsafe(method(setGrammaticalPerson:))]
#[unsafe(method_family = none)]
pub fn setGrammaticalPerson(&self, grammatical_person: NSGrammaticalPerson);
#[unsafe(method(pronounType))]
#[unsafe(method_family = none)]
pub fn pronounType(&self) -> NSGrammaticalPronounType;
/// Setter for [`pronounType`][Self::pronounType].
#[unsafe(method(setPronounType:))]
#[unsafe(method_family = none)]
pub fn setPronounType(&self, pronoun_type: NSGrammaticalPronounType);
#[unsafe(method(definiteness))]
#[unsafe(method_family = none)]
pub fn definiteness(&self) -> NSGrammaticalDefiniteness;
/// Setter for [`definiteness`][Self::definiteness].
#[unsafe(method(setDefiniteness:))]
#[unsafe(method_family = none)]
pub fn setDefiniteness(&self, definiteness: NSGrammaticalDefiniteness);
);
}
/// Methods declared on superclass `NSObject`.
impl NSMorphology {
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>;
);
}
impl DefaultRetained for NSMorphology {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSMorphologyPronoun;
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCoding for NSMorphologyPronoun {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCopying for NSMorphologyPronoun {}
);
#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSMorphologyPronoun {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSMorphologyPronoun {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSSecureCoding for NSMorphologyPronoun {}
);
impl NSMorphologyPronoun {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "NSString")]
#[unsafe(method(initWithPronoun:morphology:dependentMorphology:))]
#[unsafe(method_family = init)]
pub fn initWithPronoun_morphology_dependentMorphology(
this: Allocated<Self>,
pronoun: &NSString,
morphology: &NSMorphology,
dependent_morphology: Option<&NSMorphology>,
) -> Retained<Self>;
#[cfg(feature = "NSString")]
#[unsafe(method(pronoun))]
#[unsafe(method_family = none)]
pub fn pronoun(&self) -> Retained<NSString>;
#[unsafe(method(morphology))]
#[unsafe(method_family = none)]
pub fn morphology(&self) -> Retained<NSMorphology>;
#[unsafe(method(dependentMorphology))]
#[unsafe(method_family = none)]
pub fn dependentMorphology(&self) -> Option<Retained<NSMorphology>>;
);
}
/// NSCustomPronouns.
#[deprecated = "Use NSTermOfAddress instead"]
impl NSMorphology {
extern_methods!(
#[cfg(feature = "NSString")]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(customPronounForLanguage:))]
#[unsafe(method_family = none)]
pub fn customPronounForLanguage(
&self,
language: &NSString,
) -> Option<Retained<NSMorphologyCustomPronoun>>;
#[cfg(all(feature = "NSError", feature = "NSString"))]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(setCustomPronoun:forLanguage:error:_))]
#[unsafe(method_family = none)]
pub fn setCustomPronoun_forLanguage_error(
&self,
features: Option<&NSMorphologyCustomPronoun>,
language: &NSString,
) -> Result<(), Retained<NSError>>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[deprecated = "Use NSTermOfAddress instead"]
pub struct NSMorphologyCustomPronoun;
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCoding for NSMorphologyCustomPronoun {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSCopying for NSMorphologyCustomPronoun {}
);
#[cfg(feature = "NSObject")]
unsafe impl CopyingHelper for NSMorphologyCustomPronoun {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSMorphologyCustomPronoun {}
);
#[cfg(feature = "NSObject")]
extern_conformance!(
unsafe impl NSSecureCoding for NSMorphologyCustomPronoun {}
);
impl NSMorphologyCustomPronoun {
extern_methods!(
#[cfg(feature = "NSString")]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(isSupportedForLanguage:))]
#[unsafe(method_family = none)]
pub fn isSupportedForLanguage(language: &NSString) -> bool;
#[cfg(all(feature = "NSArray", feature = "NSString"))]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(requiredKeysForLanguage:))]
#[unsafe(method_family = none)]
pub fn requiredKeysForLanguage(language: &NSString) -> Retained<NSArray<NSString>>;
#[cfg(feature = "NSString")]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(subjectForm))]
#[unsafe(method_family = none)]
pub fn subjectForm(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
/// Setter for [`subjectForm`][Self::subjectForm].
///
/// This is [copied][crate::NSCopying::copy] when set.
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(setSubjectForm:))]
#[unsafe(method_family = none)]
pub fn setSubjectForm(&self, subject_form: Option<&NSString>);
#[cfg(feature = "NSString")]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(objectForm))]
#[unsafe(method_family = none)]
pub fn objectForm(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
/// Setter for [`objectForm`][Self::objectForm].
///
/// This is [copied][crate::NSCopying::copy] when set.
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(setObjectForm:))]
#[unsafe(method_family = none)]
pub fn setObjectForm(&self, object_form: Option<&NSString>);
#[cfg(feature = "NSString")]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(possessiveForm))]
#[unsafe(method_family = none)]
pub fn possessiveForm(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
/// Setter for [`possessiveForm`][Self::possessiveForm].
///
/// This is [copied][crate::NSCopying::copy] when set.
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(setPossessiveForm:))]
#[unsafe(method_family = none)]
pub fn setPossessiveForm(&self, possessive_form: Option<&NSString>);
#[cfg(feature = "NSString")]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(possessiveAdjectiveForm))]
#[unsafe(method_family = none)]
pub fn possessiveAdjectiveForm(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
/// Setter for [`possessiveAdjectiveForm`][Self::possessiveAdjectiveForm].
///
/// This is [copied][crate::NSCopying::copy] when set.
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(setPossessiveAdjectiveForm:))]
#[unsafe(method_family = none)]
pub fn setPossessiveAdjectiveForm(&self, possessive_adjective_form: Option<&NSString>);
#[cfg(feature = "NSString")]
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(reflexiveForm))]
#[unsafe(method_family = none)]
pub fn reflexiveForm(&self) -> Option<Retained<NSString>>;
#[cfg(feature = "NSString")]
/// Setter for [`reflexiveForm`][Self::reflexiveForm].
///
/// This is [copied][crate::NSCopying::copy] when set.
#[deprecated = "Use NSTermOfAddress instead"]
#[unsafe(method(setReflexiveForm:))]
#[unsafe(method_family = none)]
pub fn setReflexiveForm(&self, reflexive_form: Option<&NSString>);
);
}
/// Methods declared on superclass `NSObject`.
impl NSMorphologyCustomPronoun {
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>;
);
}
impl DefaultRetained for NSMorphologyCustomPronoun {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
/// NSMorphologyUserSettings.
impl NSMorphology {
extern_methods!(
#[unsafe(method(isUnspecified))]
#[unsafe(method_family = none)]
pub fn isUnspecified(&self) -> bool;
#[unsafe(method(userMorphology))]
#[unsafe(method_family = none)]
pub fn userMorphology() -> Retained<NSMorphology>;
);
}