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 NSFetchIndexElementType(pub NSUInteger);
impl NSFetchIndexElementType {
#[doc(alias = "NSFetchIndexElementTypeBinary")]
pub const Binary: Self = Self(0);
#[doc(alias = "NSFetchIndexElementTypeRTree")]
pub const RTree: Self = Self(1);
}
unsafe impl Encode for NSFetchIndexElementType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSFetchIndexElementType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSFetchIndexElementDescription;
);
extern_conformance!(
unsafe impl NSCoding for NSFetchIndexElementDescription {}
);
extern_conformance!(
unsafe impl NSCopying for NSFetchIndexElementDescription {}
);
unsafe impl CopyingHelper for NSFetchIndexElementDescription {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for NSFetchIndexElementDescription {}
);
impl NSFetchIndexElementDescription {
extern_methods!(
#[cfg(feature = "NSPropertyDescription")]
#[unsafe(method(initWithProperty:collationType:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithProperty_collationType(
this: Allocated<Self>,
property: &NSPropertyDescription,
collation_type: NSFetchIndexElementType,
) -> Retained<Self>;
#[cfg(feature = "NSPropertyDescription")]
#[unsafe(method(property))]
#[unsafe(method_family = none)]
pub unsafe fn property(&self) -> Option<Retained<NSPropertyDescription>>;
#[unsafe(method(propertyName))]
#[unsafe(method_family = none)]
pub unsafe fn propertyName(&self) -> Option<Retained<NSString>>;
#[unsafe(method(collationType))]
#[unsafe(method_family = none)]
pub unsafe fn collationType(&self) -> NSFetchIndexElementType;
#[unsafe(method(setCollationType:))]
#[unsafe(method_family = none)]
pub unsafe fn setCollationType(&self, collation_type: NSFetchIndexElementType);
#[unsafe(method(isAscending))]
#[unsafe(method_family = none)]
pub unsafe fn isAscending(&self) -> bool;
#[unsafe(method(setAscending:))]
#[unsafe(method_family = none)]
pub unsafe fn setAscending(&self, ascending: bool);
#[cfg(feature = "NSFetchIndexDescription")]
#[unsafe(method(indexDescription))]
#[unsafe(method_family = none)]
pub unsafe fn indexDescription(&self) -> Option<Retained<NSFetchIndexDescription>>;
);
}
impl NSFetchIndexElementDescription {
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>;
);
}