objc2_watch_kit/generated/
WKCrownSequencer.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
7use crate::*;
8
9extern_class!(
10    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkcrownsequencer?language=objc)
11    #[unsafe(super(NSObject))]
12    #[derive(Debug, PartialEq, Eq, Hash)]
13    pub struct WKCrownSequencer;
14);
15
16extern_conformance!(
17    unsafe impl NSObjectProtocol for WKCrownSequencer {}
18);
19
20impl WKCrownSequencer {
21    extern_methods!(
22        #[unsafe(method(delegate))]
23        #[unsafe(method_family = none)]
24        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn WKCrownDelegate>>>;
25
26        /// Setter for [`delegate`][Self::delegate].
27        ///
28        /// This is a [weak property][objc2::topics::weak_property].
29        #[unsafe(method(setDelegate:))]
30        #[unsafe(method_family = none)]
31        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn WKCrownDelegate>>);
32
33        #[unsafe(method(rotationsPerSecond))]
34        #[unsafe(method_family = none)]
35        pub unsafe fn rotationsPerSecond(&self) -> c_double;
36
37        #[unsafe(method(isIdle))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn isIdle(&self) -> bool;
40
41        #[unsafe(method(isHapticFeedbackEnabled))]
42        #[unsafe(method_family = none)]
43        pub unsafe fn isHapticFeedbackEnabled(&self) -> bool;
44
45        /// Setter for [`isHapticFeedbackEnabled`][Self::isHapticFeedbackEnabled].
46        #[unsafe(method(setHapticFeedbackEnabled:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn setHapticFeedbackEnabled(&self, haptic_feedback_enabled: bool);
49
50        #[unsafe(method(init))]
51        #[unsafe(method_family = init)]
52        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
53
54        #[unsafe(method(focus))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn focus(&self);
57
58        #[unsafe(method(resignFocus))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn resignFocus(&self);
61    );
62}
63
64/// Methods declared on superclass `NSObject`.
65impl WKCrownSequencer {
66    extern_methods!(
67        #[unsafe(method(new))]
68        #[unsafe(method_family = new)]
69        pub unsafe fn new() -> Retained<Self>;
70    );
71}
72
73extern_protocol!(
74    /// [Apple's documentation](https://developer.apple.com/documentation/watchkit/wkcrowndelegate?language=objc)
75    pub unsafe trait WKCrownDelegate: NSObjectProtocol {
76        #[optional]
77        #[unsafe(method(crownDidRotate:rotationalDelta:))]
78        #[unsafe(method_family = none)]
79        unsafe fn crownDidRotate_rotationalDelta(
80            &self,
81            crown_sequencer: Option<&WKCrownSequencer>,
82            rotational_delta: c_double,
83        );
84
85        #[optional]
86        #[unsafe(method(crownDidBecomeIdle:))]
87        #[unsafe(method_family = none)]
88        unsafe fn crownDidBecomeIdle(&self, crown_sequencer: Option<&WKCrownSequencer>);
89    }
90);