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
24unsafe impl NSObjectProtocol for AVCaptureDeskViewApplication {}
25
26impl AVCaptureDeskViewApplication {
27    extern_methods!(
28        #[cfg(feature = "block2")]
29        /// Presents the Desk View application to the user with no launch configuration.
30        ///
31        ///
32        /// Parameter `completionHandler`: A block to be called once the Desk View application has been completely launched (or brought to the foreground).
33        ///
34        ///
35        /// 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.
36        #[unsafe(method(presentWithCompletionHandler:))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn presentWithCompletionHandler(
39            &self,
40            completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
41        );
42
43        #[cfg(feature = "block2")]
44        /// Presents the Desk View application to the user.
45        ///
46        ///
47        /// Parameter `launchConfiguration`: Launch configuration governing how the Desk View application will be presented.
48        ///
49        ///
50        /// 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).
51        ///
52        ///
53        /// 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.
54        #[unsafe(method(presentWithLaunchConfiguration:completionHandler:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn presentWithLaunchConfiguration_completionHandler(
57            &self,
58            launch_configuration: &AVCaptureDeskViewApplicationLaunchConfiguration,
59            completion_handler: Option<&block2::Block<dyn Fn(*mut NSError)>>,
60        );
61    );
62}
63
64/// Methods declared on superclass `NSObject`.
65impl AVCaptureDeskViewApplication {
66    extern_methods!(
67        #[unsafe(method(init))]
68        #[unsafe(method_family = init)]
69        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
70
71        #[unsafe(method(new))]
72        #[unsafe(method_family = new)]
73        pub unsafe fn new() -> Retained<Self>;
74    );
75}
76
77extern_class!(
78    /// An object for configuring how the Desk View application is presented.
79    ///
80    ///
81    /// Developers may use this interface to customize the presentation of the Desk View application upon launch.
82    ///
83    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturedeskviewapplicationlaunchconfiguration?language=objc)
84    #[unsafe(super(NSObject))]
85    #[derive(Debug, PartialEq, Eq, Hash)]
86    pub struct AVCaptureDeskViewApplicationLaunchConfiguration;
87);
88
89unsafe impl NSObjectProtocol for AVCaptureDeskViewApplicationLaunchConfiguration {}
90
91impl AVCaptureDeskViewApplicationLaunchConfiguration {
92    extern_methods!(
93        #[cfg(feature = "objc2-core-foundation")]
94        /// Specifies the desired frame of the Desk View application's main window when launched.
95        ///
96        ///
97        /// 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.
98        #[unsafe(method(mainWindowFrame))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn mainWindowFrame(&self) -> CGRect;
101
102        #[cfg(feature = "objc2-core-foundation")]
103        /// Setter for [`mainWindowFrame`][Self::mainWindowFrame].
104        #[unsafe(method(setMainWindowFrame:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn setMainWindowFrame(&self, main_window_frame: CGRect);
107
108        /// Specifies whether presentWithLaunchConfiguration:completionHandler:'s completionHandler fires immediately after the application is launched, or only after the user has completed set up.
109        ///
110        ///
111        /// 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.
112        #[unsafe(method(requiresSetUpModeCompletion))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn requiresSetUpModeCompletion(&self) -> bool;
115
116        /// Setter for [`requiresSetUpModeCompletion`][Self::requiresSetUpModeCompletion].
117        #[unsafe(method(setRequiresSetUpModeCompletion:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn setRequiresSetUpModeCompletion(&self, requires_set_up_mode_completion: bool);
120    );
121}
122
123/// Methods declared on superclass `NSObject`.
124impl AVCaptureDeskViewApplicationLaunchConfiguration {
125    extern_methods!(
126        #[unsafe(method(init))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130        #[unsafe(method(new))]
131        #[unsafe(method_family = new)]
132        pub unsafe fn new() -> Retained<Self>;
133    );
134}