objc2_class_kit/generated/
CLSProgressReportingCapability.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/classkit/clsprogressreportingcapabilitykind?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct CLSProgressReportingCapabilityKind(pub NSInteger);
14impl CLSProgressReportingCapabilityKind {
15    #[doc(alias = "CLSProgressReportingCapabilityKindDuration")]
16    pub const Duration: Self = Self(0);
17    #[doc(alias = "CLSProgressReportingCapabilityKindPercent")]
18    pub const Percent: Self = Self(1);
19    #[doc(alias = "CLSProgressReportingCapabilityKindBinary")]
20    pub const Binary: Self = Self(2);
21    #[doc(alias = "CLSProgressReportingCapabilityKindQuantity")]
22    pub const Quantity: Self = Self(3);
23    #[doc(alias = "CLSProgressReportingCapabilityKindScore")]
24    pub const Score: Self = Self(4);
25}
26
27unsafe impl Encode for CLSProgressReportingCapabilityKind {
28    const ENCODING: Encoding = NSInteger::ENCODING;
29}
30
31unsafe impl RefEncode for CLSProgressReportingCapabilityKind {
32    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35extern_class!(
36    /// This class specifies progress reporting capability of a ClassKit client app
37    ///
38    /// See also [Apple's documentation](https://developer.apple.com/documentation/classkit/clsprogressreportingcapability?language=objc)
39    #[unsafe(super(CLSObject, NSObject))]
40    #[derive(Debug, PartialEq, Eq, Hash)]
41    #[cfg(feature = "CLSObject")]
42    pub struct CLSProgressReportingCapability;
43);
44
45#[cfg(feature = "CLSObject")]
46extern_conformance!(
47    unsafe impl NSCoding for CLSProgressReportingCapability {}
48);
49
50#[cfg(feature = "CLSObject")]
51extern_conformance!(
52    unsafe impl NSObjectProtocol for CLSProgressReportingCapability {}
53);
54
55#[cfg(feature = "CLSObject")]
56extern_conformance!(
57    unsafe impl NSSecureCoding for CLSProgressReportingCapability {}
58);
59
60#[cfg(feature = "CLSObject")]
61impl CLSProgressReportingCapability {
62    extern_methods!(
63        /// Returns the kind of progress reporting capability
64        #[unsafe(method(kind))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn kind(&self) -> CLSProgressReportingCapabilityKind;
67
68        /// Returns progress reporting details
69        #[unsafe(method(details))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn details(&self) -> Option<Retained<NSString>>;
72
73        /// Initialize and configure the type of progress reporting capability
74        ///
75        /// Parameter `kind`: The kind of progress reporting capability
76        ///
77        /// Parameter `details`: An optional localized string describing the capability. For example: "Reports percentage of progress", "Reports overall score". Schoolwork will use an appropriate default string if one is not provided.
78        #[unsafe(method(initWithKind:details:))]
79        #[unsafe(method_family = init)]
80        pub unsafe fn initWithKind_details(
81            this: Allocated<Self>,
82            kind: CLSProgressReportingCapabilityKind,
83            details: Option<&NSString>,
84        ) -> Retained<Self>;
85    );
86}
87
88/// Methods declared on superclass `CLSObject`.
89#[cfg(feature = "CLSObject")]
90impl CLSProgressReportingCapability {
91    extern_methods!(
92        #[unsafe(method(new))]
93        #[unsafe(method_family = new)]
94        pub unsafe fn new() -> Retained<Self>;
95
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
99    );
100}