objc2-app-kit 0.3.2

Bindings to the AppKit framework
Documentation
//! 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::*;
#[cfg(feature = "objc2-core-data")]
#[cfg(target_vendor = "apple")]
use objc2_core_data::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspredicateeditorrowtemplate?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSPredicateEditorRowTemplate;
);

extern_conformance!(
    unsafe impl NSCoding for NSPredicateEditorRowTemplate {}
);

extern_conformance!(
    unsafe impl NSCopying for NSPredicateEditorRowTemplate {}
);

unsafe impl CopyingHelper for NSPredicateEditorRowTemplate {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for NSPredicateEditorRowTemplate {}
);

impl NSPredicateEditorRowTemplate {
    extern_methods!(
        #[unsafe(method(matchForPredicate:))]
        #[unsafe(method_family = none)]
        pub fn matchForPredicate(&self, predicate: &NSPredicate) -> c_double;

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(templateViews))]
        #[unsafe(method_family = none)]
        pub fn templateViews(&self, mtm: MainThreadMarker) -> Retained<NSArray<NSView>>;

        #[unsafe(method(setPredicate:))]
        #[unsafe(method_family = none)]
        pub fn setPredicate(&self, predicate: &NSPredicate);

        #[unsafe(method(predicateWithSubpredicates:))]
        #[unsafe(method_family = none)]
        pub fn predicateWithSubpredicates(
            &self,
            subpredicates: Option<&NSArray<NSPredicate>>,
        ) -> Retained<NSPredicate>;

        #[unsafe(method(displayableSubpredicatesOfPredicate:))]
        #[unsafe(method_family = none)]
        pub fn displayableSubpredicatesOfPredicate(
            &self,
            predicate: &NSPredicate,
        ) -> Option<Retained<NSArray<NSPredicate>>>;

        #[unsafe(method(initWithLeftExpressions:rightExpressions:modifier:operators:options:))]
        #[unsafe(method_family = init)]
        pub fn initWithLeftExpressions_rightExpressions_modifier_operators_options(
            this: Allocated<Self>,
            left_expressions: &NSArray<NSExpression>,
            right_expressions: &NSArray<NSExpression>,
            modifier: NSComparisonPredicateModifier,
            operators: &NSArray<NSNumber>,
            options: NSUInteger,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-data")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(initWithLeftExpressions:rightExpressionAttributeType:modifier:operators:options:))]
        #[unsafe(method_family = init)]
        pub fn initWithLeftExpressions_rightExpressionAttributeType_modifier_operators_options(
            this: Allocated<Self>,
            left_expressions: &NSArray<NSExpression>,
            attribute_type: NSAttributeType,
            modifier: NSComparisonPredicateModifier,
            operators: &NSArray<NSNumber>,
            options: NSUInteger,
        ) -> Retained<Self>;

        #[unsafe(method(initWithCompoundTypes:))]
        #[unsafe(method_family = init)]
        pub fn initWithCompoundTypes(
            this: Allocated<Self>,
            compound_types: &NSArray<NSNumber>,
        ) -> Retained<Self>;

        #[unsafe(method(leftExpressions))]
        #[unsafe(method_family = none)]
        pub fn leftExpressions(&self) -> Option<Retained<NSArray<NSExpression>>>;

        #[unsafe(method(rightExpressions))]
        #[unsafe(method_family = none)]
        pub fn rightExpressions(&self) -> Option<Retained<NSArray<NSExpression>>>;

        #[cfg(feature = "objc2-core-data")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(rightExpressionAttributeType))]
        #[unsafe(method_family = none)]
        pub fn rightExpressionAttributeType(&self) -> NSAttributeType;

        #[unsafe(method(modifier))]
        #[unsafe(method_family = none)]
        pub fn modifier(&self) -> NSComparisonPredicateModifier;

        #[unsafe(method(operators))]
        #[unsafe(method_family = none)]
        pub fn operators(&self) -> Option<Retained<NSArray<NSNumber>>>;

        #[unsafe(method(options))]
        #[unsafe(method_family = none)]
        pub fn options(&self) -> NSUInteger;

        #[unsafe(method(compoundTypes))]
        #[unsafe(method_family = none)]
        pub fn compoundTypes(&self) -> Option<Retained<NSArray<NSNumber>>>;

        #[cfg(feature = "objc2-core-data")]
        #[cfg(target_vendor = "apple")]
        #[unsafe(method(templatesWithAttributeKeyPaths:inEntityDescription:))]
        #[unsafe(method_family = none)]
        pub fn templatesWithAttributeKeyPaths_inEntityDescription(
            key_paths: &NSArray<NSString>,
            entity_description: &NSEntityDescription,
        ) -> Retained<NSArray<NSPredicateEditorRowTemplate>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSPredicateEditorRowTemplate {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new() -> Retained<Self>;
    );
}

impl DefaultRetained for NSPredicateEditorRowTemplate {
    #[inline]
    fn default_retained() -> Retained<Self> {
        Self::new()
    }
}