objc2_app_kit/generated/
NSAnimationContext.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::*;
6use objc2_foundation::*;
7#[cfg(feature = "objc2-quartz-core")]
8#[cfg(target_vendor = "apple")]
9use objc2_quartz_core::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsanimationcontext?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct NSAnimationContext;
18);
19
20extern_conformance!(
21    unsafe impl NSObjectProtocol for NSAnimationContext {}
22);
23
24impl NSAnimationContext {
25    extern_methods!(
26        #[cfg(feature = "block2")]
27        #[unsafe(method(runAnimationGroup:completionHandler:))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn runAnimationGroup_completionHandler(
30            changes: &block2::DynBlock<dyn Fn(NonNull<NSAnimationContext>) + '_>,
31            completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
32        );
33
34        #[cfg(feature = "block2")]
35        #[unsafe(method(runAnimationGroup:))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn runAnimationGroup(
38            changes: &block2::DynBlock<dyn Fn(NonNull<NSAnimationContext>) + '_>,
39        );
40
41        #[unsafe(method(beginGrouping))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn beginGrouping();
44
45        #[unsafe(method(endGrouping))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn endGrouping();
48
49        #[unsafe(method(currentContext))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn currentContext() -> Retained<NSAnimationContext>;
52
53        #[unsafe(method(duration))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn duration(&self) -> NSTimeInterval;
56
57        /// Setter for [`duration`][Self::duration].
58        #[unsafe(method(setDuration:))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn setDuration(&self, duration: NSTimeInterval);
61
62        #[cfg(feature = "objc2-quartz-core")]
63        #[cfg(target_vendor = "apple")]
64        #[unsafe(method(timingFunction))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn timingFunction(&self) -> Option<Retained<CAMediaTimingFunction>>;
67
68        #[cfg(feature = "objc2-quartz-core")]
69        #[cfg(target_vendor = "apple")]
70        /// Setter for [`timingFunction`][Self::timingFunction].
71        #[unsafe(method(setTimingFunction:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setTimingFunction(&self, timing_function: Option<&CAMediaTimingFunction>);
74
75        #[cfg(feature = "block2")]
76        #[unsafe(method(completionHandler))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn completionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
79
80        #[cfg(feature = "block2")]
81        /// Setter for [`completionHandler`][Self::completionHandler].
82        #[unsafe(method(setCompletionHandler:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setCompletionHandler(
85            &self,
86            completion_handler: Option<&block2::DynBlock<dyn Fn()>>,
87        );
88
89        #[unsafe(method(allowsImplicitAnimation))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn allowsImplicitAnimation(&self) -> bool;
92
93        /// Setter for [`allowsImplicitAnimation`][Self::allowsImplicitAnimation].
94        #[unsafe(method(setAllowsImplicitAnimation:))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn setAllowsImplicitAnimation(&self, allows_implicit_animation: bool);
97    );
98}
99
100/// Methods declared on superclass `NSObject`.
101impl NSAnimationContext {
102    extern_methods!(
103        #[unsafe(method(init))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107        #[unsafe(method(new))]
108        #[unsafe(method_family = new)]
109        pub unsafe fn new() -> Retained<Self>;
110    );
111}