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 NCWidgetSearchViewController;
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSCoding for NCWidgetSearchViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSEditor for NCWidgetSearchViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSObjectProtocol for NCWidgetSearchViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSSeguePerforming for NCWidgetSearchViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NCWidgetSearchViewController {}
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl NCWidgetSearchViewController {
extern_methods!(
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub unsafe fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn NCWidgetSearchViewDelegate>>>;
#[unsafe(method(setDelegate:))]
#[unsafe(method_family = none)]
pub unsafe fn setDelegate(
&self,
delegate: Option<&ProtocolObject<dyn NCWidgetSearchViewDelegate>>,
);
#[unsafe(method(searchResults))]
#[unsafe(method_family = none)]
pub unsafe fn searchResults(&self) -> Option<Retained<NSArray<AnyObject>>>;
#[unsafe(method(setSearchResults:))]
#[unsafe(method_family = none)]
pub unsafe fn setSearchResults(&self, search_results: Option<&NSArray<AnyObject>>);
#[unsafe(method(searchDescription))]
#[unsafe(method_family = none)]
pub unsafe fn searchDescription(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setSearchDescription:))]
#[unsafe(method_family = none)]
pub unsafe fn setSearchDescription(&self, search_description: Option<&NSString>);
#[unsafe(method(searchResultsPlaceholderString))]
#[unsafe(method_family = none)]
pub unsafe fn searchResultsPlaceholderString(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setSearchResultsPlaceholderString:))]
#[unsafe(method_family = none)]
pub unsafe fn setSearchResultsPlaceholderString(
&self,
search_results_placeholder_string: Option<&NSString>,
);
#[unsafe(method(searchResultKeyPath))]
#[unsafe(method_family = none)]
pub unsafe fn searchResultKeyPath(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setSearchResultKeyPath:))]
#[unsafe(method_family = none)]
pub unsafe fn setSearchResultKeyPath(&self, search_result_key_path: Option<&NSString>);
);
}
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
impl NCWidgetSearchViewController {
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 NCWidgetSearchViewController {
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 NCWidgetSearchViewController {
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 NCWidgetSearchViewDelegate: NSObjectProtocol {
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(widgetSearch:searchForTerm:maxResults:))]
#[unsafe(method_family = none)]
unsafe fn widgetSearch_searchForTerm_maxResults(
&self,
controller: &NCWidgetSearchViewController,
search_term: &NSString,
max: NSUInteger,
);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(widgetSearchTermCleared:))]
#[unsafe(method_family = none)]
unsafe fn widgetSearchTermCleared(&self, controller: &NCWidgetSearchViewController);
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
#[unsafe(method(widgetSearch:resultSelected:))]
#[unsafe(method_family = none)]
unsafe fn widgetSearch_resultSelected(
&self,
controller: &NCWidgetSearchViewController,
object: &AnyObject,
);
}
);