objc2_map_kit/generated/
MKCompassButton.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-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9use objc2_foundation::*;
10
11use crate::*;
12
13extern_class!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/mapkit/mkcompassbutton?language=objc)
15    #[unsafe(super(NSView, NSResponder, NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    #[cfg(feature = "objc2-app-kit")]
18    #[cfg(target_os = "macos")]
19    pub struct MKCompassButton;
20);
21
22#[cfg(feature = "objc2-app-kit")]
23#[cfg(target_os = "macos")]
24extern_conformance!(
25    unsafe impl NSAccessibility for MKCompassButton {}
26);
27
28#[cfg(feature = "objc2-app-kit")]
29#[cfg(target_os = "macos")]
30extern_conformance!(
31    unsafe impl NSAccessibilityElementProtocol for MKCompassButton {}
32);
33
34#[cfg(feature = "objc2-app-kit")]
35#[cfg(target_os = "macos")]
36extern_conformance!(
37    unsafe impl NSAnimatablePropertyContainer for MKCompassButton {}
38);
39
40#[cfg(feature = "objc2-app-kit")]
41#[cfg(target_os = "macos")]
42extern_conformance!(
43    unsafe impl NSAppearanceCustomization for MKCompassButton {}
44);
45
46#[cfg(feature = "objc2-app-kit")]
47#[cfg(target_os = "macos")]
48extern_conformance!(
49    unsafe impl NSCoding for MKCompassButton {}
50);
51
52#[cfg(feature = "objc2-app-kit")]
53#[cfg(target_os = "macos")]
54extern_conformance!(
55    unsafe impl NSDraggingDestination for MKCompassButton {}
56);
57
58#[cfg(feature = "objc2-app-kit")]
59#[cfg(target_os = "macos")]
60extern_conformance!(
61    unsafe impl NSObjectProtocol for MKCompassButton {}
62);
63
64#[cfg(feature = "objc2-app-kit")]
65#[cfg(target_os = "macos")]
66extern_conformance!(
67    unsafe impl NSUserInterfaceItemIdentification for MKCompassButton {}
68);
69
70#[cfg(feature = "objc2-app-kit")]
71#[cfg(target_os = "macos")]
72impl MKCompassButton {
73    extern_methods!(
74        #[cfg(feature = "MKMapView")]
75        #[unsafe(method(compassButtonWithMapView:))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn compassButtonWithMapView(
78            map_view: Option<&MKMapView>,
79            mtm: MainThreadMarker,
80        ) -> Retained<Self>;
81
82        #[cfg(feature = "MKMapView")]
83        #[unsafe(method(mapView))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn mapView(&self) -> Option<Retained<MKMapView>>;
86
87        #[cfg(feature = "MKMapView")]
88        /// Setter for [`mapView`][Self::mapView].
89        ///
90        /// This is a [weak property][objc2::topics::weak_property].
91        #[unsafe(method(setMapView:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn setMapView(&self, map_view: Option<&MKMapView>);
94
95        #[cfg(feature = "MKTypes")]
96        #[unsafe(method(compassVisibility))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn compassVisibility(&self) -> MKFeatureVisibility;
99
100        #[cfg(feature = "MKTypes")]
101        /// Setter for [`compassVisibility`][Self::compassVisibility].
102        #[unsafe(method(setCompassVisibility:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setCompassVisibility(&self, compass_visibility: MKFeatureVisibility);
105    );
106}
107
108/// Methods declared on superclass `NSView`.
109#[cfg(feature = "objc2-app-kit")]
110#[cfg(target_os = "macos")]
111impl MKCompassButton {
112    extern_methods!(
113        #[unsafe(method(initWithFrame:))]
114        #[unsafe(method_family = init)]
115        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
116
117        /// # Safety
118        ///
119        /// `coder` possibly has further requirements.
120        #[unsafe(method(initWithCoder:))]
121        #[unsafe(method_family = init)]
122        pub unsafe fn initWithCoder(
123            this: Allocated<Self>,
124            coder: &NSCoder,
125        ) -> Option<Retained<Self>>;
126    );
127}
128
129/// Methods declared on superclass `NSResponder`.
130#[cfg(feature = "objc2-app-kit")]
131#[cfg(target_os = "macos")]
132impl MKCompassButton {
133    extern_methods!(
134        #[unsafe(method(init))]
135        #[unsafe(method_family = init)]
136        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
137    );
138}
139
140/// Methods declared on superclass `NSObject`.
141#[cfg(feature = "objc2-app-kit")]
142#[cfg(target_os = "macos")]
143impl MKCompassButton {
144    extern_methods!(
145        #[unsafe(method(new))]
146        #[unsafe(method_family = new)]
147        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
148    );
149}