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 fn behavioralStyle(&self) -> UIBehavioralStyle;
48
49 #[unsafe(method(preferredBehavioralStyle))]
51 #[unsafe(method_family = none)]
52 pub fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;
53
54 #[unsafe(method(setPreferredBehavioralStyle:))]
56 #[unsafe(method_family = none)]
57 pub fn setPreferredBehavioralStyle(&self, preferred_behavioral_style: UIBehavioralStyle);
58 );
59}
60
61#[cfg(all(
63 feature = "UIControl",
64 feature = "UIResponder",
65 feature = "UISlider",
66 feature = "UIView"
67))]
68impl UISlider {
69 extern_methods!(
70 #[unsafe(method(behavioralStyle))]
72 #[unsafe(method_family = none)]
73 pub fn behavioralStyle(&self) -> UIBehavioralStyle;
74
75 #[unsafe(method(preferredBehavioralStyle))]
77 #[unsafe(method_family = none)]
78 pub fn preferredBehavioralStyle(&self) -> UIBehavioralStyle;
79
80 #[unsafe(method(setPreferredBehavioralStyle:))]
82 #[unsafe(method_family = none)]
83 pub fn setPreferredBehavioralStyle(&self, preferred_behavioral_style: UIBehavioralStyle);
84 );
85}