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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
//! 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use crate::*;
extern_class!(
/// An object you use to configure additional tasks or animations to
/// run alongside the Writing Tools animations.
///
/// When Writing Tools replaces text in one of your context objects,
/// it provides a `UIWritingToolsCoordinator.AnimationParameters` object for
/// you to use to configure any additional animations. During a Writing
/// Tools session, you hide the text under evaluation and provide a
/// targeted preview of your content. Writing Tools animations changes
/// to that preview, but you might need to provide additional animations
/// for other parts of your view’s content. For example, you might
/// need to animate any layout changes caused by the insertion or
/// removal of text in other parts of your view. Use this object to
/// configure those animations.
///
/// You don’t create a `UIWritingToolsCoordinator.AnimationParameters`
/// object directly. Instead, the system creates one and passes it to the
/// ``UIWritingToolsCoordinator/writingToolsCoordinator(_:replaceRange:inContext:proposedText:reason:animationParameters:completion:)``
/// method of your ``UIWritingToolsCoordinatorDelegate`` object. Use that
/// object to specify the blocks to run during and after the system animations.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uiwritingtoolscoordinatoranimationparameters?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct UIWritingToolsCoordinatorAnimationParameters;
);
unsafe impl Send for UIWritingToolsCoordinatorAnimationParameters {}
unsafe impl Sync for UIWritingToolsCoordinatorAnimationParameters {}
extern_conformance!(
unsafe impl NSObjectProtocol for UIWritingToolsCoordinatorAnimationParameters {}
);
impl UIWritingToolsCoordinatorAnimationParameters {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "objc2-core-foundation")]
/// The number of seconds it takes the system animations to run.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(duration))]
#[unsafe(method_family = none)]
pub unsafe fn duration(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
/// The number of seconds the system waits before starting its animations.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(delay))]
#[unsafe(method_family = none)]
pub unsafe fn delay(&self) -> CGFloat;
#[cfg(feature = "block2")]
/// A custom block that runs at the same time as the system animations.
///
/// If you have animations you want to run at the same time as the system
/// animations, assign a block to this property and use it to run your
/// animations. The block you provide must have no return value and take
/// a floating-point value as a parameter. The parameter indicates the
/// current progress of the animations as a percentage value between
/// `0.0` to `1.0`. The system executes your block multiple times during
/// the course of the animations, providing an updated completion value each time.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(progressHandler))]
#[unsafe(method_family = none)]
pub unsafe fn progressHandler(&self) -> *mut block2::DynBlock<dyn Fn(c_float)>;
#[cfg(feature = "block2")]
/// Setter for [`progressHandler`][Self::progressHandler].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(setProgressHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setProgressHandler(
&self,
progress_handler: Option<&block2::DynBlock<dyn Fn(c_float)>>,
);
#[cfg(feature = "block2")]
/// A custom block to run when the system animations finish.
///
/// Set this property to a block that you want the system to run when any
/// animations finish. The block you provide must have no return value
/// and no parameters. The system executes this block once when the current
/// animation finish.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(completionHandler))]
#[unsafe(method_family = none)]
pub unsafe fn completionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
#[cfg(feature = "block2")]
/// Setter for [`completionHandler`][Self::completionHandler].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(setCompletionHandler:))]
#[unsafe(method_family = none)]
pub unsafe fn setCompletionHandler(
&self,
completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
);
);
}
/// Methods declared on superclass `NSObject`.
impl UIWritingToolsCoordinatorAnimationParameters {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}