objc2_ui_kit/generated/
UITrackingLayoutGuide.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitrackinglayoutguide?language=objc)
12    #[unsafe(super(UILayoutGuide, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "UILayoutGuide")]
16    pub struct UITrackingLayoutGuide;
17);
18
19#[cfg(feature = "UILayoutGuide")]
20extern_conformance!(
21    unsafe impl NSCoding for UITrackingLayoutGuide {}
22);
23
24#[cfg(feature = "UILayoutGuide")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for UITrackingLayoutGuide {}
27);
28
29#[cfg(feature = "UILayoutGuide")]
30impl UITrackingLayoutGuide {
31    extern_methods!(
32        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
33        /// Parameter `trackingConstraints`: Constraints to activate when the guide is close to the specified edge, and deactivate when it moves away. Sending nil will deactivate any currently active constraints associated with this edge and remove them from tracking.
34        ///
35        /// Parameter `edge`: When the tracking layout guide is close to this edge, specified constraints will change
36        #[unsafe(method(setConstraints:activeWhenNearEdge:))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn setConstraints_activeWhenNearEdge(
39            &self,
40            tracking_constraints: &NSArray<NSLayoutConstraint>,
41            edge: NSDirectionalRectEdge,
42        );
43
44        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
45        #[unsafe(method(constraintsActiveWhenNearEdge:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn constraintsActiveWhenNearEdge(
48            &self,
49            edge: NSDirectionalRectEdge,
50        ) -> Retained<NSArray<NSLayoutConstraint>>;
51
52        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
53        /// Parameter `trackingConstraints`: Constraints to deactivate when the guide is close to the specified edge, and activate when it moves away. Sending nil will remove the constraints associated with this edge from tracking.
54        ///
55        /// Parameter `edge`: When the tracking layout guide is close to this edge, specified constraints will change
56        #[unsafe(method(setConstraints:activeWhenAwayFromEdge:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn setConstraints_activeWhenAwayFromEdge(
59            &self,
60            tracking_constraints: &NSArray<NSLayoutConstraint>,
61            edge: NSDirectionalRectEdge,
62        );
63
64        #[cfg(all(feature = "NSLayoutConstraint", feature = "UIGeometry"))]
65        #[unsafe(method(constraintsActiveWhenAwayFromEdge:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn constraintsActiveWhenAwayFromEdge(
68            &self,
69            edge: NSDirectionalRectEdge,
70        ) -> Retained<NSArray<NSLayoutConstraint>>;
71
72        /// Manually remove all constraints from this guide's tracking.
73        #[unsafe(method(removeAllTrackedConstraints))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn removeAllTrackedConstraints(&self);
76    );
77}
78
79/// Methods declared on superclass `NSObject`.
80#[cfg(feature = "UILayoutGuide")]
81impl UITrackingLayoutGuide {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
90    );
91}