icrate 0.0.1

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPredicate;

    unsafe impl ClassType for NSPredicate {
        type Super = NSObject;
    }
);

extern_methods!(
    unsafe impl NSPredicate {
        #[method_id(@__retain_semantics Other predicateWithFormat:argumentArray:)]
        pub unsafe fn predicateWithFormat_argumentArray(
            predicateFormat: &NSString,
            arguments: Option<&NSArray>,
        ) -> Id<NSPredicate, Shared>;

        #[method_id(@__retain_semantics Other predicateFromMetadataQueryString:)]
        pub unsafe fn predicateFromMetadataQueryString(
            queryString: &NSString,
        ) -> Option<Id<NSPredicate, Shared>>;

        #[method_id(@__retain_semantics Other predicateWithValue:)]
        pub unsafe fn predicateWithValue(value: bool) -> Id<NSPredicate, Shared>;

        #[method_id(@__retain_semantics Other predicateWithBlock:)]
        pub unsafe fn predicateWithBlock(
            block: &Block<(*mut Object, *mut NSDictionary<NSString, Object>), Bool>,
        ) -> Id<NSPredicate, Shared>;

        #[method_id(@__retain_semantics Other predicateFormat)]
        pub unsafe fn predicateFormat(&self) -> Id<NSString, Shared>;

        #[method_id(@__retain_semantics Other predicateWithSubstitutionVariables:)]
        pub unsafe fn predicateWithSubstitutionVariables(
            &self,
            variables: &NSDictionary<NSString, Object>,
        ) -> Id<Self, Shared>;

        #[method(evaluateWithObject:)]
        pub unsafe fn evaluateWithObject(&self, object: Option<&Object>) -> bool;

        #[method(evaluateWithObject:substitutionVariables:)]
        pub unsafe fn evaluateWithObject_substitutionVariables(
            &self,
            object: Option<&Object>,
            bindings: Option<&NSDictionary<NSString, Object>>,
        ) -> bool;

        #[method(allowEvaluation)]
        pub unsafe fn allowEvaluation(&self);
    }
);

extern_methods!(
    /// NSPredicateSupport
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership>
        NSArray<ObjectType, ObjectTypeOwnership>
    {
        #[method_id(@__retain_semantics Other filteredArrayUsingPredicate:)]
        pub unsafe fn filteredArrayUsingPredicate(
            &self,
            predicate: &NSPredicate,
        ) -> Id<NSArray<ObjectType>, Shared>;
    }
);

extern_methods!(
    /// NSPredicateSupport
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership>
        NSMutableArray<ObjectType, ObjectTypeOwnership>
    {
        #[method(filterUsingPredicate:)]
        pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate);
    }
);

extern_methods!(
    /// NSPredicateSupport
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership>
        NSSet<ObjectType, ObjectTypeOwnership>
    {
        #[method_id(@__retain_semantics Other filteredSetUsingPredicate:)]
        pub unsafe fn filteredSetUsingPredicate(
            &self,
            predicate: &NSPredicate,
        ) -> Id<NSSet<ObjectType>, Shared>;
    }
);

extern_methods!(
    /// NSPredicateSupport
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership>
        NSMutableSet<ObjectType, ObjectTypeOwnership>
    {
        #[method(filterUsingPredicate:)]
        pub unsafe fn filterUsingPredicate(&self, predicate: &NSPredicate);
    }
);

extern_methods!(
    /// NSPredicateSupport
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership>
        NSOrderedSet<ObjectType, ObjectTypeOwnership>
    {
        #[method_id(@__retain_semantics Other filteredOrderedSetUsingPredicate:)]
        pub unsafe fn filteredOrderedSetUsingPredicate(
            &self,
            p: &NSPredicate,
        ) -> Id<NSOrderedSet<ObjectType>, Shared>;
    }
);

extern_methods!(
    /// NSPredicateSupport
    unsafe impl<ObjectType: Message, ObjectTypeOwnership: Ownership>
        NSMutableOrderedSet<ObjectType, ObjectTypeOwnership>
    {
        #[method(filterUsingPredicate:)]
        pub unsafe fn filterUsingPredicate(&self, p: &NSPredicate);
    }
);