1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// The hover style to apply to a view, including an effect and a shape to use
/// for displaying that effect.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uihoverstyle?language=objc)
#[unsafe(super(NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIHoverStyle;
);
extern_conformance!(
unsafe impl NSCopying for UIHoverStyle {}
);
unsafe impl CopyingHelper for UIHoverStyle {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for UIHoverStyle {}
);
impl UIHoverStyle {
extern_methods!(
#[cfg(feature = "UIHoverEffect")]
/// The effect to apply to the view with this style. Use `UIHoverAutomaticEffect`
/// to apply a system-default effect to the view.
#[unsafe(method(effect))]
#[unsafe(method_family = none)]
pub fn effect(&self) -> Retained<ProtocolObject<dyn UIHoverEffect>>;
#[cfg(feature = "UIHoverEffect")]
/// Setter for [`effect`][Self::effect].
#[unsafe(method(setEffect:))]
#[unsafe(method_family = none)]
pub fn setEffect(&self, effect: &ProtocolObject<dyn UIHoverEffect>);
#[cfg(feature = "UIShape")]
/// The shape to use for the hover effect. If a `nil` shape is used, a
/// system-default shape will be chosen based on the view.
#[unsafe(method(shape))]
#[unsafe(method_family = none)]
pub fn shape(&self) -> Option<Retained<UIShape>>;
#[cfg(feature = "UIShape")]
/// Setter for [`shape`][Self::shape].
#[unsafe(method(setShape:))]
#[unsafe(method_family = none)]
pub fn setShape(&self, shape: Option<&UIShape>);
/// Whether the effect to apply to the view with this style is enabled.
/// Use this property to temporarily disable a view's hover effect without
/// removing it from the view entirely.
#[unsafe(method(isEnabled))]
#[unsafe(method_family = none)]
pub fn isEnabled(&self) -> bool;
/// Setter for [`isEnabled`][Self::isEnabled].
#[unsafe(method(setEnabled:))]
#[unsafe(method_family = none)]
pub fn setEnabled(&self, enabled: bool);
#[cfg(all(feature = "UIHoverEffect", feature = "UIShape"))]
/// Creates a hover style with the provided effect and shape.
#[unsafe(method(styleWithEffect:shape:))]
#[unsafe(method_family = none)]
pub unsafe fn styleWithEffect_shape(
effect: &ProtocolObject<dyn UIHoverEffect>,
shape: Option<&UIShape>,
) -> Retained<Self>;
#[cfg(feature = "UIShape")]
/// Creates a hover style with the provided shape and a `UIHoverAutomaticEffect`.
#[unsafe(method(styleWithShape:))]
#[unsafe(method_family = none)]
pub fn styleWithShape(shape: Option<&UIShape>, mtm: MainThreadMarker) -> Retained<Self>;
/// Creates a hover style with the default shape and a `UIHoverAutomaticEffect`.
#[unsafe(method(automaticStyle))]
#[unsafe(method_family = none)]
pub fn automaticStyle(mtm: MainThreadMarker) -> Retained<Self>;
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
/// UIHoverStyle.
#[cfg(all(feature = "UIResponder", feature = "UIView"))]
impl UIView {
extern_methods!(
/// The hover style associated with this view. Defaults to `nil`,
/// indicating that this view should not have any hover effect.
/// Subclasses may configure this style to use a different default value.
#[unsafe(method(hoverStyle))]
#[unsafe(method_family = none)]
pub fn hoverStyle(&self) -> Option<Retained<UIHoverStyle>>;
/// Setter for [`hoverStyle`][Self::hoverStyle].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setHoverStyle:))]
#[unsafe(method_family = none)]
pub fn setHoverStyle(&self, hover_style: Option<&UIHoverStyle>);
);
}