objc2_ui_kit/generated/
UIKeyboardLayoutGuide.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/uikit/uikeyboardlayoutguide?language=objc)
14    #[unsafe(super(UITrackingLayoutGuide, UILayoutGuide, NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
18    pub struct UIKeyboardLayoutGuide;
19);
20
21#[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
22unsafe impl NSCoding for UIKeyboardLayoutGuide {}
23
24#[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
25unsafe impl NSObjectProtocol for UIKeyboardLayoutGuide {}
26
27#[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
28impl UIKeyboardLayoutGuide {
29    extern_methods!(
30        /// Defaults to
31        /// `NO.`
32        #[unsafe(method(followsUndockedKeyboard))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn followsUndockedKeyboard(&self) -> bool;
35
36        /// Setter for [`followsUndockedKeyboard`][Self::followsUndockedKeyboard].
37        #[unsafe(method(setFollowsUndockedKeyboard:))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn setFollowsUndockedKeyboard(&self, follows_undocked_keyboard: bool);
40
41        /// Defaults to
42        /// `YES.`When the keyboard is offscreen, the layout guide is tied to the bottomAnchor of the view's safeAreaLayoutGuide. Set this to
43        /// `NO`to instead have the guide use the bottomAnchor of the view.
44        #[unsafe(method(usesBottomSafeArea))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn usesBottomSafeArea(&self) -> bool;
47
48        /// Setter for [`usesBottomSafeArea`][Self::usesBottomSafeArea].
49        #[unsafe(method(setUsesBottomSafeArea:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn setUsesBottomSafeArea(&self, uses_bottom_safe_area: bool);
52
53        #[cfg(feature = "objc2-core-foundation")]
54        /// Defaults to 0.0. When a user scrolls to dismiss the keyboard (see
55        /// `UIScrollViewKeyboardDismissMode),`the gesture waits to start the dismiss until it intersects with the keyboard. This adds padding above the keyboard to start the dismiss earlier. Negative values will be treated as 0.
56        #[unsafe(method(keyboardDismissPadding))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn keyboardDismissPadding(&self) -> CGFloat;
59
60        #[cfg(feature = "objc2-core-foundation")]
61        /// Setter for [`keyboardDismissPadding`][Self::keyboardDismissPadding].
62        #[unsafe(method(setKeyboardDismissPadding:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setKeyboardDismissPadding(&self, keyboard_dismiss_padding: CGFloat);
65    );
66}
67
68/// Methods declared on superclass `NSObject`.
69#[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
70impl UIKeyboardLayoutGuide {
71    extern_methods!(
72        #[unsafe(method(init))]
73        #[unsafe(method_family = init)]
74        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76        #[unsafe(method(new))]
77        #[unsafe(method_family = new)]
78        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
79    );
80}