use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSDeleteRule(pub NSUInteger);
impl NSDeleteRule {
#[doc(alias = "NSNoActionDeleteRule")]
pub const NoActionDeleteRule: Self = Self(0);
#[doc(alias = "NSNullifyDeleteRule")]
pub const NullifyDeleteRule: Self = Self(1);
#[doc(alias = "NSCascadeDeleteRule")]
pub const CascadeDeleteRule: Self = Self(2);
#[doc(alias = "NSDenyDeleteRule")]
pub const DenyDeleteRule: Self = Self(3);
}
unsafe impl Encode for NSDeleteRule {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSDeleteRule {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSPropertyDescription, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "NSPropertyDescription")]
pub struct NSRelationshipDescription;
);
#[cfg(feature = "NSPropertyDescription")]
extern_conformance!(
unsafe impl NSCoding for NSRelationshipDescription {}
);
#[cfg(feature = "NSPropertyDescription")]
extern_conformance!(
unsafe impl NSCopying for NSRelationshipDescription {}
);
#[cfg(feature = "NSPropertyDescription")]
unsafe impl CopyingHelper for NSRelationshipDescription {
type Result = Self;
}
#[cfg(feature = "NSPropertyDescription")]
extern_conformance!(
unsafe impl NSObjectProtocol for NSRelationshipDescription {}
);
#[cfg(feature = "NSPropertyDescription")]
impl NSRelationshipDescription {
extern_methods!(
#[cfg(feature = "NSEntityDescription")]
#[unsafe(method(destinationEntity))]
#[unsafe(method_family = none)]
pub unsafe fn destinationEntity(&self) -> Option<Retained<NSEntityDescription>>;
#[cfg(feature = "NSEntityDescription")]
#[unsafe(method(setDestinationEntity:))]
#[unsafe(method_family = none)]
pub unsafe fn setDestinationEntity(&self, destination_entity: Option<&NSEntityDescription>);
#[unsafe(method(inverseRelationship))]
#[unsafe(method_family = none)]
pub unsafe fn inverseRelationship(&self) -> Option<Retained<NSRelationshipDescription>>;
#[unsafe(method(setInverseRelationship:))]
#[unsafe(method_family = none)]
pub unsafe fn setInverseRelationship(
&self,
inverse_relationship: Option<&NSRelationshipDescription>,
);
#[unsafe(method(maxCount))]
#[unsafe(method_family = none)]
pub unsafe fn maxCount(&self) -> NSUInteger;
#[unsafe(method(setMaxCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaxCount(&self, max_count: NSUInteger);
#[unsafe(method(minCount))]
#[unsafe(method_family = none)]
pub unsafe fn minCount(&self) -> NSUInteger;
#[unsafe(method(setMinCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinCount(&self, min_count: NSUInteger);
#[unsafe(method(deleteRule))]
#[unsafe(method_family = none)]
pub unsafe fn deleteRule(&self) -> NSDeleteRule;
#[unsafe(method(setDeleteRule:))]
#[unsafe(method_family = none)]
pub unsafe fn setDeleteRule(&self, delete_rule: NSDeleteRule);
#[unsafe(method(isToMany))]
#[unsafe(method_family = none)]
pub unsafe fn isToMany(&self) -> bool;
#[unsafe(method(versionHash))]
#[unsafe(method_family = none)]
pub unsafe fn versionHash(&self) -> Retained<NSData>;
#[unsafe(method(isOrdered))]
#[unsafe(method_family = none)]
pub unsafe fn isOrdered(&self) -> bool;
#[unsafe(method(setOrdered:))]
#[unsafe(method_family = none)]
pub unsafe fn setOrdered(&self, ordered: bool);
);
}
#[cfg(feature = "NSPropertyDescription")]
impl NSRelationshipDescription {
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>;
);
}