objc2_foundation/generated/
NSAppleEventManager.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7use objc2::__framework_prelude::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/foundation/__nsappleeventmanagersuspension?language=objc)
12#[repr(C)]
13#[derive(Debug)]
14pub struct __NSAppleEventManagerSuspension {
15    inner: [u8; 0],
16    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
17}
18
19unsafe impl RefEncode for __NSAppleEventManagerSuspension {
20    const ENCODING_REF: Encoding =
21        Encoding::Pointer(&Encoding::Struct("__NSAppleEventManagerSuspension", &[]));
22}
23
24/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsappleeventmanagersuspensionid?language=objc)
25pub type NSAppleEventManagerSuspensionID = *const __NSAppleEventManagerSuspension;
26
27extern "C" {
28    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsappleeventtimeoutdefault?language=objc)
29    pub static NSAppleEventTimeOutDefault: c_double;
30}
31
32extern "C" {
33    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsappleeventtimeoutnone?language=objc)
34    pub static NSAppleEventTimeOutNone: c_double;
35}
36
37extern "C" {
38    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsappleeventmanagerwillprocessfirsteventnotification?language=objc)
39    #[cfg(all(feature = "NSNotification", feature = "NSString"))]
40    pub static NSAppleEventManagerWillProcessFirstEventNotification: &'static NSNotificationName;
41}
42
43extern_class!(
44    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsappleeventmanager?language=objc)
45    #[unsafe(super(NSObject))]
46    #[derive(Debug, PartialEq, Eq, Hash)]
47    pub struct NSAppleEventManager;
48);
49
50unsafe impl NSObjectProtocol for NSAppleEventManager {}
51
52impl NSAppleEventManager {
53    extern_methods!(
54        #[unsafe(method(sharedAppleEventManager))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn sharedAppleEventManager() -> Retained<NSAppleEventManager>;
57
58        #[cfg(feature = "NSAppleEventDescriptor")]
59        #[unsafe(method(currentAppleEvent))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn currentAppleEvent(&self) -> Option<Retained<NSAppleEventDescriptor>>;
62
63        #[cfg(feature = "NSAppleEventDescriptor")]
64        #[unsafe(method(currentReplyAppleEvent))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn currentReplyAppleEvent(&self) -> Option<Retained<NSAppleEventDescriptor>>;
67
68        #[unsafe(method(suspendCurrentAppleEvent))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn suspendCurrentAppleEvent(&self) -> NSAppleEventManagerSuspensionID;
71
72        #[cfg(feature = "NSAppleEventDescriptor")]
73        #[unsafe(method(appleEventForSuspensionID:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn appleEventForSuspensionID(
76            &self,
77            suspension_id: NSAppleEventManagerSuspensionID,
78        ) -> Retained<NSAppleEventDescriptor>;
79
80        #[cfg(feature = "NSAppleEventDescriptor")]
81        #[unsafe(method(replyAppleEventForSuspensionID:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn replyAppleEventForSuspensionID(
84            &self,
85            suspension_id: NSAppleEventManagerSuspensionID,
86        ) -> Retained<NSAppleEventDescriptor>;
87
88        #[unsafe(method(setCurrentAppleEventAndReplyEventWithSuspensionID:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setCurrentAppleEventAndReplyEventWithSuspensionID(
91            &self,
92            suspension_id: NSAppleEventManagerSuspensionID,
93        );
94
95        #[unsafe(method(resumeWithSuspensionID:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn resumeWithSuspensionID(&self, suspension_id: NSAppleEventManagerSuspensionID);
98    );
99}
100
101/// Methods declared on superclass `NSObject`.
102impl NSAppleEventManager {
103    extern_methods!(
104        #[unsafe(method(init))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
107
108        #[unsafe(method(new))]
109        #[unsafe(method_family = new)]
110        pub unsafe fn new() -> Retained<Self>;
111    );
112}