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")]
21extern_conformance!(
22    unsafe impl NSObjectProtocol for UISelectionFeedbackGenerator {}
23);
24
25#[cfg(feature = "UIFeedbackGenerator")]
26impl UISelectionFeedbackGenerator {
27    extern_methods!(
28        /// call when the selection changes (not on initial selection)
29        #[unsafe(method(selectionChanged))]
30        #[unsafe(method_family = none)]
31        pub fn selectionChanged(&self);
32
33        #[cfg(feature = "objc2-core-foundation")]
34        /// call when the selection changes (not on initial selection)
35        /// provide the location in the `view` the change occured at
36        #[unsafe(method(selectionChangedAtLocation:))]
37        #[unsafe(method_family = none)]
38        pub fn selectionChangedAtLocation(&self, location: CGPoint);
39    );
40}
41
42/// Methods declared on superclass `UIFeedbackGenerator`.
43#[cfg(feature = "UIFeedbackGenerator")]
44impl UISelectionFeedbackGenerator {
45    extern_methods!(
46        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
47        /// initalize the generator with a view to attach it to the provided view as an interaction.
48        #[unsafe(method(feedbackGeneratorForView:))]
49        #[unsafe(method_family = none)]
50        pub fn feedbackGeneratorForView(view: &UIView) -> Retained<Self>;
51
52        #[deprecated]
53        #[unsafe(method(init))]
54        #[unsafe(method_family = init)]
55        pub fn init(this: Allocated<Self>) -> Retained<Self>;
56    );
57}
58
59/// Methods declared on superclass `NSObject`.
60#[cfg(feature = "UIFeedbackGenerator")]
61impl UISelectionFeedbackGenerator {
62    extern_methods!(
63        #[unsafe(method(new))]
64        #[unsafe(method_family = new)]
65        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
66    );
67}