objc2_browser_engine_kit/generated/
BEWebContentProcess.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 web content 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 multiple web content process
16    /// per  host browser. Each time this type is initialized, a new extension process will be launched.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/bewebcontentprocess?language=objc)
19    #[unsafe(super(NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    pub struct BEWebContentProcess;
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for BEWebContentProcess {}
26);
27
28impl BEWebContentProcess {
29    extern_methods!(
30        #[unsafe(method(init))]
31        #[unsafe(method_family = init)]
32        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
33
34        #[unsafe(method(new))]
35        #[unsafe(method_family = new)]
36        pub unsafe fn new() -> Retained<Self>;
37
38        #[cfg(feature = "block2")]
39        /// Asynchronously launches a web content process
40        ///
41        /// This initializer launches a new web content extension process.
42        ///
43        /// - Parameters:
44        /// - `interruptionHandler` : A block that is called if the extension process terminates.
45        /// - `completion` : A block called with a new ``BEWebContentProcess`` when the extension process has
46        /// launched or with an error.
47        #[unsafe(method(webContentProcessWithInterruptionHandler:completion:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn webContentProcessWithInterruptionHandler_completion(
50            interruption_handler: &block2::DynBlock<dyn Fn()>,
51            completion: &block2::DynBlock<dyn Fn(*mut BEWebContentProcess, *mut NSError)>,
52        );
53
54        #[cfg(feature = "block2")]
55        /// Asynchronously launches a web content process
56        ///
57        /// This initializer launches a new web content extension process.
58        ///
59        /// - Parameters:
60        /// - `bundleID` : The bundle identifier of the WebContent process to launch.
61        /// - `interruptionHandler` : A block that is called if the extension process terminates.
62        /// - `completion` : A block called with a new ``BEWebContentProcess`` when the extension process has
63        /// launched or with an error.
64        #[unsafe(method(webContentProcessWithBundleID:interruptionHandler:completion:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn webContentProcessWithBundleID_interruptionHandler_completion(
67            bundle_id: &NSString,
68            interruption_handler: &block2::DynBlock<dyn Fn()>,
69            completion: &block2::DynBlock<dyn Fn(*mut BEWebContentProcess, *mut NSError)>,
70        );
71
72        /// Stops the extension process.
73        ///
74        /// When you call this method, you tell the system your app no longer needs this extension process.
75        /// If this is the last connection from the host process to the extension process, the system terminates
76        /// the extension process.
77        #[unsafe(method(invalidate))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn invalidate(&self);
80
81        /// attach the created interaction to a view to express that the content of that view is directly related to the working of this process.
82        /// therefore, if the view is considered visible by the system then this process must also be considered to be visible.
83        /// 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.
84        #[unsafe(method(createVisibilityPropagationInteraction))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn createVisibilityPropagationInteraction(
87            &self,
88            mtm: MainThreadMarker,
89        ) -> Retained<ProtocolObject<dyn UIInteraction>>;
90    );
91}