objc2_class_kit/generated/
CLSBinaryItem.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
10/// [Apple's documentation](https://developer.apple.com/documentation/classkit/clsbinaryvaluetype?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct CLSBinaryValueType(pub NSInteger);
15impl CLSBinaryValueType {
16    #[doc(alias = "CLSBinaryValueTypeTrueFalse")]
17    pub const TrueFalse: Self = Self(0);
18    #[doc(alias = "CLSBinaryValueTypePassFail")]
19    pub const PassFail: Self = Self(1);
20    #[doc(alias = "CLSBinaryValueTypeYesNo")]
21    pub const YesNo: Self = Self(2);
22    #[doc(alias = "CLSBinaryValueTypeCorrectIncorrect")]
23    pub const CorrectIncorrect: Self = Self(3);
24}
25
26unsafe impl Encode for CLSBinaryValueType {
27    const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for CLSBinaryValueType {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35    /// CLSBinaryItem represents user generated information that is true or false, pass or fail, yes or no.
36    ///
37    /// See also [Apple's documentation](https://developer.apple.com/documentation/classkit/clsbinaryitem?language=objc)
38    #[unsafe(super(CLSActivityItem, CLSObject, NSObject))]
39    #[derive(Debug, PartialEq, Eq, Hash)]
40    #[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
41    pub struct CLSBinaryItem;
42);
43
44#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
45extern_conformance!(
46    unsafe impl NSCoding for CLSBinaryItem {}
47);
48
49#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
50extern_conformance!(
51    unsafe impl NSObjectProtocol for CLSBinaryItem {}
52);
53
54#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
55extern_conformance!(
56    unsafe impl NSSecureCoding for CLSBinaryItem {}
57);
58
59#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
60impl CLSBinaryItem {
61    extern_methods!(
62        /// True or false value.
63        #[unsafe(method(value))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn value(&self) -> bool;
66
67        /// Setter for [`value`][Self::value].
68        #[unsafe(method(setValue:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setValue(&self, value: bool);
71
72        /// Value type of this CLSBinaryItem.
73        ///
74        /// The type that best describes this CLSBinaryItem value.
75        #[unsafe(method(valueType))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn valueType(&self) -> CLSBinaryValueType;
78
79        /// Create an item that represents a binary value
80        ///
81        /// Parameter `title`: Title of the CLSBinaryItem.
82        ///
83        /// Parameter `identifier`: An identifier that is unique within its owning activity.
84        ///
85        /// Parameter `valueType`: The type of binary value. Ex. pass or fail.
86        #[unsafe(method(initWithIdentifier:title:type:))]
87        #[unsafe(method_family = init)]
88        pub unsafe fn initWithIdentifier_title_type(
89            this: Allocated<Self>,
90            identifier: &NSString,
91            title: &NSString,
92            value_type: CLSBinaryValueType,
93        ) -> Retained<Self>;
94    );
95}
96
97/// Methods declared on superclass `CLSActivityItem`.
98#[cfg(all(feature = "CLSActivityItem", feature = "CLSObject"))]
99impl CLSBinaryItem {
100    extern_methods!(
101        #[unsafe(method(new))]
102        #[unsafe(method_family = new)]
103        pub unsafe fn new() -> Retained<Self>;
104
105        #[unsafe(method(init))]
106        #[unsafe(method_family = init)]
107        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
108    );
109}