objc2_notification_center/generated/
NCWidgetSearchViewController.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/notificationcenter/ncwidgetsearchviewcontroller?language=objc)
15    #[unsafe(super(NSViewController, NSResponder, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "objc2-app-kit")]
18    #[cfg(target_os = "macos")]
19    #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
20    pub struct NCWidgetSearchViewController;
21);
22
23#[cfg(feature = "objc2-app-kit")]
24#[cfg(target_os = "macos")]
25extern_conformance!(
26    unsafe impl NSCoding for NCWidgetSearchViewController {}
27);
28
29#[cfg(feature = "objc2-app-kit")]
30#[cfg(target_os = "macos")]
31extern_conformance!(
32    unsafe impl NSEditor for NCWidgetSearchViewController {}
33);
34
35#[cfg(feature = "objc2-app-kit")]
36#[cfg(target_os = "macos")]
37extern_conformance!(
38    unsafe impl NSObjectProtocol for NCWidgetSearchViewController {}
39);
40
41#[cfg(feature = "objc2-app-kit")]
42#[cfg(target_os = "macos")]
43extern_conformance!(
44    unsafe impl NSSeguePerforming for NCWidgetSearchViewController {}
45);
46
47#[cfg(feature = "objc2-app-kit")]
48#[cfg(target_os = "macos")]
49extern_conformance!(
50    unsafe impl NSUserInterfaceItemIdentification for NCWidgetSearchViewController {}
51);
52
53#[cfg(feature = "objc2-app-kit")]
54#[cfg(target_os = "macos")]
55impl NCWidgetSearchViewController {
56    extern_methods!(
57        #[unsafe(method(delegate))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn delegate(
60            &self,
61        ) -> Option<Retained<ProtocolObject<dyn NCWidgetSearchViewDelegate>>>;
62
63        /// This is a [weak property][objc2::topics::weak_property].
64        /// Setter for [`delegate`][Self::delegate].
65        #[unsafe(method(setDelegate:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setDelegate(
68            &self,
69            delegate: Option<&ProtocolObject<dyn NCWidgetSearchViewDelegate>>,
70        );
71
72        #[unsafe(method(searchResults))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn searchResults(&self) -> Option<Retained<NSArray<AnyObject>>>;
75
76        /// Setter for [`searchResults`][Self::searchResults].
77        #[unsafe(method(setSearchResults:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setSearchResults(&self, search_results: Option<&NSArray<AnyObject>>);
80
81        #[unsafe(method(searchDescription))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn searchDescription(&self) -> Option<Retained<NSString>>;
84
85        /// Setter for [`searchDescription`][Self::searchDescription].
86        #[unsafe(method(setSearchDescription:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setSearchDescription(&self, search_description: Option<&NSString>);
89
90        #[unsafe(method(searchResultsPlaceholderString))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn searchResultsPlaceholderString(&self) -> Option<Retained<NSString>>;
93
94        /// Setter for [`searchResultsPlaceholderString`][Self::searchResultsPlaceholderString].
95        #[unsafe(method(setSearchResultsPlaceholderString:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setSearchResultsPlaceholderString(
98            &self,
99            search_results_placeholder_string: Option<&NSString>,
100        );
101
102        #[unsafe(method(searchResultKeyPath))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn searchResultKeyPath(&self) -> Option<Retained<NSString>>;
105
106        /// Setter for [`searchResultKeyPath`][Self::searchResultKeyPath].
107        #[unsafe(method(setSearchResultKeyPath:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn setSearchResultKeyPath(&self, search_result_key_path: Option<&NSString>);
110    );
111}
112
113/// Methods declared on superclass `NSViewController`.
114#[cfg(feature = "objc2-app-kit")]
115#[cfg(target_os = "macos")]
116impl NCWidgetSearchViewController {
117    extern_methods!(
118        #[unsafe(method(initWithNibName:bundle:))]
119        #[unsafe(method_family = init)]
120        pub unsafe fn initWithNibName_bundle(
121            this: Allocated<Self>,
122            nib_name_or_nil: Option<&NSNibName>,
123            nib_bundle_or_nil: Option<&NSBundle>,
124        ) -> Retained<Self>;
125
126        #[unsafe(method(initWithCoder:))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn initWithCoder(
129            this: Allocated<Self>,
130            coder: &NSCoder,
131        ) -> Option<Retained<Self>>;
132    );
133}
134
135/// Methods declared on superclass `NSResponder`.
136#[cfg(feature = "objc2-app-kit")]
137#[cfg(target_os = "macos")]
138impl NCWidgetSearchViewController {
139    extern_methods!(
140        #[unsafe(method(init))]
141        #[unsafe(method_family = init)]
142        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
143    );
144}
145
146/// Methods declared on superclass `NSObject`.
147#[cfg(feature = "objc2-app-kit")]
148#[cfg(target_os = "macos")]
149impl NCWidgetSearchViewController {
150    extern_methods!(
151        #[unsafe(method(new))]
152        #[unsafe(method_family = new)]
153        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
154    );
155}
156
157extern_protocol!(
158    /// [Apple's documentation](https://developer.apple.com/documentation/notificationcenter/ncwidgetsearchviewdelegate?language=objc)
159    #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
160    pub unsafe trait NCWidgetSearchViewDelegate: NSObjectProtocol {
161        #[cfg(feature = "objc2-app-kit")]
162        #[cfg(target_os = "macos")]
163        #[unsafe(method(widgetSearch:searchForTerm:maxResults:))]
164        #[unsafe(method_family = none)]
165        unsafe fn widgetSearch_searchForTerm_maxResults(
166            &self,
167            controller: &NCWidgetSearchViewController,
168            search_term: &NSString,
169            max: NSUInteger,
170        );
171
172        #[cfg(feature = "objc2-app-kit")]
173        #[cfg(target_os = "macos")]
174        #[unsafe(method(widgetSearchTermCleared:))]
175        #[unsafe(method_family = none)]
176        unsafe fn widgetSearchTermCleared(&self, controller: &NCWidgetSearchViewController);
177
178        #[cfg(feature = "objc2-app-kit")]
179        #[cfg(target_os = "macos")]
180        #[unsafe(method(widgetSearch:resultSelected:))]
181        #[unsafe(method_family = none)]
182        unsafe fn widgetSearch_resultSelected(
183            &self,
184            controller: &NCWidgetSearchViewController,
185            object: &AnyObject,
186        );
187    }
188);