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