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)]
pub struct NSNotificationQueue;
unsafe impl ClassType for NSNotificationQueue {
type Super = NSObject;
}
);
extern_methods!(
unsafe impl NSNotificationQueue {
#[method_id(@__retain_semantics Other defaultQueue)]
pub unsafe fn defaultQueue() -> Id<NSNotificationQueue, Shared>;
#[method_id(@__retain_semantics Init initWithNotificationCenter:)]
pub unsafe fn initWithNotificationCenter(
this: Option<Allocated<Self>>,
notificationCenter: &NSNotificationCenter,
) -> Id<Self, Shared>;
#[method(enqueueNotification:postingStyle:)]
pub unsafe fn enqueueNotification_postingStyle(
&self,
notification: &NSNotification,
postingStyle: NSPostingStyle,
);
#[method(enqueueNotification:postingStyle:coalesceMask:forModes:)]
pub unsafe fn enqueueNotification_postingStyle_coalesceMask_forModes(
&self,
notification: &NSNotification,
postingStyle: NSPostingStyle,
coalesceMask: NSNotificationCoalescing,
modes: Option<&NSArray<NSRunLoopMode>>,
);
#[method(dequeueNotificationsMatching:coalesceMask:)]
pub unsafe fn dequeueNotificationsMatching_coalesceMask(
&self,
notification: &NSNotification,
coalesceMask: NSUInteger,
);
}
);