objc2_app_kit/generated/
NSMenuItemBadge.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9#[repr(transparent)]
16#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
17pub struct NSMenuItemBadgeType(pub NSInteger);
18impl NSMenuItemBadgeType {
19 #[doc(alias = "NSMenuItemBadgeTypeNone")]
21 pub const None: Self = Self(0);
22 #[doc(alias = "NSMenuItemBadgeTypeUpdates")]
24 pub const Updates: Self = Self(1);
25 #[doc(alias = "NSMenuItemBadgeTypeNewItems")]
27 pub const NewItems: Self = Self(2);
28 #[doc(alias = "NSMenuItemBadgeTypeAlerts")]
30 pub const Alerts: Self = Self(3);
31}
32
33unsafe impl Encode for NSMenuItemBadgeType {
34 const ENCODING: Encoding = NSInteger::ENCODING;
35}
36
37unsafe impl RefEncode for NSMenuItemBadgeType {
38 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
39}
40
41extern_class!(
42 #[unsafe(super(NSObject))]
47 #[derive(Debug, PartialEq, Eq, Hash)]
48 pub struct NSMenuItemBadge;
49);
50
51unsafe impl NSCopying for NSMenuItemBadge {}
52
53unsafe impl CopyingHelper for NSMenuItemBadge {
54 type Result = Self;
55}
56
57unsafe impl NSObjectProtocol for NSMenuItemBadge {}
58
59impl NSMenuItemBadge {
60 extern_methods!(
61 #[unsafe(method(updatesWithCount:))]
64 #[unsafe(method_family = none)]
65 pub unsafe fn updatesWithCount(item_count: NSInteger) -> Retained<Self>;
66
67 #[unsafe(method(newItemsWithCount:))]
70 #[unsafe(method_family = new)]
71 pub unsafe fn newItemsWithCount(item_count: NSInteger) -> Retained<Self>;
72
73 #[unsafe(method(alertsWithCount:))]
76 #[unsafe(method_family = none)]
77 pub unsafe fn alertsWithCount(item_count: NSInteger) -> Retained<Self>;
78
79 #[unsafe(method(initWithCount:type:))]
81 #[unsafe(method_family = init)]
82 pub unsafe fn initWithCount_type(
83 this: Allocated<Self>,
84 item_count: NSInteger,
85 r#type: NSMenuItemBadgeType,
86 ) -> Retained<Self>;
87
88 #[unsafe(method(initWithCount:))]
90 #[unsafe(method_family = init)]
91 pub unsafe fn initWithCount(this: Allocated<Self>, item_count: NSInteger)
92 -> Retained<Self>;
93
94 #[unsafe(method(initWithString:))]
96 #[unsafe(method_family = init)]
97 pub unsafe fn initWithString(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
98
99 #[unsafe(method(init))]
100 #[unsafe(method_family = init)]
101 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103 #[unsafe(method(itemCount))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn itemCount(&self) -> NSInteger;
108
109 #[unsafe(method(type))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn r#type(&self) -> NSMenuItemBadgeType;
115
116 #[unsafe(method(stringValue))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
121 );
122}
123
124impl NSMenuItemBadge {
126 extern_methods!(
127 #[unsafe(method(new))]
128 #[unsafe(method_family = new)]
129 pub unsafe fn new() -> Retained<Self>;
130 );
131}