objc2-app-kit 0.2.2

Bindings to the AppKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    pub struct NSArrayController;

    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl ClassType for NSArrayController {
        #[inherits(NSController, NSObject)]
        type Super = NSObjectController;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
unsafe impl NSCoding for NSArrayController {}

#[cfg(all(
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
unsafe impl NSEditor for NSArrayController {}

#[cfg(all(
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
unsafe impl NSEditorRegistration for NSArrayController {}

#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
unsafe impl NSObjectProtocol for NSArrayController {}

extern_methods!(
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method(rearrangeObjects)]
        pub unsafe fn rearrangeObjects(&self);

        #[method(automaticallyRearrangesObjects)]
        pub unsafe fn automaticallyRearrangesObjects(&self) -> bool;

        #[method(setAutomaticallyRearrangesObjects:)]
        pub unsafe fn setAutomaticallyRearrangesObjects(
            &self,
            automatically_rearranges_objects: bool,
        );

        #[method_id(@__retain_semantics Other automaticRearrangementKeyPaths)]
        pub unsafe fn automaticRearrangementKeyPaths(&self) -> Option<Retained<NSArray<NSString>>>;

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

        #[method_id(@__retain_semantics Other sortDescriptors)]
        pub unsafe fn sortDescriptors(&self) -> Retained<NSArray<NSSortDescriptor>>;

        #[method(setSortDescriptors:)]
        pub unsafe fn setSortDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);

        #[method_id(@__retain_semantics Other filterPredicate)]
        pub unsafe fn filterPredicate(&self) -> Option<Retained<NSPredicate>>;

        #[method(setFilterPredicate:)]
        pub unsafe fn setFilterPredicate(&self, filter_predicate: Option<&NSPredicate>);

        #[method(clearsFilterPredicateOnInsertion)]
        pub unsafe fn clearsFilterPredicateOnInsertion(&self) -> bool;

        #[method(setClearsFilterPredicateOnInsertion:)]
        pub unsafe fn setClearsFilterPredicateOnInsertion(
            &self,
            clears_filter_predicate_on_insertion: bool,
        );

        #[method_id(@__retain_semantics Other arrangeObjects:)]
        pub unsafe fn arrangeObjects(&self, objects: &NSArray) -> Retained<NSArray>;

        #[method_id(@__retain_semantics Other arrangedObjects)]
        pub unsafe fn arrangedObjects(&self) -> Retained<AnyObject>;

        #[method(avoidsEmptySelection)]
        pub unsafe fn avoidsEmptySelection(&self) -> bool;

        #[method(setAvoidsEmptySelection:)]
        pub unsafe fn setAvoidsEmptySelection(&self, avoids_empty_selection: bool);

        #[method(preservesSelection)]
        pub unsafe fn preservesSelection(&self) -> bool;

        #[method(setPreservesSelection:)]
        pub unsafe fn setPreservesSelection(&self, preserves_selection: bool);

        #[method(selectsInsertedObjects)]
        pub unsafe fn selectsInsertedObjects(&self) -> bool;

        #[method(setSelectsInsertedObjects:)]
        pub unsafe fn setSelectsInsertedObjects(&self, selects_inserted_objects: bool);

        #[method(alwaysUsesMultipleValuesMarker)]
        pub unsafe fn alwaysUsesMultipleValuesMarker(&self) -> bool;

        #[method(setAlwaysUsesMultipleValuesMarker:)]
        pub unsafe fn setAlwaysUsesMultipleValuesMarker(
            &self,
            always_uses_multiple_values_marker: bool,
        );

        #[method(setSelectionIndexes:)]
        pub unsafe fn setSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;

        #[method_id(@__retain_semantics Other selectionIndexes)]
        pub unsafe fn selectionIndexes(&self) -> Retained<NSIndexSet>;

        #[method(setSelectionIndex:)]
        pub unsafe fn setSelectionIndex(&self, index: NSUInteger) -> bool;

        #[method(selectionIndex)]
        pub unsafe fn selectionIndex(&self) -> NSUInteger;

        #[method(addSelectionIndexes:)]
        pub unsafe fn addSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;

        #[method(removeSelectionIndexes:)]
        pub unsafe fn removeSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;

        #[method(setSelectedObjects:)]
        pub unsafe fn setSelectedObjects(&self, objects: &NSArray) -> bool;

        #[method_id(@__retain_semantics Other selectedObjects)]
        pub unsafe fn selectedObjects(&self) -> Retained<NSArray>;

        #[method(addSelectedObjects:)]
        pub unsafe fn addSelectedObjects(&self, objects: &NSArray) -> bool;

        #[method(removeSelectedObjects:)]
        pub unsafe fn removeSelectedObjects(&self, objects: &NSArray) -> bool;

        #[method(add:)]
        pub unsafe fn add(&self, sender: Option<&AnyObject>);

        #[method(remove:)]
        pub unsafe fn remove(&self, sender: Option<&AnyObject>);

        #[method(insert:)]
        pub unsafe fn insert(&self, sender: Option<&AnyObject>);

        #[method(canInsert)]
        pub unsafe fn canInsert(&self) -> bool;

        #[method(selectNext:)]
        pub unsafe fn selectNext(&self, sender: Option<&AnyObject>);

        #[method(selectPrevious:)]
        pub unsafe fn selectPrevious(&self, sender: Option<&AnyObject>);

        #[method(canSelectNext)]
        pub unsafe fn canSelectNext(&self) -> bool;

        #[method(canSelectPrevious)]
        pub unsafe fn canSelectPrevious(&self) -> bool;

        #[method(addObject:)]
        pub unsafe fn addObject(&self, object: &AnyObject);

        #[method(addObjects:)]
        pub unsafe fn addObjects(&self, objects: &NSArray);

        #[method(insertObject:atArrangedObjectIndex:)]
        pub unsafe fn insertObject_atArrangedObjectIndex(
            &self,
            object: &AnyObject,
            index: NSUInteger,
        );

        #[method(insertObjects:atArrangedObjectIndexes:)]
        pub unsafe fn insertObjects_atArrangedObjectIndexes(
            &self,
            objects: &NSArray,
            indexes: &NSIndexSet,
        );

        #[method(removeObjectAtArrangedObjectIndex:)]
        pub unsafe fn removeObjectAtArrangedObjectIndex(&self, index: NSUInteger);

        #[method(removeObjectsAtArrangedObjectIndexes:)]
        pub unsafe fn removeObjectsAtArrangedObjectIndexes(&self, indexes: &NSIndexSet);

        #[method(removeObject:)]
        pub unsafe fn removeObject(&self, object: &AnyObject);

        #[method(removeObjects:)]
        pub unsafe fn removeObjects(&self, objects: &NSArray);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObjectController`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method_id(@__retain_semantics Init initWithContent:)]
        pub unsafe fn initWithContent(
            this: Allocated<Self>,
            content: Option<&AnyObject>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSController`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    }
);