objc2_ui_kit/generated/
UILayoutGuide.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/uilayoutguide?language=objc)
14    #[unsafe(super(NSObject))]
15    #[thread_kind = MainThreadOnly]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct UILayoutGuide;
18);
19
20unsafe impl NSCoding for UILayoutGuide {}
21
22unsafe impl NSObjectProtocol for UILayoutGuide {}
23
24impl UILayoutGuide {
25    extern_methods!(
26        #[cfg(feature = "objc2-core-foundation")]
27        #[unsafe(method(layoutFrame))]
28        #[unsafe(method_family = none)]
29        pub unsafe fn layoutFrame(&self) -> CGRect;
30
31        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
32        #[unsafe(method(owningView))]
33        #[unsafe(method_family = none)]
34        pub unsafe fn owningView(&self) -> Option<Retained<UIView>>;
35
36        #[cfg(all(feature = "UIResponder", feature = "UIView"))]
37        /// This is a [weak property][objc2::topics::weak_property].
38        /// Setter for [`owningView`][Self::owningView].
39        #[unsafe(method(setOwningView:))]
40        #[unsafe(method_family = none)]
41        pub unsafe fn setOwningView(&self, owning_view: Option<&UIView>);
42
43        #[unsafe(method(identifier))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn identifier(&self) -> Retained<NSString>;
46
47        /// Setter for [`identifier`][Self::identifier].
48        #[unsafe(method(setIdentifier:))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn setIdentifier(&self, identifier: &NSString);
51
52        #[cfg(feature = "NSLayoutAnchor")]
53        #[unsafe(method(leadingAnchor))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn leadingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
56
57        #[cfg(feature = "NSLayoutAnchor")]
58        #[unsafe(method(trailingAnchor))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn trailingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
61
62        #[cfg(feature = "NSLayoutAnchor")]
63        #[unsafe(method(leftAnchor))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn leftAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
66
67        #[cfg(feature = "NSLayoutAnchor")]
68        #[unsafe(method(rightAnchor))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn rightAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
71
72        #[cfg(feature = "NSLayoutAnchor")]
73        #[unsafe(method(topAnchor))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn topAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
76
77        #[cfg(feature = "NSLayoutAnchor")]
78        #[unsafe(method(bottomAnchor))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn bottomAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
81
82        #[cfg(feature = "NSLayoutAnchor")]
83        #[unsafe(method(widthAnchor))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn widthAnchor(&self) -> Retained<NSLayoutDimension>;
86
87        #[cfg(feature = "NSLayoutAnchor")]
88        #[unsafe(method(heightAnchor))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn heightAnchor(&self) -> Retained<NSLayoutDimension>;
91
92        #[cfg(feature = "NSLayoutAnchor")]
93        #[unsafe(method(centerXAnchor))]
94        #[unsafe(method_family = none)]
95        pub unsafe fn centerXAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
96
97        #[cfg(feature = "NSLayoutAnchor")]
98        #[unsafe(method(centerYAnchor))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn centerYAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
101    );
102}
103
104/// Methods declared on superclass `NSObject`.
105impl UILayoutGuide {
106    extern_methods!(
107        #[unsafe(method(init))]
108        #[unsafe(method_family = init)]
109        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
110
111        #[unsafe(method(new))]
112        #[unsafe(method_family = new)]
113        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
114    );
115}