objc2_foundation/generated/
NSExtensionContext.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct NSExtensionContext;
14);
15
16unsafe impl NSObjectProtocol for NSExtensionContext {}
17
18impl NSExtensionContext {
19 extern_methods!(
20 #[cfg(feature = "NSArray")]
21 #[unsafe(method(inputItems))]
22 #[unsafe(method_family = none)]
23 pub unsafe fn inputItems(&self) -> Retained<NSArray>;
24
25 #[cfg(all(feature = "NSArray", feature = "block2"))]
26 #[unsafe(method(completeRequestReturningItems:completionHandler:))]
27 #[unsafe(method_family = none)]
28 pub unsafe fn completeRequestReturningItems_completionHandler(
29 &self,
30 items: Option<&NSArray>,
31 completion_handler: Option<&block2::Block<dyn Fn(Bool)>>,
32 );
33
34 #[cfg(feature = "NSError")]
35 #[unsafe(method(cancelRequestWithError:))]
36 #[unsafe(method_family = none)]
37 pub unsafe fn cancelRequestWithError(&self, error: &NSError);
38
39 #[cfg(all(feature = "NSURL", feature = "block2"))]
40 #[unsafe(method(openURL:completionHandler:))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn openURL_completionHandler(
43 &self,
44 url: &NSURL,
45 completion_handler: Option<&block2::Block<dyn Fn(Bool)>>,
46 );
47 );
48}
49
50impl NSExtensionContext {
52 extern_methods!(
53 #[unsafe(method(init))]
54 #[unsafe(method_family = init)]
55 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
56
57 #[unsafe(method(new))]
58 #[unsafe(method_family = new)]
59 pub unsafe fn new() -> Retained<Self>;
60 );
61}
62
63extern "C" {
64 #[cfg(feature = "NSString")]
66 pub static NSExtensionItemsAndErrorsKey: Option<&'static NSString>;
67}
68
69extern "C" {
70 #[cfg(feature = "NSString")]
72 pub static NSExtensionHostWillEnterForegroundNotification: Option<&'static NSString>;
73}
74
75extern "C" {
76 #[cfg(feature = "NSString")]
78 pub static NSExtensionHostDidEnterBackgroundNotification: Option<&'static NSString>;
79}
80
81extern "C" {
82 #[cfg(feature = "NSString")]
84 pub static NSExtensionHostWillResignActiveNotification: Option<&'static NSString>;
85}
86
87extern "C" {
88 #[cfg(feature = "NSString")]
90 pub static NSExtensionHostDidBecomeActiveNotification: Option<&'static NSString>;
91}