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 fn updatesWithCount(item_count: NSInteger) -> Retained<Self>;
70
71 #[unsafe(method(newItemsWithCount:))]
74 #[unsafe(method_family = new)]
75 pub fn newItemsWithCount(item_count: NSInteger) -> Retained<Self>;
76
77 #[unsafe(method(alertsWithCount:))]
80 #[unsafe(method_family = none)]
81 pub fn alertsWithCount(item_count: NSInteger) -> Retained<Self>;
82
83 #[unsafe(method(initWithCount:type:))]
85 #[unsafe(method_family = init)]
86 pub 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 fn initWithCount(this: Allocated<Self>, item_count: NSInteger) -> Retained<Self>;
96
97 #[unsafe(method(initWithString:))]
99 #[unsafe(method_family = init)]
100 pub fn initWithString(this: Allocated<Self>, string: &NSString) -> Retained<Self>;
101
102 #[unsafe(method(init))]
103 #[unsafe(method_family = init)]
104 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
105
106 #[unsafe(method(itemCount))]
109 #[unsafe(method_family = none)]
110 pub fn itemCount(&self) -> NSInteger;
111
112 #[unsafe(method(type))]
116 #[unsafe(method_family = none)]
117 pub fn r#type(&self) -> NSMenuItemBadgeType;
118
119 #[unsafe(method(stringValue))]
122 #[unsafe(method_family = none)]
123 pub fn stringValue(&self) -> Option<Retained<NSString>>;
124 );
125}
126
127impl NSMenuItemBadge {
129 extern_methods!(
130 #[unsafe(method(new))]
131 #[unsafe(method_family = new)]
132 pub unsafe fn new() -> Retained<Self>;
133 );
134}