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
51extern_conformance!(
52 unsafe impl NSCopying for NSMenuItemBadge {}
53);
54
55unsafe impl CopyingHelper for NSMenuItemBadge {
56 type Result = Self;
57}
58
59extern_conformance!(
60 unsafe impl NSObjectProtocol for NSMenuItemBadge {}
61);
62
63impl NSMenuItemBadge {
64 extern_methods!(
65 #[unsafe(method(updatesWithCount:))]
68 #[unsafe(method_family = none)]
69 pub unsafe fn updatesWithCount(item_count: NSInteger) -> Retained<Self>;
70
71 #[unsafe(method(newItemsWithCount:))]
74 #[unsafe(method_family = new)]
75 pub unsafe fn newItemsWithCount(item_count: NSInteger) -> Retained<Self>;
76
77 #[unsafe(method(alertsWithCount:))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn alertsWithCount(item_count: NSInteger) -> Retained<Self>;
82
83 #[unsafe(method(initWithCount:type:))]
85 #[unsafe(method_family = init)]
86 pub unsafe fn initWithCount_type(
87 this: Allocated<Self>,
88 item_count: NSInteger,
89 r#type: NSMenuItemBadgeType,
90 ) -> Retained<Self>;
91
92 #[unsafe(method(initWithCount:))]
94 #[unsafe(method_family = init)]
95 pub unsafe fn initWithCount(this: Allocated<Self>, item_count: NSInteger)
96 -> Retained<Self>;
97
98 #[unsafe(method(initWithString:))]
100 #[unsafe(method_family = init)]
101 pub unsafe fn initWithString(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
102
103 #[unsafe(method(init))]
104 #[unsafe(method_family = init)]
105 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107 #[unsafe(method(itemCount))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn itemCount(&self) -> NSInteger;
112
113 #[unsafe(method(type))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn r#type(&self) -> NSMenuItemBadgeType;
119
120 #[unsafe(method(stringValue))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
125 );
126}
127
128impl NSMenuItemBadge {
130 extern_methods!(
131 #[unsafe(method(new))]
132 #[unsafe(method_family = new)]
133 pub unsafe fn new() -> Retained<Self>;
134 );
135}