1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

ns_enum!(
    #[underlying(NSUInteger)]
    pub enum NSPostingStyle {
        NSPostWhenIdle = 1,
        NSPostASAP = 2,
        NSPostNow = 3,
    }
);

ns_options!(
    #[underlying(NSUInteger)]
    pub enum NSNotificationCoalescing {
        NSNotificationNoCoalescing = 0,
        NSNotificationCoalescingOnName = 1,
        NSNotificationCoalescingOnSender = 2,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSNotificationQueue")]
    pub struct NSNotificationQueue;

    #[cfg(feature = "Foundation_NSNotificationQueue")]
    unsafe impl ClassType for NSNotificationQueue {
        type Super = NSObject;
    }
);

#[cfg(feature = "Foundation_NSNotificationQueue")]
unsafe impl NSObjectProtocol for NSNotificationQueue {}

extern_methods!(
    #[cfg(feature = "Foundation_NSNotificationQueue")]
    unsafe impl NSNotificationQueue {
        #[method_id(@__retain_semantics Other defaultQueue)]
        pub unsafe fn defaultQueue() -> Id<NSNotificationQueue, Shared>;

        #[cfg(feature = "Foundation_NSNotificationCenter")]
        #[method_id(@__retain_semantics Init initWithNotificationCenter:)]
        pub unsafe fn initWithNotificationCenter(
            this: Option<Allocated<Self>>,
            notification_center: &NSNotificationCenter,
        ) -> Id<Self, Shared>;

        #[cfg(feature = "Foundation_NSNotification")]
        #[method(enqueueNotification:postingStyle:)]
        pub unsafe fn enqueueNotification_postingStyle(
            &self,
            notification: &NSNotification,
            posting_style: NSPostingStyle,
        );

        #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSNotification"))]
        #[method(enqueueNotification:postingStyle:coalesceMask:forModes:)]
        pub unsafe fn enqueueNotification_postingStyle_coalesceMask_forModes(
            &self,
            notification: &NSNotification,
            posting_style: NSPostingStyle,
            coalesce_mask: NSNotificationCoalescing,
            modes: Option<&NSArray<NSRunLoopMode>>,
        );

        #[cfg(feature = "Foundation_NSNotification")]
        #[method(dequeueNotificationsMatching:coalesceMask:)]
        pub unsafe fn dequeueNotificationsMatching_coalesceMask(
            &self,
            notification: &NSNotification,
            coalesce_mask: NSUInteger,
        );
    }
);