icrate/generated/AppKit/
NSLayoutGuide.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use crate::common::*;
4use crate::AppKit::*;
5use crate::CoreData::*;
6use crate::Foundation::*;
7
8extern_class!(
9    #[derive(Debug, PartialEq, Eq, Hash)]
10    #[cfg(feature = "AppKit_NSLayoutGuide")]
11    pub struct NSLayoutGuide;
12
13    #[cfg(feature = "AppKit_NSLayoutGuide")]
14    unsafe impl ClassType for NSLayoutGuide {
15        type Super = NSObject;
16        type Mutability = InteriorMutable;
17    }
18);
19
20#[cfg(feature = "AppKit_NSLayoutGuide")]
21unsafe impl NSCoding for NSLayoutGuide {}
22
23#[cfg(feature = "AppKit_NSLayoutGuide")]
24unsafe impl NSObjectProtocol for NSLayoutGuide {}
25
26#[cfg(feature = "AppKit_NSLayoutGuide")]
27unsafe impl NSUserInterfaceItemIdentification for NSLayoutGuide {}
28
29extern_methods!(
30    #[cfg(feature = "AppKit_NSLayoutGuide")]
31    unsafe impl NSLayoutGuide {
32        #[method(frame)]
33        pub unsafe fn frame(&self) -> NSRect;
34
35        #[cfg(feature = "AppKit_NSView")]
36        #[method_id(@__retain_semantics Other owningView)]
37        pub unsafe fn owningView(&self, mtm: MainThreadMarker) -> Option<Id<NSView>>;
38
39        #[cfg(feature = "AppKit_NSView")]
40        #[method(setOwningView:)]
41        pub unsafe fn setOwningView(&self, owning_view: Option<&NSView>);
42
43        #[method_id(@__retain_semantics Other identifier)]
44        pub unsafe fn identifier(&self) -> Id<NSUserInterfaceItemIdentifier>;
45
46        #[method(setIdentifier:)]
47        pub unsafe fn setIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier);
48
49        #[cfg(feature = "AppKit_NSLayoutXAxisAnchor")]
50        #[method_id(@__retain_semantics Other leadingAnchor)]
51        pub unsafe fn leadingAnchor(&self) -> Id<NSLayoutXAxisAnchor>;
52
53        #[cfg(feature = "AppKit_NSLayoutXAxisAnchor")]
54        #[method_id(@__retain_semantics Other trailingAnchor)]
55        pub unsafe fn trailingAnchor(&self) -> Id<NSLayoutXAxisAnchor>;
56
57        #[cfg(feature = "AppKit_NSLayoutXAxisAnchor")]
58        #[method_id(@__retain_semantics Other leftAnchor)]
59        pub unsafe fn leftAnchor(&self) -> Id<NSLayoutXAxisAnchor>;
60
61        #[cfg(feature = "AppKit_NSLayoutXAxisAnchor")]
62        #[method_id(@__retain_semantics Other rightAnchor)]
63        pub unsafe fn rightAnchor(&self) -> Id<NSLayoutXAxisAnchor>;
64
65        #[cfg(feature = "AppKit_NSLayoutYAxisAnchor")]
66        #[method_id(@__retain_semantics Other topAnchor)]
67        pub unsafe fn topAnchor(&self) -> Id<NSLayoutYAxisAnchor>;
68
69        #[cfg(feature = "AppKit_NSLayoutYAxisAnchor")]
70        #[method_id(@__retain_semantics Other bottomAnchor)]
71        pub unsafe fn bottomAnchor(&self) -> Id<NSLayoutYAxisAnchor>;
72
73        #[cfg(feature = "AppKit_NSLayoutDimension")]
74        #[method_id(@__retain_semantics Other widthAnchor)]
75        pub unsafe fn widthAnchor(&self) -> Id<NSLayoutDimension>;
76
77        #[cfg(feature = "AppKit_NSLayoutDimension")]
78        #[method_id(@__retain_semantics Other heightAnchor)]
79        pub unsafe fn heightAnchor(&self) -> Id<NSLayoutDimension>;
80
81        #[cfg(feature = "AppKit_NSLayoutXAxisAnchor")]
82        #[method_id(@__retain_semantics Other centerXAnchor)]
83        pub unsafe fn centerXAnchor(&self) -> Id<NSLayoutXAxisAnchor>;
84
85        #[cfg(feature = "AppKit_NSLayoutYAxisAnchor")]
86        #[method_id(@__retain_semantics Other centerYAnchor)]
87        pub unsafe fn centerYAnchor(&self) -> Id<NSLayoutYAxisAnchor>;
88
89        #[method(hasAmbiguousLayout)]
90        pub unsafe fn hasAmbiguousLayout(&self) -> bool;
91
92        #[cfg(all(feature = "AppKit_NSLayoutConstraint", feature = "Foundation_NSArray"))]
93        #[method_id(@__retain_semantics Other constraintsAffectingLayoutForOrientation:)]
94        pub unsafe fn constraintsAffectingLayoutForOrientation(
95            &self,
96            orientation: NSLayoutConstraintOrientation,
97        ) -> Id<NSArray<NSLayoutConstraint>>;
98    }
99);
100
101extern_methods!(
102    /// Methods declared on superclass `NSObject`
103    #[cfg(feature = "AppKit_NSLayoutGuide")]
104    unsafe impl NSLayoutGuide {
105        #[method_id(@__retain_semantics Init init)]
106        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
107
108        #[method_id(@__retain_semantics New new)]
109        pub unsafe fn new() -> Id<Self>;
110    }
111);
112
113extern_methods!(
114    /// NSLayoutGuideSupport
115    #[cfg(feature = "AppKit_NSView")]
116    unsafe impl NSView {
117        #[cfg(feature = "AppKit_NSLayoutGuide")]
118        #[method(addLayoutGuide:)]
119        pub unsafe fn addLayoutGuide(&self, guide: &NSLayoutGuide);
120
121        #[cfg(feature = "AppKit_NSLayoutGuide")]
122        #[method(removeLayoutGuide:)]
123        pub unsafe fn removeLayoutGuide(&self, guide: &NSLayoutGuide);
124
125        #[cfg(all(feature = "AppKit_NSLayoutGuide", feature = "Foundation_NSArray"))]
126        #[method_id(@__retain_semantics Other layoutGuides)]
127        pub unsafe fn layoutGuides(&self) -> Id<NSArray<NSLayoutGuide>>;
128    }
129);