objc2_ui_kit/generated/UISymbolEffectCompletion.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::*;
6#[cfg(feature = "objc2-symbols")]
7use objc2_symbols::*;
8
9use crate::*;
10
11/// Completion handler for adding and removing symbol effects/content transitions.
12///
13/// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uisymboleffectcompletion?language=objc)
14#[cfg(feature = "block2")]
15pub type UISymbolEffectCompletion =
16 *mut block2::DynBlock<dyn Fn(NonNull<UISymbolEffectCompletionContext>)>;
17
18extern_class!(
19 /// Represents information about a symbol effect's completion.
20 /// You don't create one of these. Instead, UIKit creates one and passes it into the completion handler
21 /// of a symbol effect or symbol content transition.
22 ///
23 /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uisymboleffectcompletioncontext?language=objc)
24 #[unsafe(super(NSObject))]
25 #[thread_kind = MainThreadOnly]
26 #[derive(Debug, PartialEq, Eq, Hash)]
27 pub struct UISymbolEffectCompletionContext;
28);
29
30extern_conformance!(
31 unsafe impl NSObjectProtocol for UISymbolEffectCompletionContext {}
32);
33
34impl UISymbolEffectCompletionContext {
35 extern_methods!(
36 /// Whether or not the symbol effect was completely finished.
37 /// This will be YES for effects that have successfully run to completion.
38 #[unsafe(method(isFinished))]
39 #[unsafe(method_family = none)]
40 pub fn isFinished(&self) -> bool;
41
42 /// The object (such as an image view) that the symbol effect was added to.
43 #[unsafe(method(sender))]
44 #[unsafe(method_family = none)]
45 pub fn sender(&self) -> Option<Retained<AnyObject>>;
46
47 #[cfg(feature = "objc2-symbols")]
48 /// The symbol effect that has completed.
49 /// There is no guarantee that this effect will be the same instance as the effect originally added.
50 /// This will be `nil` if a symbol content transition was added instead.
51 #[unsafe(method(effect))]
52 #[unsafe(method_family = none)]
53 pub fn effect(&self) -> Option<Retained<NSSymbolEffect>>;
54
55 #[cfg(feature = "objc2-symbols")]
56 /// The symbol content transition that has completed.
57 /// There is no guarantee that this content transition will be the same instance as the content transition originally added.
58 /// This will be `nil` if a symbol effect was added instead.
59 #[unsafe(method(contentTransition))]
60 #[unsafe(method_family = none)]
61 pub fn contentTransition(&self) -> Option<Retained<NSSymbolContentTransition>>;
62
63 #[unsafe(method(init))]
64 #[unsafe(method_family = init)]
65 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
66
67 #[unsafe(method(new))]
68 #[unsafe(method_family = new)]
69 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
70 );
71}