use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSObjectController, NSController, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
pub struct NSArrayController;
);
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
extern_conformance!(
unsafe impl NSCoding for NSArrayController {}
);
#[cfg(all(
feature = "NSController",
feature = "NSKeyValueBinding",
feature = "NSObjectController"
))]
extern_conformance!(
unsafe impl NSEditor for NSArrayController {}
);
#[cfg(all(
feature = "NSController",
feature = "NSKeyValueBinding",
feature = "NSObjectController"
))]
extern_conformance!(
unsafe impl NSEditorRegistration for NSArrayController {}
);
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSArrayController {}
);
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
impl NSArrayController {
extern_methods!(
#[unsafe(method(rearrangeObjects))]
#[unsafe(method_family = none)]
pub fn rearrangeObjects(&self);
#[unsafe(method(automaticallyRearrangesObjects))]
#[unsafe(method_family = none)]
pub fn automaticallyRearrangesObjects(&self) -> bool;
#[unsafe(method(setAutomaticallyRearrangesObjects:))]
#[unsafe(method_family = none)]
pub fn setAutomaticallyRearrangesObjects(&self, automatically_rearranges_objects: bool);
#[unsafe(method(automaticRearrangementKeyPaths))]
#[unsafe(method_family = none)]
pub fn automaticRearrangementKeyPaths(&self) -> Option<Retained<NSArray<NSString>>>;
#[unsafe(method(didChangeArrangementCriteria))]
#[unsafe(method_family = none)]
pub fn didChangeArrangementCriteria(&self);
#[unsafe(method(sortDescriptors))]
#[unsafe(method_family = none)]
pub fn sortDescriptors(&self) -> Retained<NSArray<NSSortDescriptor>>;
#[unsafe(method(setSortDescriptors:))]
#[unsafe(method_family = none)]
pub fn setSortDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);
#[unsafe(method(filterPredicate))]
#[unsafe(method_family = none)]
pub fn filterPredicate(&self) -> Option<Retained<NSPredicate>>;
#[unsafe(method(setFilterPredicate:))]
#[unsafe(method_family = none)]
pub fn setFilterPredicate(&self, filter_predicate: Option<&NSPredicate>);
#[unsafe(method(clearsFilterPredicateOnInsertion))]
#[unsafe(method_family = none)]
pub fn clearsFilterPredicateOnInsertion(&self) -> bool;
#[unsafe(method(setClearsFilterPredicateOnInsertion:))]
#[unsafe(method_family = none)]
pub fn setClearsFilterPredicateOnInsertion(
&self,
clears_filter_predicate_on_insertion: bool,
);
#[unsafe(method(arrangeObjects:))]
#[unsafe(method_family = none)]
pub unsafe fn arrangeObjects(&self, objects: &NSArray) -> Retained<NSArray>;
#[unsafe(method(arrangedObjects))]
#[unsafe(method_family = none)]
pub fn arrangedObjects(&self) -> Retained<AnyObject>;
#[unsafe(method(avoidsEmptySelection))]
#[unsafe(method_family = none)]
pub fn avoidsEmptySelection(&self) -> bool;
#[unsafe(method(setAvoidsEmptySelection:))]
#[unsafe(method_family = none)]
pub fn setAvoidsEmptySelection(&self, avoids_empty_selection: bool);
#[unsafe(method(preservesSelection))]
#[unsafe(method_family = none)]
pub fn preservesSelection(&self) -> bool;
#[unsafe(method(setPreservesSelection:))]
#[unsafe(method_family = none)]
pub fn setPreservesSelection(&self, preserves_selection: bool);
#[unsafe(method(selectsInsertedObjects))]
#[unsafe(method_family = none)]
pub fn selectsInsertedObjects(&self) -> bool;
#[unsafe(method(setSelectsInsertedObjects:))]
#[unsafe(method_family = none)]
pub fn setSelectsInsertedObjects(&self, selects_inserted_objects: bool);
#[unsafe(method(alwaysUsesMultipleValuesMarker))]
#[unsafe(method_family = none)]
pub fn alwaysUsesMultipleValuesMarker(&self) -> bool;
#[unsafe(method(setAlwaysUsesMultipleValuesMarker:))]
#[unsafe(method_family = none)]
pub fn setAlwaysUsesMultipleValuesMarker(&self, always_uses_multiple_values_marker: bool);
#[unsafe(method(setSelectionIndexes:))]
#[unsafe(method_family = none)]
pub fn setSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;
#[unsafe(method(selectionIndexes))]
#[unsafe(method_family = none)]
pub fn selectionIndexes(&self) -> Retained<NSIndexSet>;
#[unsafe(method(setSelectionIndex:))]
#[unsafe(method_family = none)]
pub fn setSelectionIndex(&self, index: NSUInteger) -> bool;
#[unsafe(method(selectionIndex))]
#[unsafe(method_family = none)]
pub fn selectionIndex(&self) -> NSUInteger;
#[unsafe(method(addSelectionIndexes:))]
#[unsafe(method_family = none)]
pub fn addSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;
#[unsafe(method(removeSelectionIndexes:))]
#[unsafe(method_family = none)]
pub fn removeSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;
#[unsafe(method(setSelectedObjects:))]
#[unsafe(method_family = none)]
pub unsafe fn setSelectedObjects(&self, objects: &NSArray) -> bool;
#[unsafe(method(selectedObjects))]
#[unsafe(method_family = none)]
pub fn selectedObjects(&self) -> Retained<NSArray>;
#[unsafe(method(addSelectedObjects:))]
#[unsafe(method_family = none)]
pub unsafe fn addSelectedObjects(&self, objects: &NSArray) -> bool;
#[unsafe(method(removeSelectedObjects:))]
#[unsafe(method_family = none)]
pub unsafe fn removeSelectedObjects(&self, objects: &NSArray) -> bool;
#[unsafe(method(add:))]
#[unsafe(method_family = none)]
pub unsafe fn add(&self, sender: Option<&AnyObject>);
#[unsafe(method(remove:))]
#[unsafe(method_family = none)]
pub unsafe fn remove(&self, sender: Option<&AnyObject>);
#[unsafe(method(insert:))]
#[unsafe(method_family = none)]
pub unsafe fn insert(&self, sender: Option<&AnyObject>);
#[unsafe(method(canInsert))]
#[unsafe(method_family = none)]
pub fn canInsert(&self) -> bool;
#[unsafe(method(selectNext:))]
#[unsafe(method_family = none)]
pub unsafe fn selectNext(&self, sender: Option<&AnyObject>);
#[unsafe(method(selectPrevious:))]
#[unsafe(method_family = none)]
pub unsafe fn selectPrevious(&self, sender: Option<&AnyObject>);
#[unsafe(method(canSelectNext))]
#[unsafe(method_family = none)]
pub fn canSelectNext(&self) -> bool;
#[unsafe(method(canSelectPrevious))]
#[unsafe(method_family = none)]
pub fn canSelectPrevious(&self) -> bool;
#[unsafe(method(addObject:))]
#[unsafe(method_family = none)]
pub unsafe fn addObject(&self, object: &AnyObject);
#[unsafe(method(addObjects:))]
#[unsafe(method_family = none)]
pub unsafe fn addObjects(&self, objects: &NSArray);
#[unsafe(method(insertObject:atArrangedObjectIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn insertObject_atArrangedObjectIndex(
&self,
object: &AnyObject,
index: NSUInteger,
);
#[unsafe(method(insertObjects:atArrangedObjectIndexes:))]
#[unsafe(method_family = none)]
pub unsafe fn insertObjects_atArrangedObjectIndexes(
&self,
objects: &NSArray,
indexes: &NSIndexSet,
);
#[unsafe(method(removeObjectAtArrangedObjectIndex:))]
#[unsafe(method_family = none)]
pub fn removeObjectAtArrangedObjectIndex(&self, index: NSUInteger);
#[unsafe(method(removeObjectsAtArrangedObjectIndexes:))]
#[unsafe(method_family = none)]
pub fn removeObjectsAtArrangedObjectIndexes(&self, indexes: &NSIndexSet);
#[unsafe(method(removeObject:))]
#[unsafe(method_family = none)]
pub unsafe fn removeObject(&self, object: &AnyObject);
#[unsafe(method(removeObjects:))]
#[unsafe(method_family = none)]
pub unsafe fn removeObjects(&self, objects: &NSArray);
);
}
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
impl NSArrayController {
extern_methods!(
#[unsafe(method(initWithContent:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithContent(
this: Allocated<Self>,
content: Option<&AnyObject>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
impl NSArrayController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
impl NSArrayController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}