objc2_quartz_core/generated/
CATransaction.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-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/catransaction?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct CATransaction;
17);
18
19extern_conformance!(
20    unsafe impl NSObjectProtocol for CATransaction {}
21);
22
23impl CATransaction {
24    extern_methods!(
25        #[unsafe(method(begin))]
26        #[unsafe(method_family = none)]
27        pub fn begin();
28
29        #[unsafe(method(commit))]
30        #[unsafe(method_family = none)]
31        pub fn commit();
32
33        #[unsafe(method(flush))]
34        #[unsafe(method_family = none)]
35        pub fn flush();
36
37        #[unsafe(method(lock))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn lock();
40
41        #[unsafe(method(unlock))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn unlock();
44
45        #[cfg(feature = "objc2-core-foundation")]
46        #[unsafe(method(animationDuration))]
47        #[unsafe(method_family = none)]
48        pub fn animationDuration() -> CFTimeInterval;
49
50        #[cfg(feature = "objc2-core-foundation")]
51        #[unsafe(method(setAnimationDuration:))]
52        #[unsafe(method_family = none)]
53        pub fn setAnimationDuration(dur: CFTimeInterval);
54
55        #[cfg(feature = "CAMediaTimingFunction")]
56        #[unsafe(method(animationTimingFunction))]
57        #[unsafe(method_family = none)]
58        pub fn animationTimingFunction() -> Option<Retained<CAMediaTimingFunction>>;
59
60        #[cfg(feature = "CAMediaTimingFunction")]
61        #[unsafe(method(setAnimationTimingFunction:))]
62        #[unsafe(method_family = none)]
63        pub fn setAnimationTimingFunction(function: Option<&CAMediaTimingFunction>);
64
65        #[unsafe(method(disableActions))]
66        #[unsafe(method_family = none)]
67        pub fn disableActions() -> bool;
68
69        #[unsafe(method(setDisableActions:))]
70        #[unsafe(method_family = none)]
71        pub fn setDisableActions(flag: bool);
72
73        #[cfg(feature = "block2")]
74        #[unsafe(method(completionBlock))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn completionBlock() -> *mut block2::DynBlock<dyn Fn()>;
77
78        #[cfg(feature = "block2")]
79        #[unsafe(method(setCompletionBlock:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn setCompletionBlock(block: Option<&block2::DynBlock<dyn Fn()>>);
82
83        #[unsafe(method(valueForKey:))]
84        #[unsafe(method_family = none)]
85        pub fn valueForKey(key: &NSString) -> Option<Retained<AnyObject>>;
86
87        /// # Safety
88        ///
89        /// `an_object` should be of the correct type.
90        #[unsafe(method(setValue:forKey:))]
91        #[unsafe(method_family = none)]
92        pub unsafe fn setValue_forKey(an_object: Option<&AnyObject>, key: &NSString);
93    );
94}
95
96/// Methods declared on superclass `NSObject`.
97impl CATransaction {
98    extern_methods!(
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[unsafe(method(new))]
104        #[unsafe(method_family = new)]
105        pub unsafe fn new() -> Retained<Self>;
106    );
107}
108
109extern "C" {
110    /// Transaction property ids. *
111    ///
112    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransactionanimationduration?language=objc)
113    pub static kCATransactionAnimationDuration: &'static NSString;
114}
115
116extern "C" {
117    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransactiondisableactions?language=objc)
118    pub static kCATransactionDisableActions: &'static NSString;
119}
120
121extern "C" {
122    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransactionanimationtimingfunction?language=objc)
123    pub static kCATransactionAnimationTimingFunction: &'static NSString;
124}
125
126extern "C" {
127    /// [Apple's documentation](https://developer.apple.com/documentation/quartzcore/kcatransactioncompletionblock?language=objc)
128    pub static kCATransactionCompletionBlock: &'static NSString;
129}