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        #[unsafe(method(saveOptions:shouldShowUTType:))]
22        #[unsafe(method_family = none)]
23        unsafe fn saveOptions_shouldShowUTType(
24            &self,
25            save_options: Option<&IKSaveOptions>,
26            ut_type: Option<&NSString>,
27        ) -> bool;
28    );
29}
30
31impl private_NSObjectIKSaveOptionsDelegate::Sealed for NSObject {}
32unsafe impl NSObjectIKSaveOptionsDelegate for NSObject {}
33
34extern_class!(
35    /// The IKSaveOptions class initializes, adds, and manages user interface options for saving image data.
36    ///
37    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/iksaveoptions?language=objc)
38    #[unsafe(super(NSObject))]
39    #[derive(Debug, PartialEq, Eq, Hash)]
40    pub struct IKSaveOptions;
41);
42
43extern_conformance!(
44    unsafe impl NSObjectProtocol for IKSaveOptions {}
45);
46
47impl IKSaveOptions {
48    extern_methods!(
49        /// Delegate of the IKSaveOptions.
50        #[unsafe(method(delegate))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn delegate(&self) -> Option<Retained<AnyObject>>;
53
54        /// Setter for [`delegate`][Self::delegate].
55        #[unsafe(method(setDelegate:))]
56        #[unsafe(method_family = none)]
57        pub unsafe fn setDelegate(&self, delegate: Option<&AnyObject>);
58
59        /// current imageProperties (respecting user UI selection).
60        #[unsafe(method(imageProperties))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn imageProperties(&self) -> Option<Retained<NSDictionary>>;
63
64        /// current imageUTType (respecting user UI selection).
65        #[unsafe(method(imageUTType))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn imageUTType(&self) -> Option<Retained<NSString>>;
68
69        /// information about the UI settings.
70        #[unsafe(method(userSelection))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn userSelection(&self) -> Option<Retained<NSDictionary>>;
73
74        /// Initializes IKSaveOptions with metadata and UTType.
75        #[unsafe(method(initWithImageProperties:imageUTType:))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn initWithImageProperties_imageUTType(
78            this: Allocated<Self>,
79            image_properties: Option<&NSDictionary>,
80            image_ut_type: Option<&NSString>,
81        ) -> Option<Retained<Self>>;
82
83        /// Adds IKSaveOptions UI to a NSSavePanel.
84        #[unsafe(method(addSaveOptionsAccessoryViewToSavePanel:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn addSaveOptionsAccessoryViewToSavePanel(
87            &self,
88            save_panel: Option<&NSSavePanel>,
89        );
90
91        /// Adds IKSaveOptions UI to a NSView.
92        #[unsafe(method(addSaveOptionsToView:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn addSaveOptionsToView(&self, view: Option<&NSView>);
95
96        /// If set, the last used UI choices are preserved for the next time IKSaveOptions is used. [default is YES]
97        #[unsafe(method(rememberLastSetting))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn rememberLastSetting(&self) -> bool;
100
101        /// Setter for [`rememberLastSetting`][Self::rememberLastSetting].
102        #[unsafe(method(setRememberLastSetting:))]
103        #[unsafe(method_family = none)]
104        pub unsafe fn setRememberLastSetting(&self, remember_last_setting: bool);
105    );
106}
107
108/// Methods declared on superclass `NSObject`.
109impl IKSaveOptions {
110    extern_methods!(
111        #[unsafe(method(init))]
112        #[unsafe(method_family = init)]
113        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
114
115        #[unsafe(method(new))]
116        #[unsafe(method_family = new)]
117        pub unsafe fn new() -> Retained<Self>;
118    );
119}