//! 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::*; extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nssortdescriptor?language=objc) #[unsafe(super(NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] pub struct NSSortDescriptor; ); #[cfg(feature = "NSObject")] extern_conformance!( unsafe impl NSCoding for NSSortDescriptor {} ); #[cfg(feature = "NSObject")] extern_conformance!( unsafe impl NSCopying for NSSortDescriptor {} ); #[cfg(feature = "NSObject")] unsafe impl CopyingHelper for NSSortDescriptor { type Result = Self; } extern_conformance!( unsafe impl NSObjectProtocol for NSSortDescriptor {} ); #[cfg(feature = "NSObject")] extern_conformance!( unsafe impl NSSecureCoding for NSSortDescriptor {} ); impl NSSortDescriptor { extern_methods!( #[cfg(feature = "NSString")] #[unsafe(method(sortDescriptorWithKey:ascending:))] #[unsafe(method_family = none)] pub fn sortDescriptorWithKey_ascending( key: Option<&NSString>, ascending: bool, ) -> Retained; #[cfg(feature = "NSString")] /// # Safety /// /// `selector` must be a valid selector. #[unsafe(method(sortDescriptorWithKey:ascending:selector:))] #[unsafe(method_family = none)] pub unsafe fn sortDescriptorWithKey_ascending_selector( key: Option<&NSString>, ascending: bool, selector: Option, ) -> Retained; #[cfg(feature = "NSString")] #[unsafe(method(initWithKey:ascending:))] #[unsafe(method_family = init)] pub fn initWithKey_ascending( this: Allocated, key: Option<&NSString>, ascending: bool, ) -> Retained; #[cfg(feature = "NSString")] /// # Safety /// /// `selector` must be a valid selector. #[unsafe(method(initWithKey:ascending:selector:))] #[unsafe(method_family = init)] pub unsafe fn initWithKey_ascending_selector( this: Allocated, key: Option<&NSString>, ascending: bool, selector: Option, ) -> Retained; #[cfg(feature = "NSCoder")] /// # Safety /// /// `coder` possibly has further requirements. #[unsafe(method(initWithCoder:))] #[unsafe(method_family = init)] pub unsafe fn initWithCoder( this: Allocated, coder: &NSCoder, ) -> Option>; #[cfg(feature = "NSString")] #[unsafe(method(key))] #[unsafe(method_family = none)] pub fn key(&self) -> Option>; #[unsafe(method(ascending))] #[unsafe(method_family = none)] pub fn ascending(&self) -> bool; #[unsafe(method(selector))] #[unsafe(method_family = none)] pub fn selector(&self) -> Option; #[unsafe(method(allowEvaluation))] #[unsafe(method_family = none)] pub fn allowEvaluation(&self); #[cfg(all(feature = "NSObjCRuntime", feature = "NSString", feature = "block2"))] /// # Safety /// /// `cmptr` must be a valid pointer. #[unsafe(method(sortDescriptorWithKey:ascending:comparator:))] #[unsafe(method_family = none)] pub unsafe fn sortDescriptorWithKey_ascending_comparator( key: Option<&NSString>, ascending: bool, cmptr: NSComparator, ) -> Retained; #[cfg(all(feature = "NSObjCRuntime", feature = "NSString", feature = "block2"))] /// # Safety /// /// `cmptr` must be a valid pointer. #[unsafe(method(initWithKey:ascending:comparator:))] #[unsafe(method_family = init)] pub unsafe fn initWithKey_ascending_comparator( this: Allocated, key: Option<&NSString>, ascending: bool, cmptr: NSComparator, ) -> Retained; #[cfg(all(feature = "NSObjCRuntime", feature = "block2"))] /// # Safety /// /// - The returned block's argument 1 must be a valid pointer. /// - The returned block's argument 2 must be a valid pointer. #[unsafe(method(comparator))] #[unsafe(method_family = none)] pub unsafe fn comparator(&self) -> NSComparator; #[cfg(feature = "NSObjCRuntime")] /// # Safety /// /// - `object1` should be of the correct type. /// - `object2` should be of the correct type. #[unsafe(method(compareObject:toObject:))] #[unsafe(method_family = none)] pub unsafe fn compareObject_toObject( &self, object1: &AnyObject, object2: &AnyObject, ) -> NSComparisonResult; #[unsafe(method(reversedSortDescriptor))] #[unsafe(method_family = none)] pub fn reversedSortDescriptor(&self) -> Retained; ); } /// Methods declared on superclass `NSObject`. impl NSSortDescriptor { extern_methods!( #[unsafe(method(init))] #[unsafe(method_family = init)] pub fn init(this: Allocated) -> Retained; #[unsafe(method(new))] #[unsafe(method_family = new)] pub fn new() -> Retained; ); } impl DefaultRetained for NSSortDescriptor { #[inline] fn default_retained() -> Retained { Self::new() } } /// NSSortDescriptorSorting. #[cfg(feature = "NSSet")] impl NSSet { extern_methods!( #[cfg(feature = "NSArray")] #[unsafe(method(sortedArrayUsingDescriptors:))] #[unsafe(method_family = none)] pub fn sortedArrayUsingDescriptors( &self, sort_descriptors: &NSArray, ) -> Retained>; ); } /// NSSortDescriptorSorting. #[cfg(feature = "NSArray")] impl NSArray { extern_methods!( #[unsafe(method(sortedArrayUsingDescriptors:))] #[unsafe(method_family = none)] pub fn sortedArrayUsingDescriptors( &self, sort_descriptors: &NSArray, ) -> Retained>; ); } /// NSSortDescriptorSorting. #[cfg(feature = "NSArray")] impl NSMutableArray { extern_methods!( #[unsafe(method(sortUsingDescriptors:))] #[unsafe(method_family = none)] pub fn sortUsingDescriptors(&self, sort_descriptors: &NSArray); ); } /// NSKeyValueSorting. #[cfg(feature = "NSOrderedSet")] impl NSOrderedSet { extern_methods!( #[cfg(feature = "NSArray")] #[unsafe(method(sortedArrayUsingDescriptors:))] #[unsafe(method_family = none)] pub fn sortedArrayUsingDescriptors( &self, sort_descriptors: &NSArray, ) -> Retained>; ); } /// NSKeyValueSorting. #[cfg(feature = "NSOrderedSet")] impl NSMutableOrderedSet { extern_methods!( #[cfg(feature = "NSArray")] #[unsafe(method(sortUsingDescriptors:))] #[unsafe(method_family = none)] pub fn sortUsingDescriptors(&self, sort_descriptors: &NSArray); ); }