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