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)]
pub struct NSCompoundPredicate;
unsafe impl ClassType for NSCompoundPredicate {
#[inherits(NSObject)]
type Super = NSPredicate;
}
);
extern_methods!(
unsafe impl NSCompoundPredicate {
#[method_id(@__retain_semantics Init initWithType:subpredicates:)]
pub unsafe fn initWithType_subpredicates(
this: Option<Allocated<Self>>,
type_: NSCompoundPredicateType,
subpredicates: &NSArray<NSPredicate>,
) -> Id<Self, Shared>;
#[method_id(@__retain_semantics Init initWithCoder:)]
pub unsafe fn initWithCoder(
this: Option<Allocated<Self>>,
coder: &NSCoder,
) -> Option<Id<Self, Shared>>;
#[method(compoundPredicateType)]
pub unsafe fn compoundPredicateType(&self) -> NSCompoundPredicateType;
#[method_id(@__retain_semantics Other subpredicates)]
pub unsafe fn subpredicates(&self) -> Id<NSArray, Shared>;
#[method_id(@__retain_semantics Other andPredicateWithSubpredicates:)]
pub unsafe fn andPredicateWithSubpredicates(
subpredicates: &NSArray<NSPredicate>,
) -> Id<NSCompoundPredicate, Shared>;
#[method_id(@__retain_semantics Other orPredicateWithSubpredicates:)]
pub unsafe fn orPredicateWithSubpredicates(
subpredicates: &NSArray<NSPredicate>,
) -> Id<NSCompoundPredicate, Shared>;
#[method_id(@__retain_semantics Other notPredicateWithSubpredicate:)]
pub unsafe fn notPredicateWithSubpredicate(
predicate: &NSPredicate,
) -> Id<NSCompoundPredicate, Shared>;
}
);