//! This file has been automatically generated by `objc2`'s `header-translator`. //! DO NOT EDIT use core::ptr::NonNull; use objc2::__framework_prelude::*; use crate::*; /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscompoundpredicatetype?language=objc) // NS_ENUM #[repr(transparent)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct NSCompoundPredicateType(pub NSUInteger); impl NSCompoundPredicateType { #[doc(alias = "NSNotPredicateType")] pub const NotPredicateType: Self = Self(0); #[doc(alias = "NSAndPredicateType")] pub const AndPredicateType: Self = Self(1); #[doc(alias = "NSOrPredicateType")] pub const OrPredicateType: Self = Self(2); } unsafe impl Encode for NSCompoundPredicateType { const ENCODING: Encoding = NSUInteger::ENCODING; } unsafe impl RefEncode for NSCompoundPredicateType { const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); } extern_class!( /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nscompoundpredicate?language=objc) #[unsafe(super(NSPredicate, NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] #[cfg(feature = "NSPredicate")] pub struct NSCompoundPredicate; ); #[cfg(all(feature = "NSObject", feature = "NSPredicate"))] extern_conformance!( unsafe impl NSCoding for NSCompoundPredicate {} ); #[cfg(all(feature = "NSObject", feature = "NSPredicate"))] extern_conformance!( unsafe impl NSCopying for NSCompoundPredicate {} ); #[cfg(all(feature = "NSObject", feature = "NSPredicate"))] unsafe impl CopyingHelper for NSCompoundPredicate { type Result = Self; } #[cfg(feature = "NSPredicate")] extern_conformance!( unsafe impl NSObjectProtocol for NSCompoundPredicate {} ); #[cfg(all(feature = "NSObject", feature = "NSPredicate"))] extern_conformance!( unsafe impl NSSecureCoding for NSCompoundPredicate {} ); #[cfg(feature = "NSPredicate")] impl NSCompoundPredicate { extern_methods!( #[cfg(feature = "NSArray")] #[unsafe(method(initWithType:subpredicates:))] #[unsafe(method_family = init)] pub fn initWithType_subpredicates( this: Allocated, r#type: NSCompoundPredicateType, subpredicates: &NSArray, ) -> 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>; #[unsafe(method(compoundPredicateType))] #[unsafe(method_family = none)] pub fn compoundPredicateType(&self) -> NSCompoundPredicateType; #[cfg(feature = "NSArray")] #[unsafe(method(subpredicates))] #[unsafe(method_family = none)] pub fn subpredicates(&self) -> Retained; #[cfg(feature = "NSArray")] /// * Convenience Methods ** #[unsafe(method(andPredicateWithSubpredicates:))] #[unsafe(method_family = none)] pub fn andPredicateWithSubpredicates( subpredicates: &NSArray, ) -> Retained; #[cfg(feature = "NSArray")] #[unsafe(method(orPredicateWithSubpredicates:))] #[unsafe(method_family = none)] pub fn orPredicateWithSubpredicates( subpredicates: &NSArray, ) -> Retained; #[unsafe(method(notPredicateWithSubpredicate:))] #[unsafe(method_family = none)] pub fn notPredicateWithSubpredicate( predicate: &NSPredicate, ) -> Retained; ); } /// Methods declared on superclass `NSObject`. #[cfg(feature = "NSPredicate")] impl NSCompoundPredicate { 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; ); } #[cfg(feature = "NSPredicate")] impl DefaultRetained for NSCompoundPredicate { #[inline] fn default_retained() -> Retained { Self::new() } }