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
78
79
80
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// `NSItemBadge` represents a badge that can be attached to an `NSToolbarItem`.
///
/// This badge provides a way to display small visual indicators, such as counts and text labels, within a toolbar item. Badges can be used to highlight important information,
/// such as unread notifications or status indicators.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/appkit/nsitembadge?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct NSItemBadge;
);
extern_conformance!(
unsafe impl NSObjectProtocol for NSItemBadge {}
);
impl NSItemBadge {
extern_methods!(
/// Creates a badge displaying a localized numerical count.
///
///
/// Parameter `count`: The integer value to localize and display in the badge.
///
/// Returns: A new NSItemBadge instance with the localized specified count.
#[unsafe(method(badgeWithCount:))]
#[unsafe(method_family = none)]
pub fn badgeWithCount(count: NSInteger) -> Retained<NSItemBadge>;
/// Creates a badge displaying a text.
///
///
/// Parameter `text`: The text to be displayed inside the badge.
///
/// Returns: A new `NSItemBadge` instance with the specified text.
#[unsafe(method(badgeWithText:))]
#[unsafe(method_family = none)]
pub fn badgeWithText(text: &NSString) -> Retained<NSItemBadge>;
/// Creates a badge styled as an indicator. In this context, an indicator is simply a badge without any text.
///
///
/// Returns: A new `NSItemBadge` instance styled as an indicator.
#[unsafe(method(indicatorBadge))]
#[unsafe(method_family = none)]
pub fn indicatorBadge() -> Retained<NSItemBadge>;
/// The text to be displayed within the badge.
#[unsafe(method(text))]
#[unsafe(method_family = none)]
pub fn text(&self) -> Retained<NSString>;
);
}
/// Methods declared on superclass `NSObject`.
impl NSItemBadge {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}
impl DefaultRetained for NSItemBadge {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}