use crate::common::*;
use crate::Foundation::*;
ns_enum!(
#[underlying(NSUInteger)]
pub enum NSCompoundPredicateType {
NSNotPredicateType = 0,
NSAndPredicateType = 1,
NSOrPredicateType = 2,
}
);
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "Foundation_NSCompoundPredicate")]
pub struct NSCompoundPredicate;
#[cfg(feature = "Foundation_NSCompoundPredicate")]
unsafe impl ClassType for NSCompoundPredicate {
#[inherits(NSObject)]
type Super = NSPredicate;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "Foundation_NSCompoundPredicate")]
unsafe impl NSCoding for NSCompoundPredicate {}
#[cfg(feature = "Foundation_NSCompoundPredicate")]
unsafe impl NSCopying for NSCompoundPredicate {}
#[cfg(feature = "Foundation_NSCompoundPredicate")]
unsafe impl NSObjectProtocol for NSCompoundPredicate {}
#[cfg(feature = "Foundation_NSCompoundPredicate")]
unsafe impl NSSecureCoding for NSCompoundPredicate {}
extern_methods!(
#[cfg(feature = "Foundation_NSCompoundPredicate")]
unsafe impl NSCompoundPredicate {
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Init initWithType:subpredicates:)]
pub unsafe fn initWithType_subpredicates(
this: Allocated<Self>,
r#type: NSCompoundPredicateType,
subpredicates: &NSArray<NSPredicate>,
) -> Id<Self>;
#[cfg(feature = "Foundation_NSCoder")]
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
#[method(compoundPredicateType)]
pub unsafe fn compoundPredicateType(&self) -> NSCompoundPredicateType;
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Other subpredicates)]
pub unsafe fn subpredicates(&self) -> Id<NSArray>;
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Other andPredicateWithSubpredicates:)]
pub unsafe fn andPredicateWithSubpredicates(
subpredicates: &NSArray<NSPredicate>,
) -> Id<NSCompoundPredicate>;
#[cfg(feature = "Foundation_NSArray")]
#[method_id(@__retain_semantics Other orPredicateWithSubpredicates:)]
pub unsafe fn orPredicateWithSubpredicates(
subpredicates: &NSArray<NSPredicate>,
) -> Id<NSCompoundPredicate>;
#[method_id(@__retain_semantics Other notPredicateWithSubpredicate:)]
pub unsafe fn notPredicateWithSubpredicate(
predicate: &NSPredicate,
) -> Id<NSCompoundPredicate>;
}
);
extern_methods!(
#[cfg(feature = "Foundation_NSCompoundPredicate")]
unsafe impl NSCompoundPredicate {
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Id<Self>;
}
);