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"))]
22extern_conformance!(
23    unsafe impl NSCoding for UIKeyboardLayoutGuide {}
24);
25
26#[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
27extern_conformance!(
28    unsafe impl NSObjectProtocol for UIKeyboardLayoutGuide {}
29);
30
31#[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
32impl UIKeyboardLayoutGuide {
33    extern_methods!(
34        /// Defaults to
35        /// `NO.`
36        #[unsafe(method(followsUndockedKeyboard))]
37        #[unsafe(method_family = none)]
38        pub fn followsUndockedKeyboard(&self) -> bool;
39
40        /// Setter for [`followsUndockedKeyboard`][Self::followsUndockedKeyboard].
41        #[unsafe(method(setFollowsUndockedKeyboard:))]
42        #[unsafe(method_family = none)]
43        pub fn setFollowsUndockedKeyboard(&self, follows_undocked_keyboard: bool);
44
45        /// Defaults to
46        /// `YES.`When the keyboard is offscreen, the layout guide is tied to the bottomAnchor of the view's safeAreaLayoutGuide. Set this to
47        /// `NO`to instead have the guide use the bottomAnchor of the view.
48        #[unsafe(method(usesBottomSafeArea))]
49        #[unsafe(method_family = none)]
50        pub fn usesBottomSafeArea(&self) -> bool;
51
52        /// Setter for [`usesBottomSafeArea`][Self::usesBottomSafeArea].
53        #[unsafe(method(setUsesBottomSafeArea:))]
54        #[unsafe(method_family = none)]
55        pub fn setUsesBottomSafeArea(&self, uses_bottom_safe_area: bool);
56
57        #[cfg(feature = "objc2-core-foundation")]
58        /// Defaults to 0.0. When a user scrolls to dismiss the keyboard (see
59        /// `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.
60        #[unsafe(method(keyboardDismissPadding))]
61        #[unsafe(method_family = none)]
62        pub fn keyboardDismissPadding(&self) -> CGFloat;
63
64        #[cfg(feature = "objc2-core-foundation")]
65        /// Setter for [`keyboardDismissPadding`][Self::keyboardDismissPadding].
66        #[unsafe(method(setKeyboardDismissPadding:))]
67        #[unsafe(method_family = none)]
68        pub fn setKeyboardDismissPadding(&self, keyboard_dismiss_padding: CGFloat);
69    );
70}
71
72/// Methods declared on superclass `NSObject`.
73#[cfg(all(feature = "UILayoutGuide", feature = "UITrackingLayoutGuide"))]
74impl UIKeyboardLayoutGuide {
75    extern_methods!(
76        #[unsafe(method(init))]
77        #[unsafe(method_family = init)]
78        pub fn init(this: Allocated<Self>) -> Retained<Self>;
79
80        #[unsafe(method(new))]
81        #[unsafe(method_family = new)]
82        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
83    );
84}