use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
#[unsafe(super(NSViewController, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
pub struct NCWidgetListViewController;
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for NCWidgetListViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSEditor for NCWidgetListViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for NCWidgetListViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSeguePerforming for NCWidgetListViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NCWidgetListViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl NCWidgetListViewController {
extern_methods!(
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NCWidgetListViewDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NCWidgetListViewDelegate>>,
);
#[unsafe(method(contents))]
#[unsafe(method_family = none)]
pub unsafe fn contents(&self) -> Retained<NSArray<AnyObject>>;
#[unsafe(method(setContents:))]
#[unsafe(method_family = none)]
pub unsafe fn setContents(&self, contents: &NSArray<AnyObject>);
#[unsafe(method(minimumVisibleRowCount))]
#[unsafe(method_family = none)]
pub unsafe fn minimumVisibleRowCount(&self) -> NSUInteger;
#[unsafe(method(setMinimumVisibleRowCount:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinimumVisibleRowCount(&self, minimum_visible_row_count: NSUInteger);
#[unsafe(method(hasDividerLines))]
#[unsafe(method_family = none)]
pub unsafe fn hasDividerLines(&self) -> bool;
#[unsafe(method(setHasDividerLines:))]
#[unsafe(method_family = none)]
pub unsafe fn setHasDividerLines(&self, has_divider_lines: bool);
#[unsafe(method(editing))]
#[unsafe(method_family = none)]
pub unsafe fn editing(&self) -> bool;
#[unsafe(method(setEditing:))]
#[unsafe(method_family = none)]
pub unsafe fn setEditing(&self, editing: bool);
#[unsafe(method(showsAddButtonWhenEditing))]
#[unsafe(method_family = none)]
pub unsafe fn showsAddButtonWhenEditing(&self) -> bool;
#[unsafe(method(setShowsAddButtonWhenEditing:))]
#[unsafe(method_family = none)]
pub unsafe fn setShowsAddButtonWhenEditing(&self, shows_add_button_when_editing: bool);
#[unsafe(method(viewControllerAtRow:makeIfNecessary:))]
#[unsafe(method_family = none)]
pub unsafe fn viewControllerAtRow_makeIfNecessary(
&self,
row: NSUInteger,
make_if_necesary: bool,
) -> Retained<NSViewController>;
#[unsafe(method(rowForViewController:))]
#[unsafe(method_family = none)]
pub unsafe fn rowForViewController(&self, view_controller: &NSViewController)
-> NSUInteger;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl NCWidgetListViewController {
extern_methods!(
#[unsafe(method(initWithNibName:bundle:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNibName_bundle(
this: Allocated<Self>,
nib_name_or_nil: Option<&NSNibName>,
nib_bundle_or_nil: Option<&NSBundle>,
) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl NCWidgetListViewController {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl NCWidgetListViewController {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
#[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
pub unsafe trait NCWidgetListViewDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(widgetList:viewControllerForRow:))]
#[unsafe(method_family = none)]
unsafe fn widgetList_viewControllerForRow(
&self,
list: &NCWidgetListViewController,
row: NSUInteger,
) -> Retained<NSViewController>;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(widgetListPerformAddAction:))]
#[unsafe(method_family = none)]
unsafe fn widgetListPerformAddAction(&self, list: &NCWidgetListViewController);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(widgetList:shouldReorderRow:))]
#[unsafe(method_family = none)]
unsafe fn widgetList_shouldReorderRow(
&self,
list: &NCWidgetListViewController,
row: NSUInteger,
) -> bool;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(widgetList:didReorderRow:toRow:))]
#[unsafe(method_family = none)]
unsafe fn widgetList_didReorderRow_toRow(
&self,
list: &NCWidgetListViewController,
row: NSUInteger,
new_index: NSUInteger,
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(widgetList:shouldRemoveRow:))]
#[unsafe(method_family = none)]
unsafe fn widgetList_shouldRemoveRow(
&self,
list: &NCWidgetListViewController,
row: NSUInteger,
) -> bool;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[optional]
#[unsafe(method(widgetList:didRemoveRow:))]
#[unsafe(method_family = none)]
unsafe fn widgetList_didRemoveRow(
&self,
list: &NCWidgetListViewController,
row: NSUInteger,
);
}
);