objc2_app_kit/generated/
NSLayoutGuide.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/appkit/nslayoutguide?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct NSLayoutGuide;
15);
16
17unsafe impl NSCoding for NSLayoutGuide {}
18
19unsafe impl NSObjectProtocol for NSLayoutGuide {}
20
21#[cfg(feature = "NSUserInterfaceItemIdentification")]
22unsafe impl NSUserInterfaceItemIdentification for NSLayoutGuide {}
23
24impl NSLayoutGuide {
25    extern_methods!(
26        #[unsafe(method(frame))]
27        #[unsafe(method_family = none)]
28        pub unsafe fn frame(&self) -> NSRect;
29
30        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
31        #[unsafe(method(owningView))]
32        #[unsafe(method_family = none)]
33        pub unsafe fn owningView(&self, mtm: MainThreadMarker) -> Option<Retained<NSView>>;
34
35        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
36        /// This is a [weak property][objc2::topics::weak_property].
37        /// Setter for [`owningView`][Self::owningView].
38        #[unsafe(method(setOwningView:))]
39        #[unsafe(method_family = none)]
40        pub unsafe fn setOwningView(&self, owning_view: Option<&NSView>);
41
42        #[cfg(feature = "NSUserInterfaceItemIdentification")]
43        #[unsafe(method(identifier))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn identifier(&self) -> Retained<NSUserInterfaceItemIdentifier>;
46
47        #[cfg(feature = "NSUserInterfaceItemIdentification")]
48        /// Setter for [`identifier`][Self::identifier].
49        #[unsafe(method(setIdentifier:))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier);
52
53        #[cfg(feature = "NSLayoutAnchor")]
54        #[unsafe(method(leadingAnchor))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn leadingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
57
58        #[cfg(feature = "NSLayoutAnchor")]
59        #[unsafe(method(trailingAnchor))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn trailingAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
62
63        #[cfg(feature = "NSLayoutAnchor")]
64        #[unsafe(method(leftAnchor))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn leftAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
67
68        #[cfg(feature = "NSLayoutAnchor")]
69        #[unsafe(method(rightAnchor))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn rightAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
72
73        #[cfg(feature = "NSLayoutAnchor")]
74        #[unsafe(method(topAnchor))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn topAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
77
78        #[cfg(feature = "NSLayoutAnchor")]
79        #[unsafe(method(bottomAnchor))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn bottomAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
82
83        #[cfg(feature = "NSLayoutAnchor")]
84        #[unsafe(method(widthAnchor))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn widthAnchor(&self) -> Retained<NSLayoutDimension>;
87
88        #[cfg(feature = "NSLayoutAnchor")]
89        #[unsafe(method(heightAnchor))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn heightAnchor(&self) -> Retained<NSLayoutDimension>;
92
93        #[cfg(feature = "NSLayoutAnchor")]
94        #[unsafe(method(centerXAnchor))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn centerXAnchor(&self) -> Retained<NSLayoutXAxisAnchor>;
97
98        #[cfg(feature = "NSLayoutAnchor")]
99        #[unsafe(method(centerYAnchor))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn centerYAnchor(&self) -> Retained<NSLayoutYAxisAnchor>;
102
103        #[unsafe(method(hasAmbiguousLayout))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn hasAmbiguousLayout(&self) -> bool;
106
107        #[cfg(feature = "NSLayoutConstraint")]
108        #[unsafe(method(constraintsAffectingLayoutForOrientation:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn constraintsAffectingLayoutForOrientation(
111            &self,
112            orientation: NSLayoutConstraintOrientation,
113        ) -> Retained<NSArray<NSLayoutConstraint>>;
114    );
115}
116
117/// Methods declared on superclass `NSObject`.
118impl NSLayoutGuide {
119    extern_methods!(
120        #[unsafe(method(init))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
123
124        #[unsafe(method(new))]
125        #[unsafe(method_family = new)]
126        pub unsafe fn new() -> Retained<Self>;
127    );
128}
129
130/// NSLayoutGuideSupport.
131#[cfg(all(feature = "NSResponder", feature = "NSView"))]
132impl NSView {
133    extern_methods!(
134        #[unsafe(method(addLayoutGuide:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn addLayoutGuide(&self, guide: &NSLayoutGuide);
137
138        #[unsafe(method(removeLayoutGuide:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn removeLayoutGuide(&self, guide: &NSLayoutGuide);
141
142        #[unsafe(method(layoutGuides))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn layoutGuides(&self) -> Retained<NSArray<NSLayoutGuide>>;
145    );
146}