use crate::common::*;
use crate::Foundation::*;
ns_enum!(
#[underlying(NSInteger)]
pub enum NSGrammaticalGender {
NSGrammaticalGenderNotSet = 0,
NSGrammaticalGenderFeminine = 1,
NSGrammaticalGenderMasculine = 2,
NSGrammaticalGenderNeuter = 3,
}
);
ns_enum!(
#[underlying(NSInteger)]
pub enum NSGrammaticalPartOfSpeech {
NSGrammaticalPartOfSpeechNotSet = 0,
NSGrammaticalPartOfSpeechDeterminer = 1,
NSGrammaticalPartOfSpeechPronoun = 2,
NSGrammaticalPartOfSpeechLetter = 3,
NSGrammaticalPartOfSpeechAdverb = 4,
NSGrammaticalPartOfSpeechParticle = 5,
NSGrammaticalPartOfSpeechAdjective = 6,
NSGrammaticalPartOfSpeechAdposition = 7,
NSGrammaticalPartOfSpeechVerb = 8,
NSGrammaticalPartOfSpeechNoun = 9,
NSGrammaticalPartOfSpeechConjunction = 10,
NSGrammaticalPartOfSpeechNumeral = 11,
NSGrammaticalPartOfSpeechInterjection = 12,
NSGrammaticalPartOfSpeechPreposition = 13,
NSGrammaticalPartOfSpeechAbbreviation = 14,
}
);
ns_enum!(
#[underlying(NSInteger)]
pub enum NSGrammaticalNumber {
NSGrammaticalNumberNotSet = 0,
NSGrammaticalNumberSingular = 1,
NSGrammaticalNumberZero = 2,
NSGrammaticalNumberPlural = 3,
NSGrammaticalNumberPluralTwo = 4,
NSGrammaticalNumberPluralFew = 5,
NSGrammaticalNumberPluralMany = 6,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSMorphology;
unsafe impl ClassType for NSMorphology {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSMorphology {
#[method(grammaticalGender)]
pub unsafe fn grammaticalGender(&self) -> NSGrammaticalGender;
#[method(setGrammaticalGender:)]
pub unsafe fn setGrammaticalGender(&self, grammaticalGender: NSGrammaticalGender);
#[method(partOfSpeech)]
pub unsafe fn partOfSpeech(&self) -> NSGrammaticalPartOfSpeech;
#[method(setPartOfSpeech:)]
pub unsafe fn setPartOfSpeech(&self, partOfSpeech: NSGrammaticalPartOfSpeech);
#[method(number)]
pub unsafe fn number(&self) -> NSGrammaticalNumber;
#[method(setNumber:)]
pub unsafe fn setNumber(&self, number: NSGrammaticalNumber);
}
);
extern_methods!(
unsafe impl NSMorphology {
#[method_id(@__retain_semantics Other customPronounForLanguage:)]
pub unsafe fn customPronounForLanguage(
&self,
language: &NSString,
) -> Option<Id<NSMorphologyCustomPronoun, Shared>>;
#[method(setCustomPronoun:forLanguage:error:)]
pub unsafe fn setCustomPronoun_forLanguage_error(
&self,
features: Option<&NSMorphologyCustomPronoun>,
language: &NSString,
) -> Result<(), Id<NSError, Shared>>;
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSMorphologyCustomPronoun;
unsafe impl ClassType for NSMorphologyCustomPronoun {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSMorphologyCustomPronoun {
#[method(isSupportedForLanguage:)]
pub unsafe fn isSupportedForLanguage(language: &NSString) -> bool;
#[method_id(@__retain_semantics Other requiredKeysForLanguage:)]
pub unsafe fn requiredKeysForLanguage(language: &NSString)
-> Id<NSArray<NSString>, Shared>;
#[method_id(@__retain_semantics Other subjectForm)]
pub unsafe fn subjectForm(&self) -> Option<Id<NSString, Shared>>;
#[method(setSubjectForm:)]
pub unsafe fn setSubjectForm(&self, subjectForm: Option<&NSString>);
#[method_id(@__retain_semantics Other objectForm)]
pub unsafe fn objectForm(&self) -> Option<Id<NSString, Shared>>;
#[method(setObjectForm:)]
pub unsafe fn setObjectForm(&self, objectForm: Option<&NSString>);
#[method_id(@__retain_semantics Other possessiveForm)]
pub unsafe fn possessiveForm(&self) -> Option<Id<NSString, Shared>>;
#[method(setPossessiveForm:)]
pub unsafe fn setPossessiveForm(&self, possessiveForm: Option<&NSString>);
#[method_id(@__retain_semantics Other possessiveAdjectiveForm)]
pub unsafe fn possessiveAdjectiveForm(&self) -> Option<Id<NSString, Shared>>;
#[method(setPossessiveAdjectiveForm:)]
pub unsafe fn setPossessiveAdjectiveForm(&self, possessiveAdjectiveForm: Option<&NSString>);
#[method_id(@__retain_semantics Other reflexiveForm)]
pub unsafe fn reflexiveForm(&self) -> Option<Id<NSString, Shared>>;
#[method(setReflexiveForm:)]
pub unsafe fn setReflexiveForm(&self, reflexiveForm: Option<&NSString>);
}
);
extern_methods!(
unsafe impl NSMorphology {
#[method(isUnspecified)]
pub unsafe fn isUnspecified(&self) -> bool;
#[method_id(@__retain_semantics Other userMorphology)]
pub unsafe fn userMorphology() -> Id<NSMorphology, Shared>;
}
);