objc2_notification_center/generated/
NCWidgetListViewController.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/ncwidgetlistviewcontroller?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 NCWidgetListViewController;
21);
22
23#[cfg(feature = "objc2-app-kit")]
24#[cfg(target_os = "macos")]
25extern_conformance!(
26    unsafe impl NSCoding for NCWidgetListViewController {}
27);
28
29#[cfg(feature = "objc2-app-kit")]
30#[cfg(target_os = "macos")]
31extern_conformance!(
32    unsafe impl NSEditor for NCWidgetListViewController {}
33);
34
35#[cfg(feature = "objc2-app-kit")]
36#[cfg(target_os = "macos")]
37extern_conformance!(
38    unsafe impl NSObjectProtocol for NCWidgetListViewController {}
39);
40
41#[cfg(feature = "objc2-app-kit")]
42#[cfg(target_os = "macos")]
43extern_conformance!(
44    unsafe impl NSSeguePerforming for NCWidgetListViewController {}
45);
46
47#[cfg(feature = "objc2-app-kit")]
48#[cfg(target_os = "macos")]
49extern_conformance!(
50    unsafe impl NSUserInterfaceItemIdentification for NCWidgetListViewController {}
51);
52
53#[cfg(feature = "objc2-app-kit")]
54#[cfg(target_os = "macos")]
55impl NCWidgetListViewController {
56    extern_methods!(
57        #[unsafe(method(delegate))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn delegate(
60            &self,
61        ) -> Option<Retained<ProtocolObject<dyn NCWidgetListViewDelegate>>>;
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 NCWidgetListViewDelegate>>,
70        );
71
72        #[unsafe(method(contents))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn contents(&self) -> Retained<NSArray<AnyObject>>;
75
76        /// Setter for [`contents`][Self::contents].
77        #[unsafe(method(setContents:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setContents(&self, contents: &NSArray<AnyObject>);
80
81        #[unsafe(method(minimumVisibleRowCount))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn minimumVisibleRowCount(&self) -> NSUInteger;
84
85        /// Setter for [`minimumVisibleRowCount`][Self::minimumVisibleRowCount].
86        #[unsafe(method(setMinimumVisibleRowCount:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setMinimumVisibleRowCount(&self, minimum_visible_row_count: NSUInteger);
89
90        #[unsafe(method(hasDividerLines))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn hasDividerLines(&self) -> bool;
93
94        /// Setter for [`hasDividerLines`][Self::hasDividerLines].
95        #[unsafe(method(setHasDividerLines:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setHasDividerLines(&self, has_divider_lines: bool);
98
99        #[unsafe(method(editing))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn editing(&self) -> bool;
102
103        /// Setter for [`editing`][Self::editing].
104        #[unsafe(method(setEditing:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setEditing(&self, editing: bool);
107
108        #[unsafe(method(showsAddButtonWhenEditing))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn showsAddButtonWhenEditing(&self) -> bool;
111
112        /// Setter for [`showsAddButtonWhenEditing`][Self::showsAddButtonWhenEditing].
113        #[unsafe(method(setShowsAddButtonWhenEditing:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setShowsAddButtonWhenEditing(&self, shows_add_button_when_editing: bool);
116
117        #[unsafe(method(viewControllerAtRow:makeIfNecessary:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn viewControllerAtRow_makeIfNecessary(
120            &self,
121            row: NSUInteger,
122            make_if_necesary: bool,
123        ) -> Retained<NSViewController>;
124
125        #[unsafe(method(rowForViewController:))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn rowForViewController(&self, view_controller: &NSViewController)
128            -> NSUInteger;
129    );
130}
131
132/// Methods declared on superclass `NSViewController`.
133#[cfg(feature = "objc2-app-kit")]
134#[cfg(target_os = "macos")]
135impl NCWidgetListViewController {
136    extern_methods!(
137        #[unsafe(method(initWithNibName:bundle:))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn initWithNibName_bundle(
140            this: Allocated<Self>,
141            nib_name_or_nil: Option<&NSNibName>,
142            nib_bundle_or_nil: Option<&NSBundle>,
143        ) -> Retained<Self>;
144
145        #[unsafe(method(initWithCoder:))]
146        #[unsafe(method_family = init)]
147        pub unsafe fn initWithCoder(
148            this: Allocated<Self>,
149            coder: &NSCoder,
150        ) -> Option<Retained<Self>>;
151    );
152}
153
154/// Methods declared on superclass `NSResponder`.
155#[cfg(feature = "objc2-app-kit")]
156#[cfg(target_os = "macos")]
157impl NCWidgetListViewController {
158    extern_methods!(
159        #[unsafe(method(init))]
160        #[unsafe(method_family = init)]
161        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
162    );
163}
164
165/// Methods declared on superclass `NSObject`.
166#[cfg(feature = "objc2-app-kit")]
167#[cfg(target_os = "macos")]
168impl NCWidgetListViewController {
169    extern_methods!(
170        #[unsafe(method(new))]
171        #[unsafe(method_family = new)]
172        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
173    );
174}
175
176extern_protocol!(
177    /// [Apple's documentation](https://developer.apple.com/documentation/notificationcenter/ncwidgetlistviewdelegate?language=objc)
178    #[deprecated = "Use WidgetKit instead. Today View extensions have been deprecated."]
179    pub unsafe trait NCWidgetListViewDelegate: NSObjectProtocol {
180        #[cfg(feature = "objc2-app-kit")]
181        #[cfg(target_os = "macos")]
182        #[unsafe(method(widgetList:viewControllerForRow:))]
183        #[unsafe(method_family = none)]
184        unsafe fn widgetList_viewControllerForRow(
185            &self,
186            list: &NCWidgetListViewController,
187            row: NSUInteger,
188        ) -> Retained<NSViewController>;
189
190        #[cfg(feature = "objc2-app-kit")]
191        #[cfg(target_os = "macos")]
192        #[optional]
193        #[unsafe(method(widgetListPerformAddAction:))]
194        #[unsafe(method_family = none)]
195        unsafe fn widgetListPerformAddAction(&self, list: &NCWidgetListViewController);
196
197        #[cfg(feature = "objc2-app-kit")]
198        #[cfg(target_os = "macos")]
199        #[optional]
200        #[unsafe(method(widgetList:shouldReorderRow:))]
201        #[unsafe(method_family = none)]
202        unsafe fn widgetList_shouldReorderRow(
203            &self,
204            list: &NCWidgetListViewController,
205            row: NSUInteger,
206        ) -> bool;
207
208        #[cfg(feature = "objc2-app-kit")]
209        #[cfg(target_os = "macos")]
210        #[optional]
211        #[unsafe(method(widgetList:didReorderRow:toRow:))]
212        #[unsafe(method_family = none)]
213        unsafe fn widgetList_didReorderRow_toRow(
214            &self,
215            list: &NCWidgetListViewController,
216            row: NSUInteger,
217            new_index: NSUInteger,
218        );
219
220        #[cfg(feature = "objc2-app-kit")]
221        #[cfg(target_os = "macos")]
222        #[optional]
223        #[unsafe(method(widgetList:shouldRemoveRow:))]
224        #[unsafe(method_family = none)]
225        unsafe fn widgetList_shouldRemoveRow(
226            &self,
227            list: &NCWidgetListViewController,
228            row: NSUInteger,
229        ) -> bool;
230
231        #[cfg(feature = "objc2-app-kit")]
232        #[cfg(target_os = "macos")]
233        #[optional]
234        #[unsafe(method(widgetList:didRemoveRow:))]
235        #[unsafe(method_family = none)]
236        unsafe fn widgetList_didRemoveRow(
237            &self,
238            list: &NCWidgetListViewController,
239            row: NSUInteger,
240        );
241    }
242);