objc2_av_foundation/generated/AVCaptureDeskViewApplication.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-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13 /// Allows a client to programmatically present the Desk View application and be informed when it is done being launched.
14 ///
15 ///
16 /// Users can launch the Desk View application through the Video Effects button in Control Center when a Desk View capable Continuity Camera is running. Developers may use this interface as a shortcut to launch the Desk View application directly from their application.
17 ///
18 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturedeskviewapplication?language=objc)
19 #[unsafe(super(NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 pub struct AVCaptureDeskViewApplication;
22);
23
24extern_conformance!(
25 unsafe impl NSObjectProtocol for AVCaptureDeskViewApplication {}
26);
27
28impl AVCaptureDeskViewApplication {
29 extern_methods!(
30 #[cfg(feature = "block2")]
31 /// Presents the Desk View application to the user with no launch configuration.
32 ///
33 ///
34 /// Parameter `completionHandler`: A block to be called once the Desk View application has been completely launched (or brought to the foreground).
35 ///
36 ///
37 /// This method allows you to programmatically launch the Desk View application from your own application UI. If the Desk View application is already running, this method brings it to the front. If the Desk View application is minimized in the Dock, this method un-minimizes it and brings it to the front.
38 #[unsafe(method(presentWithCompletionHandler:))]
39 #[unsafe(method_family = none)]
40 pub unsafe fn presentWithCompletionHandler(
41 &self,
42 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
43 );
44
45 #[cfg(feature = "block2")]
46 /// Presents the Desk View application to the user.
47 ///
48 ///
49 /// Parameter `launchConfiguration`: Launch configuration governing how the Desk View application will be presented.
50 ///
51 ///
52 /// Parameter `completionHandler`: A block to be called once the Desk View application has been completely launched (or brought to the foreground). Optionally, this completionHandler may fire later, once the user has completed set up mode (see AVCaptureDeskViewApplicationLaunchConfiguration.requiresSetUpModeCompletion).
53 ///
54 ///
55 /// This method allows you to programmatically launch the Desk View application from your own application UI. If the Desk View application is already running, this method brings it to the front. If the Desk View application is minimized in the Dock, this method un-minimizes it and brings it to the front.
56 #[unsafe(method(presentWithLaunchConfiguration:completionHandler:))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn presentWithLaunchConfiguration_completionHandler(
59 &self,
60 launch_configuration: &AVCaptureDeskViewApplicationLaunchConfiguration,
61 completion_handler: Option<&block2::DynBlock<dyn Fn(*mut NSError)>>,
62 );
63 );
64}
65
66/// Methods declared on superclass `NSObject`.
67impl AVCaptureDeskViewApplication {
68 extern_methods!(
69 #[unsafe(method(init))]
70 #[unsafe(method_family = init)]
71 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72
73 #[unsafe(method(new))]
74 #[unsafe(method_family = new)]
75 pub unsafe fn new() -> Retained<Self>;
76 );
77}
78
79extern_class!(
80 /// An object for configuring how the Desk View application is presented.
81 ///
82 ///
83 /// Developers may use this interface to customize the presentation of the Desk View application upon launch.
84 ///
85 /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturedeskviewapplicationlaunchconfiguration?language=objc)
86 #[unsafe(super(NSObject))]
87 #[derive(Debug, PartialEq, Eq, Hash)]
88 pub struct AVCaptureDeskViewApplicationLaunchConfiguration;
89);
90
91extern_conformance!(
92 unsafe impl NSObjectProtocol for AVCaptureDeskViewApplicationLaunchConfiguration {}
93);
94
95impl AVCaptureDeskViewApplicationLaunchConfiguration {
96 extern_methods!(
97 #[cfg(feature = "objc2-core-foundation")]
98 /// Specifies the desired frame of the Desk View application's main window when launched.
99 ///
100 ///
101 /// Default value is CGRectZero. The app will use a default value in this case (the user's previously selected position). mainWindowFrame is specified in global screen coordinates. When launching the Desk View application from a Mac Catalyst app, window origin is top left. When launched from a native macOS app, window origin is bottom left.
102 #[unsafe(method(mainWindowFrame))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn mainWindowFrame(&self) -> CGRect;
105
106 #[cfg(feature = "objc2-core-foundation")]
107 /// Setter for [`mainWindowFrame`][Self::mainWindowFrame].
108 #[unsafe(method(setMainWindowFrame:))]
109 #[unsafe(method_family = none)]
110 pub unsafe fn setMainWindowFrame(&self, main_window_frame: CGRect);
111
112 /// Specifies whether presentWithLaunchConfiguration:completionHandler:'s completionHandler fires immediately after the application is launched, or only after the user has completed set up.
113 ///
114 ///
115 /// The Desk View application launches in set up mode, showing the full field of view of an Ultra Wide camera with a superimposed trapezoid indicating the desk region crop that will be shown once set up is complete. By default, your presentWithLaunchConfiguration:completionHandler:'s completionHandler fires after the Desk View application is launched and visible to the user. By setting this property to YES, your completionHandler only fires when the user has completed set up mode and transitioned to the cropped Desk View mode.
116 #[unsafe(method(requiresSetUpModeCompletion))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn requiresSetUpModeCompletion(&self) -> bool;
119
120 /// Setter for [`requiresSetUpModeCompletion`][Self::requiresSetUpModeCompletion].
121 #[unsafe(method(setRequiresSetUpModeCompletion:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setRequiresSetUpModeCompletion(&self, requires_set_up_mode_completion: bool);
124 );
125}
126
127/// Methods declared on superclass `NSObject`.
128impl AVCaptureDeskViewApplicationLaunchConfiguration {
129 extern_methods!(
130 #[unsafe(method(init))]
131 #[unsafe(method_family = init)]
132 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
133
134 #[unsafe(method(new))]
135 #[unsafe(method_family = new)]
136 pub unsafe fn new() -> Retained<Self>;
137 );
138}