objc2_quartz/generated/ImageKit/IKPictureTaker.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::*;
6use objc2_app_kit::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_class!(
12 /// An IKPictureTaker object is a panel that allows users to choose and crop an image. It supports browsing of the file system and includes a recents popup-menu. The IKPictureTaker lets the user to crop a choosen image or to take snapshot from a camera like the built-in iSight.
13 ///
14 /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetaker?language=objc)
15 #[unsafe(super(NSPanel, NSWindow, NSResponder, NSObject))]
16 #[derive(Debug, PartialEq, Eq, Hash)]
17 pub struct IKPictureTaker;
18);
19
20extern_conformance!(
21 unsafe impl NSAccessibility for IKPictureTaker {}
22);
23
24extern_conformance!(
25 unsafe impl NSAccessibilityElementProtocol for IKPictureTaker {}
26);
27
28extern_conformance!(
29 unsafe impl NSAnimatablePropertyContainer for IKPictureTaker {}
30);
31
32extern_conformance!(
33 unsafe impl NSAppearanceCustomization for IKPictureTaker {}
34);
35
36extern_conformance!(
37 unsafe impl NSCoding for IKPictureTaker {}
38);
39
40extern_conformance!(
41 unsafe impl NSMenuItemValidation for IKPictureTaker {}
42);
43
44extern_conformance!(
45 unsafe impl NSObjectProtocol for IKPictureTaker {}
46);
47
48extern_conformance!(
49 unsafe impl NSUserInterfaceItemIdentification for IKPictureTaker {}
50);
51
52extern_conformance!(
53 unsafe impl NSUserInterfaceValidations for IKPictureTaker {}
54);
55
56impl IKPictureTaker {
57 extern_methods!(
58 /// Returns the shared IKPictureTaker instance, creating it if necessary.
59 #[unsafe(method(pictureTaker))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn pictureTaker(mtm: MainThreadMarker) -> Option<Retained<IKPictureTaker>>;
62
63 /// Launches a modal PictureTaker session.
64 ///
65 /// Returns: Returns NSOKButton if the user edits or chooses an image and confirm panel, NSCancelButton if the user canceled or didn't change the image.
66 #[unsafe(method(runModal))]
67 #[unsafe(method_family = none)]
68 pub unsafe fn runModal(&self) -> NSInteger;
69
70 /// Launch the PictureTaker.
71 ///
72 /// Parameter `delegate`: the object to invoke didEndSelector when the PictureTaker terminates.
73 ///
74 /// Parameter `didEndSelector`: the selector to invoke when the PictureTaker terminates.
75 ///
76 /// Parameter `contextInfo`: Any data that will be passed as an argument to the delegate through didEndSelector after the session has ended.
77 ///
78 /// didEndSelector should have the following signature: - (void)pictureTakerDidEnd:(IKPictureTaker *)pictureTaker returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
79 /// returnCode value is set to NSOKButton if the user validate, or to NSCancelButton if the user cancel.
80 #[unsafe(method(beginPictureTakerWithDelegate:didEndSelector:contextInfo:))]
81 #[unsafe(method_family = none)]
82 pub unsafe fn beginPictureTakerWithDelegate_didEndSelector_contextInfo(
83 &self,
84 delegate: Option<&AnyObject>,
85 did_end_selector: Option<Sel>,
86 context_info: *mut c_void,
87 );
88
89 /// Launch the PictureTaker as a sheet for aWindow
90 ///
91 /// Parameter `delegate`: the object to invoke didEndSelector when the PictureTaker terminates
92 ///
93 /// Parameter `didEndSelector`: the selector to invoke when the PictureTaker terminates
94 ///
95 /// Parameter `contextInfo`: Any data that will be passed as an argument to the delegate through didEndSelector after the session has ended
96 ///
97 /// didEndSelector should have the following signature: - (void)pictureTakerDidEnd:(IKPictureTaker *)pictureTaker returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
98 /// returnCode value is set to NSOKButton if the user validate, or to NSCancelButton if the user cancel.
99 #[unsafe(method(beginPictureTakerSheetForWindow:withDelegate:didEndSelector:contextInfo:))]
100 #[unsafe(method_family = none)]
101 pub unsafe fn beginPictureTakerSheetForWindow_withDelegate_didEndSelector_contextInfo(
102 &self,
103 a_window: Option<&NSWindow>,
104 delegate: Option<&AnyObject>,
105 did_end_selector: Option<Sel>,
106 context_info: *mut c_void,
107 );
108
109 /// Launch the PictureTaker's recent popup.
110 ///
111 /// Parameter `delegate`: the object to invoke didEndSelector when the PictureTaker terminates.
112 ///
113 /// Parameter `didEndSelector`: the selector to invoke when the PictureTaker terminates.
114 ///
115 /// Parameter `contextInfo`: Any data that will be passed as an argument to the delegate through didEndSelector after the session has ended.
116 ///
117 /// didEndSelector should have the following signature: - (void)pictureTakerDidEnd:(IKPictureTaker *)pictureTaker returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
118 /// returnCode value is set to NSOKButton if the user validate, or to NSCancelButton if the user cancel.
119 #[unsafe(method(popUpRecentsMenuForView:withDelegate:didEndSelector:contextInfo:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn popUpRecentsMenuForView_withDelegate_didEndSelector_contextInfo(
122 &self,
123 a_view: Option<&NSView>,
124 delegate: Option<&AnyObject>,
125 did_end_selector: Option<Sel>,
126 context_info: *mut c_void,
127 );
128
129 /// Set the image input for the PictureTaker.
130 ///
131 /// Parameter `image`: A valid NSImage.
132 ///
133 /// The input image is never modified by the PictureTaker.
134 #[unsafe(method(setInputImage:))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn setInputImage(&self, image: Option<&NSImage>);
137
138 /// return the original PictureTaker's input-image.
139 ///
140 /// The input image is never modified by the PictureTaker.
141 #[unsafe(method(inputImage))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn inputImage(&self) -> Option<Retained<NSImage>>;
144
145 /// return the edited image.
146 #[unsafe(method(outputImage))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn outputImage(&self) -> Option<Retained<NSImage>>;
149
150 /// Controls whether the receiver enable/disable video mirroring durring snapshots (default is YES).
151 #[unsafe(method(setMirroring:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn setMirroring(&self, b: bool);
154
155 /// Returns YES if video mirroring is enabled, NO otherwise.
156 #[unsafe(method(mirroring))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn mirroring(&self) -> bool;
159 );
160}
161
162/// Methods declared on superclass `NSWindow`.
163impl IKPictureTaker {
164 extern_methods!(
165 #[unsafe(method(initWithContentRect:styleMask:backing:defer:))]
166 #[unsafe(method_family = init)]
167 pub unsafe fn initWithContentRect_styleMask_backing_defer(
168 this: Allocated<Self>,
169 content_rect: NSRect,
170 style: NSWindowStyleMask,
171 backing_store_type: NSBackingStoreType,
172 flag: bool,
173 ) -> Retained<Self>;
174
175 #[unsafe(method(initWithContentRect:styleMask:backing:defer:screen:))]
176 #[unsafe(method_family = init)]
177 pub unsafe fn initWithContentRect_styleMask_backing_defer_screen(
178 this: Allocated<Self>,
179 content_rect: NSRect,
180 style: NSWindowStyleMask,
181 backing_store_type: NSBackingStoreType,
182 flag: bool,
183 screen: Option<&NSScreen>,
184 ) -> Retained<Self>;
185
186 #[unsafe(method(initWithCoder:))]
187 #[unsafe(method_family = init)]
188 pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
189
190 /// Convenience method for creating an autoreleased titled window with the given contentViewController. A basic NSWindow with the following attributes is made: titled, closable, resizable, miniaturizable. The window's title is automatically bound to the contentViewController's title. The size of the window can easily be controlled by utilizing autolayout and applying size constraints to the view (or its subviews). The window has isReleasedWhenClosed set to NO, and it must be explicitly retained to keep the window instance alive. To have it automatically be freed when it is closed, do the following: [window retain] and [window setReleasedWhenClosed:YES].
191 #[unsafe(method(windowWithContentViewController:))]
192 #[unsafe(method_family = none)]
193 pub unsafe fn windowWithContentViewController(
194 content_view_controller: &NSViewController,
195 ) -> Retained<Self>;
196 );
197}
198
199/// Methods declared on superclass `NSResponder`.
200impl IKPictureTaker {
201 extern_methods!(
202 #[unsafe(method(init))]
203 #[unsafe(method_family = init)]
204 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
205 );
206}
207
208/// Methods declared on superclass `NSObject`.
209impl IKPictureTaker {
210 extern_methods!(
211 #[unsafe(method(new))]
212 #[unsafe(method_family = new)]
213 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
214 );
215}
216
217extern "C" {
218 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerallowsvideocapturekey?language=objc)
219 pub static IKPictureTakerAllowsVideoCaptureKey: Option<&'static NSString>;
220}
221
222extern "C" {
223 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerallowsfilechoosingkey?language=objc)
224 pub static IKPictureTakerAllowsFileChoosingKey: Option<&'static NSString>;
225}
226
227extern "C" {
228 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershowrecentpicturekey?language=objc)
229 pub static IKPictureTakerShowRecentPictureKey: Option<&'static NSString>;
230}
231
232extern "C" {
233 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerupdaterecentpicturekey?language=objc)
234 pub static IKPictureTakerUpdateRecentPictureKey: Option<&'static NSString>;
235}
236
237extern "C" {
238 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerallowseditingkey?language=objc)
239 pub static IKPictureTakerAllowsEditingKey: Option<&'static NSString>;
240}
241
242extern "C" {
243 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershoweffectskey?language=objc)
244 pub static IKPictureTakerShowEffectsKey: Option<&'static NSString>;
245}
246
247extern "C" {
248 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerinformationaltextkey?language=objc)
249 pub static IKPictureTakerInformationalTextKey: Option<&'static NSString>;
250}
251
252extern "C" {
253 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerimagetransformskey?language=objc)
254 pub static IKPictureTakerImageTransformsKey: Option<&'static NSString>;
255}
256
257extern "C" {
258 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakeroutputimagemaxsizekey?language=objc)
259 pub static IKPictureTakerOutputImageMaxSizeKey: Option<&'static NSString>;
260}
261
262extern "C" {
263 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershowaddressbookpicturekey?language=objc)
264 pub static IKPictureTakerShowAddressBookPictureKey: Option<&'static NSString>;
265}
266
267extern "C" {
268 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakershowemptypicturekey?language=objc)
269 pub static IKPictureTakerShowEmptyPictureKey: Option<&'static NSString>;
270}
271
272extern "C" {
273 /// [Apple's documentation](https://developer.apple.com/documentation/quartz/ikpicturetakerremainopenaftervalidatekey?language=objc)
274 pub static IKPictureTakerRemainOpenAfterValidateKey: Option<&'static NSString>;
275}