objc2_game_kit/generated/
GKDialogController.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_protocol!(
14    /// [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkviewcontroller?language=objc)
15    pub unsafe trait GKViewController {}
16);
17
18extern_class!(
19    /// [Apple's documentation](https://developer.apple.com/documentation/gamekit/gkdialogcontroller?language=objc)
20    #[unsafe(super(NSResponder, NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[cfg(feature = "objc2-app-kit")]
23    #[cfg(target_os = "macos")]
24    pub struct GKDialogController;
25);
26
27#[cfg(feature = "objc2-app-kit")]
28#[cfg(target_os = "macos")]
29extern_conformance!(
30    unsafe impl NSCoding for GKDialogController {}
31);
32
33#[cfg(feature = "objc2-app-kit")]
34#[cfg(target_os = "macos")]
35extern_conformance!(
36    unsafe impl NSObjectProtocol for GKDialogController {}
37);
38
39#[cfg(feature = "objc2-app-kit")]
40#[cfg(target_os = "macos")]
41impl GKDialogController {
42    extern_methods!(
43        #[unsafe(method(parentWindow))]
44        #[unsafe(method_family = none)]
45        pub unsafe fn parentWindow(&self) -> Option<Retained<NSWindow>>;
46
47        /// Setter for [`parentWindow`][Self::parentWindow].
48        ///
49        /// This is a [weak property][objc2::topics::weak_property].
50        #[unsafe(method(setParentWindow:))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn setParentWindow(&self, parent_window: Option<&NSWindow>);
53
54        /// # Safety
55        ///
56        /// `view_controller` must implement GKViewController.
57        #[unsafe(method(presentViewController:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn presentViewController(&self, view_controller: &NSViewController) -> bool;
60
61        /// # Safety
62        ///
63        /// `sender` should be of the correct type.
64        #[unsafe(method(dismiss:))]
65        #[unsafe(method_family = none)]
66        pub unsafe fn dismiss(&self, sender: &AnyObject);
67    );
68}
69
70/// Methods declared on superclass `NSResponder`.
71#[cfg(feature = "objc2-app-kit")]
72#[cfg(target_os = "macos")]
73impl GKDialogController {
74    extern_methods!(
75        #[unsafe(method(init))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
78
79        /// # Safety
80        ///
81        /// `coder` possibly has further requirements.
82        #[unsafe(method(initWithCoder:))]
83        #[unsafe(method_family = init)]
84        pub unsafe fn initWithCoder(
85            this: Allocated<Self>,
86            coder: &NSCoder,
87        ) -> Option<Retained<Self>>;
88    );
89}
90
91/// Methods declared on superclass `NSObject`.
92#[cfg(feature = "objc2-app-kit")]
93#[cfg(target_os = "macos")]
94impl GKDialogController {
95    extern_methods!(
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
99    );
100}
101
102/// SharedDialogController.
103#[cfg(feature = "objc2-app-kit")]
104#[cfg(target_os = "macos")]
105impl GKDialogController {
106    extern_methods!(
107        #[unsafe(method(sharedDialogController))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn sharedDialogController(mtm: MainThreadMarker)
110            -> Retained<GKDialogController>;
111    );
112}