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        /// Setter for [`delegate`][Self::delegate].
64        ///
65        /// This is a [weak property][objc2::topics::weak_property].
66        #[unsafe(method(setDelegate:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setDelegate(
69            &self,
70            delegate: Option<&ProtocolObject<dyn NCWidgetSearchViewDelegate>>,
71        );
72
73        #[unsafe(method(searchResults))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn searchResults(&self) -> Option<Retained<NSArray<AnyObject>>>;
76
77        /// Setter for [`searchResults`][Self::searchResults].
78        ///
79        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
80        ///
81        /// # Safety
82        ///
83        /// `search_results` generic should be of the correct type.
84        #[unsafe(method(setSearchResults:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setSearchResults(&self, search_results: Option<&NSArray<AnyObject>>);
87
88        #[unsafe(method(searchDescription))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn searchDescription(&self) -> Option<Retained<NSString>>;
91
92        /// Setter for [`searchDescription`][Self::searchDescription].
93        ///
94        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
95        #[unsafe(method(setSearchDescription:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setSearchDescription(&self, search_description: Option<&NSString>);
98
99        #[unsafe(method(searchResultsPlaceholderString))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn searchResultsPlaceholderString(&self) -> Option<Retained<NSString>>;
102
103        /// Setter for [`searchResultsPlaceholderString`][Self::searchResultsPlaceholderString].
104        ///
105        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
106        #[unsafe(method(setSearchResultsPlaceholderString:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn setSearchResultsPlaceholderString(
109            &self,
110            search_results_placeholder_string: Option<&NSString>,
111        );
112
113        #[unsafe(method(searchResultKeyPath))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn searchResultKeyPath(&self) -> Option<Retained<NSString>>;
116
117        /// Setter for [`searchResultKeyPath`][Self::searchResultKeyPath].
118        ///
119        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
120        #[unsafe(method(setSearchResultKeyPath:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn setSearchResultKeyPath(&self, search_result_key_path: Option<&NSString>);
123    );
124}
125
126/// Methods declared on superclass `NSViewController`.
127#[cfg(feature = "objc2-app-kit")]
128#[cfg(target_os = "macos")]
129impl NCWidgetSearchViewController {
130    extern_methods!(
131        #[unsafe(method(initWithNibName:bundle:))]
132        #[unsafe(method_family = init)]
133        pub unsafe fn initWithNibName_bundle(
134            this: Allocated<Self>,
135            nib_name_or_nil: Option<&NSNibName>,
136            nib_bundle_or_nil: Option<&NSBundle>,
137        ) -> Retained<Self>;
138
139        /// # Safety
140        ///
141        /// `coder` possibly has further requirements.
142        #[unsafe(method(initWithCoder:))]
143        #[unsafe(method_family = init)]
144        pub unsafe fn initWithCoder(
145            this: Allocated<Self>,
146            coder: &NSCoder,
147        ) -> Option<Retained<Self>>;
148    );
149}
150
151/// Methods declared on superclass `NSResponder`.
152#[cfg(feature = "objc2-app-kit")]
153#[cfg(target_os = "macos")]
154impl NCWidgetSearchViewController {
155    extern_methods!(
156        #[unsafe(method(init))]
157        #[unsafe(method_family = init)]
158        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
159    );
160}
161
162/// Methods declared on superclass `NSObject`.
163#[cfg(feature = "objc2-app-kit")]
164#[cfg(target_os = "macos")]
165impl NCWidgetSearchViewController {
166    extern_methods!(
167        #[unsafe(method(new))]
168        #[unsafe(method_family = new)]
169        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
170    );
171}
172
173extern_protocol!(
174    /// [Apple's documentation](https://developer.apple.com/documentation/notificationcenter/ncwidgetsearchviewdelegate?language=objc)
175    #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
176    pub unsafe trait NCWidgetSearchViewDelegate: NSObjectProtocol {
177        #[cfg(feature = "objc2-app-kit")]
178        #[cfg(target_os = "macos")]
179        #[unsafe(method(widgetSearch:searchForTerm:maxResults:))]
180        #[unsafe(method_family = none)]
181        unsafe fn widgetSearch_searchForTerm_maxResults(
182            &self,
183            controller: &NCWidgetSearchViewController,
184            search_term: &NSString,
185            max: NSUInteger,
186        );
187
188        #[cfg(feature = "objc2-app-kit")]
189        #[cfg(target_os = "macos")]
190        #[unsafe(method(widgetSearchTermCleared:))]
191        #[unsafe(method_family = none)]
192        unsafe fn widgetSearchTermCleared(&self, controller: &NCWidgetSearchViewController);
193
194        #[cfg(feature = "objc2-app-kit")]
195        #[cfg(target_os = "macos")]
196        /// # Safety
197        ///
198        /// `object` should be of the correct type.
199        #[unsafe(method(widgetSearch:resultSelected:))]
200        #[unsafe(method_family = none)]
201        unsafe fn widgetSearch_resultSelected(
202            &self,
203            controller: &NCWidgetSearchViewController,
204            object: &AnyObject,
205        );
206    }
207);