objc2_ui_kit/generated/
UISelectionFeedbackGenerator.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::*;
8
9use crate::*;
10
11extern_class!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiselectionfeedbackgenerator?language=objc)
13    #[unsafe(super(UIFeedbackGenerator, NSObject))]
14    #[thread_kind = MainThreadOnly]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "UIFeedbackGenerator")]
17    pub struct UISelectionFeedbackGenerator;
18);
19
20#[cfg(feature = "UIFeedbackGenerator")]
21unsafe impl NSObjectProtocol for UISelectionFeedbackGenerator {}
22
23#[cfg(feature = "UIFeedbackGenerator")]
24impl UISelectionFeedbackGenerator {
25    extern_methods!(
26        /// call when the selection changes (not on initial selection)
27        #[unsafe(method(selectionChanged))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn selectionChanged(&self);
30
31        #[cfg(feature = "objc2-core-foundation")]
32        /// call when the selection changes (not on initial selection)
33        /// provide the location in the `view` the change occured at
34        #[unsafe(method(selectionChangedAtLocation:))]
35        #[unsafe(method_family = none)]
36        pub unsafe fn selectionChangedAtLocation(&self, location: CGPoint);
37    );
38}
39
40/// Methods declared on superclass `UIFeedbackGenerator`.
41#[cfg(feature = "UIFeedbackGenerator")]
42impl UISelectionFeedbackGenerator {
43    extern_methods!(
44        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
45        /// initalize the generator with a view to attach it to the provided view as an interaction.
46        #[unsafe(method(feedbackGeneratorForView:))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn feedbackGeneratorForView(view: &UIView) -> Retained<Self>;
49
50        #[deprecated]
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54    );
55}
56
57/// Methods declared on superclass `NSObject`.
58#[cfg(feature = "UIFeedbackGenerator")]
59impl UISelectionFeedbackGenerator {
60    extern_methods!(
61        #[unsafe(method(new))]
62        #[unsafe(method_family = new)]
63        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
64    );
65}