use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSEntityDescription;
);
extern_conformance!(
unsafe impl NSCoding for NSEntityDescription {}
);
extern_conformance!(
unsafe impl NSCopying for NSEntityDescription {}
);
unsafe impl CopyingHelper for NSEntityDescription {
type Result = Self;
}
extern_conformance!(
unsafe impl NSFastEnumeration for NSEntityDescription {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSEntityDescription {}
);
impl NSEntityDescription {
extern_methods!(
#[cfg(feature = "NSManagedObjectContext")]
#[unsafe(method(entityForName:inManagedObjectContext:))]
#[unsafe(method_family = none)]
pub unsafe fn entityForName_inManagedObjectContext(
entity_name: &NSString,
context: &NSManagedObjectContext,
) -> Option<Retained<NSEntityDescription>>;
#[cfg(all(feature = "NSManagedObject", feature = "NSManagedObjectContext"))]
#[unsafe(method(insertNewObjectForEntityForName:inManagedObjectContext:))]
#[unsafe(method_family = none)]
pub unsafe fn insertNewObjectForEntityForName_inManagedObjectContext(
entity_name: &NSString,
context: &NSManagedObjectContext,
) -> Retained<NSManagedObject>;
#[cfg(feature = "NSManagedObjectModel")]
#[unsafe(method(managedObjectModel))]
#[unsafe(method_family = none)]
pub unsafe fn managedObjectModel(&self) -> Retained<NSManagedObjectModel>;
#[unsafe(method(managedObjectClassName))]
#[unsafe(method_family = none)]
pub unsafe fn managedObjectClassName(&self) -> Retained<NSString>;
#[unsafe(method(setManagedObjectClassName:))]
#[unsafe(method_family = none)]
pub unsafe fn setManagedObjectClassName(
&self,
managed_object_class_name: Option<&NSString>,
);
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: Option<&NSString>);
#[unsafe(method(isAbstract))]
#[unsafe(method_family = none)]
pub unsafe fn isAbstract(&self) -> bool;
#[unsafe(method(setAbstract:))]
#[unsafe(method_family = none)]
pub unsafe fn setAbstract(&self, r#abstract: bool);
#[unsafe(method(subentitiesByName))]
#[unsafe(method_family = none)]
pub unsafe fn subentitiesByName(
&self,
) -> Retained<NSDictionary<NSString, NSEntityDescription>>;
#[unsafe(method(subentities))]
#[unsafe(method_family = none)]
pub unsafe fn subentities(&self) -> Retained<NSArray<NSEntityDescription>>;
#[unsafe(method(setSubentities:))]
#[unsafe(method_family = none)]
pub unsafe fn setSubentities(&self, subentities: &NSArray<NSEntityDescription>);
#[unsafe(method(superentity))]
#[unsafe(method_family = none)]
pub unsafe fn superentity(&self) -> Option<Retained<NSEntityDescription>>;
#[cfg(feature = "NSPropertyDescription")]
#[unsafe(method(propertiesByName))]
#[unsafe(method_family = none)]
pub unsafe fn propertiesByName(
&self,
) -> Retained<NSDictionary<NSString, NSPropertyDescription>>;
#[cfg(feature = "NSPropertyDescription")]
#[unsafe(method(properties))]
#[unsafe(method_family = none)]
pub unsafe fn properties(&self) -> Retained<NSArray<NSPropertyDescription>>;
#[cfg(feature = "NSPropertyDescription")]
#[unsafe(method(setProperties:))]
#[unsafe(method_family = none)]
pub unsafe fn setProperties(&self, properties: &NSArray<NSPropertyDescription>);
#[unsafe(method(userInfo))]
#[unsafe(method_family = none)]
pub unsafe fn userInfo(&self) -> Option<Retained<NSDictionary>>;
#[unsafe(method(setUserInfo:))]
#[unsafe(method_family = none)]
pub unsafe fn setUserInfo(&self, user_info: Option<&NSDictionary>);
#[cfg(all(feature = "NSAttributeDescription", feature = "NSPropertyDescription"))]
#[unsafe(method(attributesByName))]
#[unsafe(method_family = none)]
pub unsafe fn attributesByName(
&self,
) -> Retained<NSDictionary<NSString, NSAttributeDescription>>;
#[cfg(all(
feature = "NSPropertyDescription",
feature = "NSRelationshipDescription"
))]
#[unsafe(method(relationshipsByName))]
#[unsafe(method_family = none)]
pub unsafe fn relationshipsByName(
&self,
) -> Retained<NSDictionary<NSString, NSRelationshipDescription>>;
#[cfg(all(
feature = "NSPropertyDescription",
feature = "NSRelationshipDescription"
))]
#[unsafe(method(relationshipsWithDestinationEntity:))]
#[unsafe(method_family = none)]
pub unsafe fn relationshipsWithDestinationEntity(
&self,
entity: &NSEntityDescription,
) -> Retained<NSArray<NSRelationshipDescription>>;
#[unsafe(method(isKindOfEntity:))]
#[unsafe(method_family = none)]
pub unsafe fn isKindOfEntity(&self, entity: &NSEntityDescription) -> bool;
#[unsafe(method(versionHash))]
#[unsafe(method_family = none)]
pub unsafe fn versionHash(&self) -> Retained<NSData>;
#[unsafe(method(versionHashModifier))]
#[unsafe(method_family = none)]
pub unsafe fn versionHashModifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setVersionHashModifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setVersionHashModifier(&self, version_hash_modifier: Option<&NSString>);
#[unsafe(method(renamingIdentifier))]
#[unsafe(method_family = none)]
pub unsafe fn renamingIdentifier(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setRenamingIdentifier:))]
#[unsafe(method_family = none)]
pub unsafe fn setRenamingIdentifier(&self, renaming_identifier: Option<&NSString>);
#[cfg(feature = "NSFetchIndexDescription")]
#[unsafe(method(indexes))]
#[unsafe(method_family = none)]
pub unsafe fn indexes(&self) -> Retained<NSArray<NSFetchIndexDescription>>;
#[cfg(feature = "NSFetchIndexDescription")]
#[unsafe(method(setIndexes:))]
#[unsafe(method_family = none)]
pub unsafe fn setIndexes(&self, indexes: &NSArray<NSFetchIndexDescription>);
#[unsafe(method(uniquenessConstraints))]
#[unsafe(method_family = none)]
pub unsafe fn uniquenessConstraints(&self) -> Retained<NSArray<NSArray<AnyObject>>>;
#[unsafe(method(setUniquenessConstraints:))]
#[unsafe(method_family = none)]
pub unsafe fn setUniquenessConstraints(
&self,
uniqueness_constraints: &NSArray<NSArray<AnyObject>>,
);
#[deprecated = "Use NSEntityDescription.indexes instead"]
#[unsafe(method(compoundIndexes))]
#[unsafe(method_family = none)]
pub unsafe fn compoundIndexes(&self) -> Retained<NSArray<NSArray<AnyObject>>>;
#[deprecated = "Use NSEntityDescription.indexes instead"]
#[unsafe(method(setCompoundIndexes:))]
#[unsafe(method_family = none)]
pub unsafe fn setCompoundIndexes(&self, compound_indexes: &NSArray<NSArray<AnyObject>>);
#[unsafe(method(coreSpotlightDisplayNameExpression))]
#[unsafe(method_family = none)]
pub unsafe fn coreSpotlightDisplayNameExpression(&self) -> Retained<NSExpression>;
#[unsafe(method(setCoreSpotlightDisplayNameExpression:))]
#[unsafe(method_family = none)]
pub unsafe fn setCoreSpotlightDisplayNameExpression(
&self,
core_spotlight_display_name_expression: &NSExpression,
);
);
}
impl NSEntityDescription {
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>;
);
}