objc2_ui_kit/generated/
UITimingCurveProvider.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4use objc2_foundation::*;
5
6use crate::*;
7
8/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitimingcurvetype?language=objc)
9// NS_ENUM
10#[repr(transparent)]
11#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
12pub struct UITimingCurveType(pub NSInteger);
13impl UITimingCurveType {
14    #[doc(alias = "UITimingCurveTypeBuiltin")]
15    pub const Builtin: Self = Self(0);
16    #[doc(alias = "UITimingCurveTypeCubic")]
17    pub const Cubic: Self = Self(1);
18    #[doc(alias = "UITimingCurveTypeSpring")]
19    pub const Spring: Self = Self(2);
20    #[doc(alias = "UITimingCurveTypeComposed")]
21    pub const Composed: Self = Self(3);
22}
23
24unsafe impl Encode for UITimingCurveType {
25    const ENCODING: Encoding = NSInteger::ENCODING;
26}
27
28unsafe impl RefEncode for UITimingCurveType {
29    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32extern_protocol!(
33    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitimingcurveprovider?language=objc)
34    pub unsafe trait UITimingCurveProvider: NSCoding + NSCopying + MainThreadOnly {
35        #[unsafe(method(timingCurveType))]
36        #[unsafe(method_family = none)]
37        fn timingCurveType(&self) -> UITimingCurveType;
38
39        #[cfg(feature = "UITimingParameters")]
40        #[unsafe(method(cubicTimingParameters))]
41        #[unsafe(method_family = none)]
42        fn cubicTimingParameters(&self) -> Option<Retained<UICubicTimingParameters>>;
43
44        #[cfg(feature = "UITimingParameters")]
45        #[unsafe(method(springTimingParameters))]
46        #[unsafe(method_family = none)]
47        fn springTimingParameters(&self) -> Option<Retained<UISpringTimingParameters>>;
48    }
49);