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
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 unsafe fn inputItems(&self) -> Retained<NSArray>;
26
27        #[cfg(all(feature = "NSArray", feature = "block2"))]
28        #[unsafe(method(completeRequestReturningItems:completionHandler:))]
29        #[unsafe(method_family = none)]
30        pub unsafe fn completeRequestReturningItems_completionHandler(
31            &self,
32            items: Option<&NSArray>,
33            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
34        );
35
36        #[cfg(feature = "NSError")]
37        #[unsafe(method(cancelRequestWithError:))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn cancelRequestWithError(&self, error: &NSError);
40
41        #[cfg(all(feature = "NSURL", feature = "block2"))]
42        #[unsafe(method(openURL:completionHandler:))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn openURL_completionHandler(
45            &self,
46            url: &NSURL,
47            completion_handler: Option<&block2::DynBlock<dyn Fn(Bool)>>,
48        );
49    );
50}
51
52/// Methods declared on superclass `NSObject`.
53impl NSExtensionContext {
54    extern_methods!(
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        #[unsafe(method(new))]
60        #[unsafe(method_family = new)]
61        pub unsafe fn new() -> Retained<Self>;
62    );
63}
64
65extern "C" {
66    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionitemsanderrorskey?language=objc)
67    #[cfg(feature = "NSString")]
68    pub static NSExtensionItemsAndErrorsKey: Option<&'static NSString>;
69}
70
71extern "C" {
72    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostwillenterforegroundnotification?language=objc)
73    #[cfg(feature = "NSString")]
74    pub static NSExtensionHostWillEnterForegroundNotification: Option<&'static NSString>;
75}
76
77extern "C" {
78    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostdidenterbackgroundnotification?language=objc)
79    #[cfg(feature = "NSString")]
80    pub static NSExtensionHostDidEnterBackgroundNotification: Option<&'static NSString>;
81}
82
83extern "C" {
84    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostwillresignactivenotification?language=objc)
85    #[cfg(feature = "NSString")]
86    pub static NSExtensionHostWillResignActiveNotification: Option<&'static NSString>;
87}
88
89extern "C" {
90    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsextensionhostdidbecomeactivenotification?language=objc)
91    #[cfg(feature = "NSString")]
92    pub static NSExtensionHostDidBecomeActiveNotification: Option<&'static NSString>;
93}