objc2_class_kit/generated/
CLSScoreItem.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// CLSScoreItem represents user generated score information.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/classkit/clsscoreitem?language=objc)
14    #[unsafe(super(CLSActivityItem, CLSObject, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
17    pub struct CLSScoreItem;
18);
19
20#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
21extern_conformance!(
22    unsafe impl NSCoding for CLSScoreItem {}
23);
24
25#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
26extern_conformance!(
27    unsafe impl NSObjectProtocol for CLSScoreItem {}
28);
29
30#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
31extern_conformance!(
32    unsafe impl NSSecureCoding for CLSScoreItem {}
33);
34
35#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
36impl CLSScoreItem {
37    extern_methods!(
38        /// Score out of
39        /// `maxScore.`
40        /// Should be between zero and
41        /// `maxScore`[0.0,maxScore].
42        #[unsafe(method(score))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn score(&self) -> c_double;
45
46        /// Setter for [`score`][Self::score].
47        #[unsafe(method(setScore:))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn setScore(&self, score: c_double);
50
51        /// Total score possible.
52        ///
53        /// Must be greater than zero.
54        #[unsafe(method(maxScore))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn maxScore(&self) -> c_double;
57
58        /// Setter for [`maxScore`][Self::maxScore].
59        #[unsafe(method(setMaxScore:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setMaxScore(&self, max_score: c_double);
62
63        /// Create a score item with identifiers, title, score and maximum score.
64        ///
65        /// Parameter `identifier`: An identifier that is unique within activity.
66        ///
67        /// Parameter `title`: Title of score. Ex
68        /// _Biology-_Cellular Division Quiz
69        ///
70        /// Parameter `score`: The score the user received.
71        ///
72        /// Parameter `maxScore`: The maximum score possible.
73        #[unsafe(method(initWithIdentifier:title:score:maxScore:))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn initWithIdentifier_title_score_maxScore(
76            this: Allocated<Self>,
77            identifier: &NSString,
78            title: &NSString,
79            score: c_double,
80            max_score: c_double,
81        ) -> Retained<Self>;
82    );
83}
84
85/// Methods declared on superclass `CLSActivityItem`.
86#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
87impl CLSScoreItem {
88    extern_methods!(
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub unsafe fn new() -> Retained<Self>;
92
93        #[unsafe(method(init))]
94        #[unsafe(method_family = init)]
95        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96    );
97}