objc2_browser_engine_kit/generated/
BERenderingProcess.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_foundation::*;
7use objc2_ui_kit::*;
8
9use crate::*;
10
11extern_class!(
12    /// An object that represents a running GPU extension process.
13    ///
14    /// The system guarantees that the extension process has launched by the time the initializer methods return.
15    /// If the extension process exits, the system calls ``interruptionHandler``. There can only be one extension process per
16    /// host browser. The first time this type is initialized, a  process will be launched. If a extension process is all ready
17    /// running, the returned object will represent the already running process.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/berenderingprocess?language=objc)
20    #[unsafe(super(NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    pub struct BERenderingProcess;
23);
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for BERenderingProcess {}
27);
28
29impl BERenderingProcess {
30    extern_methods!(
31        #[unsafe(method(init))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
34
35        #[unsafe(method(new))]
36        #[unsafe(method_family = new)]
37        pub unsafe fn new() -> Retained<Self>;
38
39        #[cfg(feature = "block2")]
40        /// Asynchronously finds an existing extension process or launches one.
41        ///
42        /// This initializer finds an existing extension rendering process. If it’s unable to find an
43        /// existing process, it launches a new extension process.
44        ///
45        /// - Parameters:
46        /// - `interruptionHandler` : A block that is called if the extension process terminates.
47        /// - `completion` : A block called with a new ``BERenderingProcess`` when the extension process has
48        /// launched or with an error.
49        #[unsafe(method(renderingProcessWithInterruptionHandler:completion:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn renderingProcessWithInterruptionHandler_completion(
52            interruption_handler: &block2::DynBlock<dyn Fn()>,
53            completion: &block2::DynBlock<dyn Fn(*mut BERenderingProcess, *mut NSError)>,
54        );
55
56        #[cfg(feature = "block2")]
57        /// Asynchronously launches a rendering extension process.
58        ///
59        /// This initializer launches a new rendering extension process with the provided bundle identifier.
60        ///
61        /// - Parameters:
62        /// - `bundleID` : The bundle identifier of the rendering extension process to launch.
63        /// - `interruptionHandler` : A block that is called if the extension process terminates.
64        /// - `completion` : A block called with a new ``BERenderingProcess`` when the extension process has
65        /// launched or with an error.
66        #[unsafe(method(renderingProcessWithBundleID:interruptionHandler:completion:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn renderingProcessWithBundleID_interruptionHandler_completion(
69            bundle_id: &NSString,
70            interruption_handler: &block2::DynBlock<dyn Fn()>,
71            completion: &block2::DynBlock<dyn Fn(*mut BERenderingProcess, *mut NSError)>,
72        );
73
74        /// Stops the extension process.
75        ///
76        /// When you call this method, you tell the system your app no longer needs this extension process.
77        /// If this is the last connection from the host process to the extension process, the system terminates
78        /// the extension process.
79        #[unsafe(method(invalidate))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn invalidate(&self);
82
83        /// attach the created interaction to a view to express that the content of that view is directly related to the working of this process.
84        /// therefore, if the view is considered visible by the system then this process must also be considered to be visible.
85        /// do not attempt to set an interaction on multiple views as interactions track their views - instead create a new interaction for each view that you want to propogate visibility to this process.
86        #[unsafe(method(createVisibilityPropagationInteraction))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn createVisibilityPropagationInteraction(
89            &self,
90            mtm: MainThreadMarker,
91        ) -> Retained<ProtocolObject<dyn UIInteraction>>;
92    );
93}