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 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 fn runAnimationGroup(
38            changes: &block2::DynBlock<dyn Fn(NonNull<NSAnimationContext>) + '_>,
39        );
40
41        #[unsafe(method(beginGrouping))]
42        #[unsafe(method_family = none)]
43        pub fn beginGrouping();
44
45        #[unsafe(method(endGrouping))]
46        #[unsafe(method_family = none)]
47        pub fn endGrouping();
48
49        #[unsafe(method(currentContext))]
50        #[unsafe(method_family = none)]
51        pub fn currentContext() -> Retained<NSAnimationContext>;
52
53        #[unsafe(method(duration))]
54        #[unsafe(method_family = none)]
55        pub fn duration(&self) -> NSTimeInterval;
56
57        /// Setter for [`duration`][Self::duration].
58        #[unsafe(method(setDuration:))]
59        #[unsafe(method_family = none)]
60        pub 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 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 fn setTimingFunction(&self, timing_function: Option<&CAMediaTimingFunction>);
74
75        #[cfg(feature = "block2")]
76        #[unsafe(method(completionHandler))]
77        #[unsafe(method_family = none)]
78        pub fn completionHandler(&self) -> *mut block2::DynBlock<dyn Fn()>;
79
80        #[cfg(feature = "block2")]
81        /// Setter for [`completionHandler`][Self::completionHandler].
82        ///
83        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
84        #[unsafe(method(setCompletionHandler:))]
85        #[unsafe(method_family = none)]
86        pub fn setCompletionHandler(&self, completion_handler: Option<&block2::DynBlock<dyn Fn()>>);
87
88        #[unsafe(method(allowsImplicitAnimation))]
89        #[unsafe(method_family = none)]
90        pub fn allowsImplicitAnimation(&self) -> bool;
91
92        /// Setter for [`allowsImplicitAnimation`][Self::allowsImplicitAnimation].
93        #[unsafe(method(setAllowsImplicitAnimation:))]
94        #[unsafe(method_family = none)]
95        pub fn setAllowsImplicitAnimation(&self, allows_implicit_animation: bool);
96    );
97}
98
99/// Methods declared on superclass `NSObject`.
100impl NSAnimationContext {
101    extern_methods!(
102        #[unsafe(method(init))]
103        #[unsafe(method_family = init)]
104        pub fn init(this: Allocated<Self>) -> Retained<Self>;
105
106        #[unsafe(method(new))]
107        #[unsafe(method_family = new)]
108        pub fn new() -> Retained<Self>;
109    );
110}
111
112impl DefaultRetained for NSAnimationContext {
113    #[inline]
114    fn default_retained() -> Retained<Self> {
115        Self::new()
116    }
117}