objc2_quartz/generated/ImageKit/
IKSaveOptions.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_app_kit::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11mod private_NSObjectIKSaveOptionsDelegate {
12    pub trait Sealed {}
13}
14
15/// Category "IKSaveOptionsDelegate" on [`NSObject`].
16#[doc(alias = "IKSaveOptionsDelegate")]
17pub unsafe trait NSObjectIKSaveOptionsDelegate:
18    ClassType + Sized + private_NSObjectIKSaveOptionsDelegate::Sealed
19{
20    extern_methods!(
21        /// # Safety
22        ///
23        /// - `save_options` might not allow `None`.
24        /// - `ut_type` might not allow `None`.
25        #[unsafe(method(saveOptions:shouldShowUTType:))]
26        #[unsafe(method_family = none)]
27        unsafe fn saveOptions_shouldShowUTType(
28            &self,
29            save_options: Option<&IKSaveOptions>,
30            ut_type: Option<&NSString>,
31        ) -> bool;
32    );
33}
34
35impl private_NSObjectIKSaveOptionsDelegate::Sealed for NSObject {}
36unsafe impl NSObjectIKSaveOptionsDelegate for NSObject {}
37
38extern_class!(
39    /// The IKSaveOptions class initializes, adds, and manages user interface options for saving image data.
40    ///
41    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/iksaveoptions?language=objc)
42    #[unsafe(super(NSObject))]
43    #[derive(Debug, PartialEq, Eq, Hash)]
44    pub struct IKSaveOptions;
45);
46
47extern_conformance!(
48    unsafe impl NSObjectProtocol for IKSaveOptions {}
49);
50
51impl IKSaveOptions {
52    extern_methods!(
53        /// Delegate of the IKSaveOptions.
54        ///
55        /// # Safety
56        ///
57        /// This is not retained internally, you must ensure the object is still alive.
58        #[unsafe(method(delegate))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
61
62        /// Setter for [`delegate`][Self::delegate].
63        ///
64        /// # Safety
65        ///
66        /// - `delegate` should be of the correct type.
67        /// - `delegate` might not allow `None`.
68        /// - This is unretained, you must ensure the object is kept alive while in use.
69        #[unsafe(method(setDelegate:))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn setDelegate(&self, delegate: Option<&AnyObject>);
72
73        /// current imageProperties (respecting user UI selection).
74        #[unsafe(method(imageProperties))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn imageProperties(&self) -> Option<Retained<NSDictionary>>;
77
78        /// current imageUTType (respecting user UI selection).
79        #[unsafe(method(imageUTType))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn imageUTType(&self) -> Option<Retained<NSString>>;
82
83        /// information about the UI settings.
84        #[unsafe(method(userSelection))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn userSelection(&self) -> Option<Retained<NSDictionary>>;
87
88        /// Initializes IKSaveOptions with metadata and UTType.
89        ///
90        /// # Safety
91        ///
92        /// - `image_properties` generic should be of the correct type.
93        /// - `image_properties` might not allow `None`.
94        /// - `image_ut_type` might not allow `None`.
95        #[unsafe(method(initWithImageProperties:imageUTType:))]
96        #[unsafe(method_family = init)]
97        pub unsafe fn initWithImageProperties_imageUTType(
98            this: Allocated<Self>,
99            image_properties: Option<&NSDictionary>,
100            image_ut_type: Option<&NSString>,
101        ) -> Option<Retained<Self>>;
102
103        /// Adds IKSaveOptions UI to a NSSavePanel.
104        ///
105        /// # Safety
106        ///
107        /// `save_panel` might not allow `None`.
108        #[unsafe(method(addSaveOptionsAccessoryViewToSavePanel:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn addSaveOptionsAccessoryViewToSavePanel(
111            &self,
112            save_panel: Option<&NSSavePanel>,
113        );
114
115        /// Adds IKSaveOptions UI to a NSView.
116        ///
117        /// # Safety
118        ///
119        /// `view` might not allow `None`.
120        #[unsafe(method(addSaveOptionsToView:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn addSaveOptionsToView(&self, view: Option<&NSView>);
123
124        /// If set, the last used UI choices are preserved for the next time IKSaveOptions is used. [default is YES]
125        #[unsafe(method(rememberLastSetting))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn rememberLastSetting(&self) -> bool;
128
129        /// Setter for [`rememberLastSetting`][Self::rememberLastSetting].
130        #[unsafe(method(setRememberLastSetting:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn setRememberLastSetting(&self, remember_last_setting: bool);
133    );
134}
135
136/// Methods declared on superclass `NSObject`.
137impl IKSaveOptions {
138    extern_methods!(
139        #[unsafe(method(init))]
140        #[unsafe(method_family = init)]
141        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
142
143        #[unsafe(method(new))]
144        #[unsafe(method_family = new)]
145        pub unsafe fn new() -> Retained<Self>;
146    );
147}