//! 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/nspredicate?language=objc) #[unsafe(super(NSObject))] #[derive(Debug, PartialEq, Eq, Hash)] pub struct NSPredicate; ); #[cfg(feature = "NSObject")] extern_conformance!( unsafe impl NSCoding for NSPredicate {} ); #[cfg(feature = "NSObject")] extern_conformance!( unsafe impl NSCopying for NSPredicate {} ); #[cfg(feature = "NSObject")] unsafe impl CopyingHelper for NSPredicate { type Result = Self; } extern_conformance!( unsafe impl NSObjectProtocol for NSPredicate {} ); #[cfg(feature = "NSObject")] extern_conformance!( unsafe impl NSSecureCoding for NSPredicate {} ); impl NSPredicate { extern_methods!( #[cfg(all(feature = "NSArray", feature = "NSString"))] /// # Safety /// /// `arguments` generic should be of the correct type. #[unsafe(method(predicateWithFormat:argumentArray:))] #[unsafe(method_family = none)] pub unsafe fn predicateWithFormat_argumentArray( predicate_format: &NSString, arguments: Option<&NSArray>, ) -> Retained; #[cfg(feature = "NSString")] #[unsafe(method(predicateFromMetadataQueryString:))] #[unsafe(method_family = none)] pub fn predicateFromMetadataQueryString( query_string: &NSString, ) -> Option>; #[unsafe(method(predicateWithValue:))] #[unsafe(method_family = none)] pub fn predicateWithValue(value: bool) -> Retained; #[cfg(all(feature = "NSDictionary", feature = "NSString", feature = "block2"))] #[unsafe(method(predicateWithBlock:))] #[unsafe(method_family = none)] pub fn predicateWithBlock( block: &block2::DynBlock< dyn Fn(*mut AnyObject, *mut NSDictionary) -> Bool, >, ) -> Retained; #[cfg(feature = "NSString")] #[unsafe(method(predicateFormat))] #[unsafe(method_family = none)] pub fn predicateFormat(&self) -> Retained; #[cfg(all(feature = "NSDictionary", feature = "NSString"))] /// # Safety /// /// `variables` generic should be of the correct type. #[unsafe(method(predicateWithSubstitutionVariables:))] #[unsafe(method_family = none)] pub unsafe fn predicateWithSubstitutionVariables( &self, variables: &NSDictionary, ) -> Retained; /// # Safety /// /// `object` should be of the correct type. #[unsafe(method(evaluateWithObject:))] #[unsafe(method_family = none)] pub unsafe fn evaluateWithObject(&self, object: Option<&AnyObject>) -> bool; #[cfg(all(feature = "NSDictionary", feature = "NSString"))] /// # Safety /// /// - `object` should be of the correct type. /// - `bindings` generic should be of the correct type. #[unsafe(method(evaluateWithObject:substitutionVariables:))] #[unsafe(method_family = none)] pub unsafe fn evaluateWithObject_substitutionVariables( &self, object: Option<&AnyObject>, bindings: Option<&NSDictionary>, ) -> bool; #[unsafe(method(allowEvaluation))] #[unsafe(method_family = none)] pub fn allowEvaluation(&self); ); } /// Methods declared on superclass `NSObject`. impl NSPredicate { 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 NSPredicate { #[inline] fn default_retained() -> Retained { Self::new() } } /// NSPredicateSupport. #[cfg(feature = "NSArray")] impl NSArray { extern_methods!( #[unsafe(method(filteredArrayUsingPredicate:))] #[unsafe(method_family = none)] pub fn filteredArrayUsingPredicate( &self, predicate: &NSPredicate, ) -> Retained>; ); } /// NSPredicateSupport. #[cfg(feature = "NSArray")] impl NSMutableArray { extern_methods!( #[unsafe(method(filterUsingPredicate:))] #[unsafe(method_family = none)] pub fn filterUsingPredicate(&self, predicate: &NSPredicate); ); } /// NSPredicateSupport. #[cfg(feature = "NSSet")] impl NSSet { extern_methods!( #[unsafe(method(filteredSetUsingPredicate:))] #[unsafe(method_family = none)] pub fn filteredSetUsingPredicate( &self, predicate: &NSPredicate, ) -> Retained>; ); } /// NSPredicateSupport. #[cfg(feature = "NSSet")] impl NSMutableSet { extern_methods!( #[unsafe(method(filterUsingPredicate:))] #[unsafe(method_family = none)] pub fn filterUsingPredicate(&self, predicate: &NSPredicate); ); } /// NSPredicateSupport. #[cfg(feature = "NSOrderedSet")] impl NSOrderedSet { extern_methods!( #[unsafe(method(filteredOrderedSetUsingPredicate:))] #[unsafe(method_family = none)] pub fn filteredOrderedSetUsingPredicate( &self, p: &NSPredicate, ) -> Retained>; ); } /// NSPredicateSupport. #[cfg(feature = "NSOrderedSet")] impl NSMutableOrderedSet { extern_methods!( #[unsafe(method(filterUsingPredicate:))] #[unsafe(method_family = none)] pub fn filterUsingPredicate(&self, p: &NSPredicate); ); }