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 NSTreeController;
);
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
extern_conformance!(
unsafe impl NSCoding for NSTreeController {}
);
#[cfg(all(
feature = "NSController",
feature = "NSKeyValueBinding",
feature = "NSObjectController"
))]
extern_conformance!(
unsafe impl NSEditor for NSTreeController {}
);
#[cfg(all(
feature = "NSController",
feature = "NSKeyValueBinding",
feature = "NSObjectController"
))]
extern_conformance!(
unsafe impl NSEditorRegistration for NSTreeController {}
);
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSTreeController {}
);
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
impl NSTreeController {
extern_methods!(
#[unsafe(method(rearrangeObjects))]
#[unsafe(method_family = none)]
pub fn rearrangeObjects(&self);
#[cfg(feature = "NSTreeNode")]
#[unsafe(method(arrangedObjects))]
#[unsafe(method_family = none)]
pub fn arrangedObjects(&self) -> Retained<NSTreeNode>;
#[unsafe(method(childrenKeyPath))]
#[unsafe(method_family = none)]
pub fn childrenKeyPath(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setChildrenKeyPath:))]
#[unsafe(method_family = none)]
pub fn setChildrenKeyPath(&self, children_key_path: Option<&NSString>);
#[unsafe(method(countKeyPath))]
#[unsafe(method_family = none)]
pub fn countKeyPath(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setCountKeyPath:))]
#[unsafe(method_family = none)]
pub fn setCountKeyPath(&self, count_key_path: Option<&NSString>);
#[unsafe(method(leafKeyPath))]
#[unsafe(method_family = none)]
pub fn leafKeyPath(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setLeafKeyPath:))]
#[unsafe(method_family = none)]
pub fn setLeafKeyPath(&self, leaf_key_path: Option<&NSString>);
#[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(content))]
#[unsafe(method_family = none)]
pub fn content(&self) -> Option<Retained<AnyObject>>;
#[unsafe(method(setContent:))]
#[unsafe(method_family = none)]
pub unsafe fn setContent(&self, content: Option<&AnyObject>);
#[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(addChild:))]
#[unsafe(method_family = none)]
pub unsafe fn addChild(&self, sender: Option<&AnyObject>);
#[unsafe(method(insert:))]
#[unsafe(method_family = none)]
pub unsafe fn insert(&self, sender: Option<&AnyObject>);
#[unsafe(method(insertChild:))]
#[unsafe(method_family = none)]
pub unsafe fn insertChild(&self, sender: Option<&AnyObject>);
#[unsafe(method(canInsert))]
#[unsafe(method_family = none)]
pub fn canInsert(&self) -> bool;
#[unsafe(method(canInsertChild))]
#[unsafe(method_family = none)]
pub fn canInsertChild(&self) -> bool;
#[unsafe(method(canAddChild))]
#[unsafe(method_family = none)]
pub fn canAddChild(&self) -> bool;
#[unsafe(method(insertObject:atArrangedObjectIndexPath:))]
#[unsafe(method_family = none)]
pub unsafe fn insertObject_atArrangedObjectIndexPath(
&self,
object: Option<&AnyObject>,
index_path: &NSIndexPath,
);
#[unsafe(method(insertObjects:atArrangedObjectIndexPaths:))]
#[unsafe(method_family = none)]
pub unsafe fn insertObjects_atArrangedObjectIndexPaths(
&self,
objects: &NSArray,
index_paths: &NSArray<NSIndexPath>,
);
#[unsafe(method(removeObjectAtArrangedObjectIndexPath:))]
#[unsafe(method_family = none)]
pub fn removeObjectAtArrangedObjectIndexPath(&self, index_path: &NSIndexPath);
#[unsafe(method(removeObjectsAtArrangedObjectIndexPaths:))]
#[unsafe(method_family = none)]
pub fn removeObjectsAtArrangedObjectIndexPaths(&self, index_paths: &NSArray<NSIndexPath>);
#[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(selectedObjects))]
#[unsafe(method_family = none)]
pub fn selectedObjects(&self) -> Retained<NSArray>;
#[unsafe(method(setSelectionIndexPaths:))]
#[unsafe(method_family = none)]
pub fn setSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;
#[unsafe(method(selectionIndexPaths))]
#[unsafe(method_family = none)]
pub fn selectionIndexPaths(&self) -> Retained<NSArray<NSIndexPath>>;
#[unsafe(method(setSelectionIndexPath:))]
#[unsafe(method_family = none)]
pub fn setSelectionIndexPath(&self, index_path: Option<&NSIndexPath>) -> bool;
#[unsafe(method(selectionIndexPath))]
#[unsafe(method_family = none)]
pub fn selectionIndexPath(&self) -> Option<Retained<NSIndexPath>>;
#[unsafe(method(addSelectionIndexPaths:))]
#[unsafe(method_family = none)]
pub fn addSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;
#[unsafe(method(removeSelectionIndexPaths:))]
#[unsafe(method_family = none)]
pub fn removeSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;
#[cfg(feature = "NSTreeNode")]
#[unsafe(method(selectedNodes))]
#[unsafe(method_family = none)]
pub fn selectedNodes(&self) -> Retained<NSArray<NSTreeNode>>;
#[cfg(feature = "NSTreeNode")]
#[unsafe(method(moveNode:toIndexPath:))]
#[unsafe(method_family = none)]
pub fn moveNode_toIndexPath(&self, node: &NSTreeNode, index_path: &NSIndexPath);
#[cfg(feature = "NSTreeNode")]
#[unsafe(method(moveNodes:toIndexPath:))]
#[unsafe(method_family = none)]
pub fn moveNodes_toIndexPath(
&self,
nodes: &NSArray<NSTreeNode>,
starting_index_path: &NSIndexPath,
);
#[cfg(feature = "NSTreeNode")]
#[unsafe(method(childrenKeyPathForNode:))]
#[unsafe(method_family = none)]
pub fn childrenKeyPathForNode(&self, node: &NSTreeNode) -> Option<Retained<NSString>>;
#[cfg(feature = "NSTreeNode")]
#[unsafe(method(countKeyPathForNode:))]
#[unsafe(method_family = none)]
pub fn countKeyPathForNode(&self, node: &NSTreeNode) -> Option<Retained<NSString>>;
#[cfg(feature = "NSTreeNode")]
#[unsafe(method(leafKeyPathForNode:))]
#[unsafe(method_family = none)]
pub fn leafKeyPathForNode(&self, node: &NSTreeNode) -> Option<Retained<NSString>>;
);
}
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
impl NSTreeController {
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 NSTreeController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
impl NSTreeController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}