objc2_foundation/generated/
NSExtensionContext.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensioncontext?language=objc)
11    #[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
50/// Methods declared on superclass `NSObject`.
51impl 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    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionitemsanderrorskey?language=objc)
65    #[cfg(feature = "NSString")]
66    pub static NSExtensionItemsAndErrorsKey: Option<&'static NSString>;
67}
68
69extern "C" {
70    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostwillenterforegroundnotification?language=objc)
71    #[cfg(feature = "NSString")]
72    pub static NSExtensionHostWillEnterForegroundNotification: Option<&'static NSString>;
73}
74
75extern "C" {
76    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostdidenterbackgroundnotification?language=objc)
77    #[cfg(feature = "NSString")]
78    pub static NSExtensionHostDidEnterBackgroundNotification: Option<&'static NSString>;
79}
80
81extern "C" {
82    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostwillresignactivenotification?language=objc)
83    #[cfg(feature = "NSString")]
84    pub static NSExtensionHostWillResignActiveNotification: Option<&'static NSString>;
85}
86
87extern "C" {
88    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostdidbecomeactivenotification?language=objc)
89    #[cfg(feature = "NSString")]
90    pub static NSExtensionHostDidBecomeActiveNotification: Option<&'static NSString>;
91}