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
16extern_conformance!(
17 unsafe impl NSObjectProtocol for NSExtensionContext {}
18);
19
20impl NSExtensionContext {
21 extern_methods!(
22 #[cfg(feature = "NSArray")]
23 #[unsafe(method(inputItems))]
24 #[unsafe(method_family = none)]
25 pub fn inputItems(&self) -> Retained<NSArray>;
26
27 #[cfg(all(feature = "NSArray", feature = "block2"))]
28 #[unsafe(method(completeRequestReturningItems:completionHandler:))]
33 #[unsafe(method_family = none)]
34 pub unsafe fn completeRequestReturningItems_completionHandler(
35 &self,
36 items: Option<&NSArray>,
37 completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
38 );
39
40 #[cfg(feature = "NSError")]
41 #[unsafe(method(cancelRequestWithError:))]
42 #[unsafe(method_family = none)]
43 pub fn cancelRequestWithError(&self, error: &NSError);
44
45 #[cfg(all(feature = "NSURL", feature = "block2"))]
46 #[unsafe(method(openURL:completionHandler:))]
50 #[unsafe(method_family = none)]
51 pub unsafe fn openURL_completionHandler(
52 &self,
53 url: &NSURL,
54 completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
55 );
56 );
57}
58
59impl NSExtensionContext {
61 extern_methods!(
62 #[unsafe(method(init))]
63 #[unsafe(method_family = init)]
64 pub fn init(this: Allocated<Self>) -> Retained<Self>;
65
66 #[unsafe(method(new))]
67 #[unsafe(method_family = new)]
68 pub fn new() -> Retained<Self>;
69 );
70}
71
72impl DefaultRetained for NSExtensionContext {
73 #[inline]
74 fn default_retained() -> Retained<Self> {
75 Self::new()
76 }
77}
78
79extern "C" {
80 #[cfg(feature = "NSString")]
82 pub static NSExtensionItemsAndErrorsKey: Option<&'static NSString>;
83}
84
85extern "C" {
86 #[cfg(feature = "NSString")]
88 pub static NSExtensionHostWillEnterForegroundNotification: Option<&'static NSString>;
89}
90
91extern "C" {
92 #[cfg(feature = "NSString")]
94 pub static NSExtensionHostDidEnterBackgroundNotification: Option<&'static NSString>;
95}
96
97extern "C" {
98 #[cfg(feature = "NSString")]
100 pub static NSExtensionHostWillResignActiveNotification: Option<&'static NSString>;
101}
102
103extern "C" {
104 #[cfg(feature = "NSString")]
106 pub static NSExtensionHostDidBecomeActiveNotification: Option<&'static NSString>;
107}