objc2_ui_kit/generated/
UIBehavioralStyle.rs1use core::ffi::*;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UIBehavioralStyle(pub NSUInteger);
15impl UIBehavioralStyle {
16 #[doc(alias = "UIBehavioralStyleAutomatic")]
18 pub const Automatic: Self = Self(0);
19 #[doc(alias = "UIBehavioralStylePad")]
21 pub const Pad: Self = Self(1);
22 #[doc(alias = "UIBehavioralStyleMac")]
24 pub const Mac: Self = Self(2);
25}
26
27unsafe impl Encode for UIBehavioralStyle {
28 const ENCODING: Encoding = NSUInteger::ENCODING;
29}
30
31unsafe impl RefEncode for UIBehavioralStyle {
32 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
33}
34
35#[cfg(all(
37 feature = "UIButton",
38 feature = "UIControl",
39 feature = "UIResponder",
40 feature = "UIView"
41))]
42impl UIButton {
43 extern_methods!(
44 #[unsafe(method(behavioralStyle))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn behavioralStyle(&self) -> UIBehavioralStyle;
48
49 #[unsafe(method(preferredBehavioralStyle))]
51 #[unsafe(method_family = none)]
52 pub unsafe fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;
53
54 #[unsafe(method(setPreferredBehavioralStyle:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn setPreferredBehavioralStyle(
58 &self,
59 preferred_behavioral_style: UIBehavioralStyle,
60 );
61 );
62}
63
64#[cfg(all(
66 feature = "UIControl",
67 feature = "UIResponder",
68 feature = "UISlider",
69 feature = "UIView"
70))]
71impl UISlider {
72 extern_methods!(
73 #[unsafe(method(behavioralStyle))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn behavioralStyle(&self) -> UIBehavioralStyle;
77
78 #[unsafe(method(preferredBehavioralStyle))]
80 #[unsafe(method_family = none)]
81 pub unsafe fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;
82
83 #[unsafe(method(setPreferredBehavioralStyle:))]
85 #[unsafe(method_family = none)]
86 pub unsafe fn setPreferredBehavioralStyle(
87 &self,
88 preferred_behavioral_style: UIBehavioralStyle,
89 );
90 );
91}