objc2_quartz/generated/ImageKit/
IKFilterUI.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4#[cfg(feature = "objc2-core-image")]
5use objc2_core_image::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern "C" {
11    /// IKUISizeFlavor
12    ///
13    /// Key to request the desired size of controls in a filter UIView - defined values are IKUISizeMini, IKUISizeSmall and IKUISizeRegular.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikuisizeflavor?language=objc)
16    pub static IKUISizeFlavor: Option<&'static NSString>;
17}
18
19extern "C" {
20    /// IKUISizeMini
21    ///
22    /// Constant for requesting controls in mini size.
23    ///
24    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikuisizemini?language=objc)
25    pub static IKUISizeMini: Option<&'static NSString>;
26}
27
28extern "C" {
29    /// IKUISizeSmall
30    ///
31    /// Constant for requesting controls in small size.
32    ///
33    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikuisizesmall?language=objc)
34    pub static IKUISizeSmall: Option<&'static NSString>;
35}
36
37extern "C" {
38    /// IKUISizeRegular
39    ///
40    /// Constant for requesting controls in regular or normal size.
41    ///
42    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikuisizeregular?language=objc)
43    pub static IKUISizeRegular: Option<&'static NSString>;
44}
45
46extern "C" {
47    /// IKUImaxSize
48    ///
49    /// Maximum allowed dimensions of the view for the filter UI. If width or height is zero it means that that dimension of the view is not restricted.
50    ///
51    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikuimaxsize?language=objc)
52    pub static IKUImaxSize: Option<&'static NSString>;
53}
54
55extern "C" {
56    /// IKUIFlavorAllowFallback
57    ///
58    /// Allow the filter to provide a view with controls of a different size and set than requested, if it cannot provide a view for the requested flavor.
59    ///
60    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikuiflavorallowfallback?language=objc)
61    pub static IKUIFlavorAllowFallback: Option<&'static NSString>;
62}
63
64mod private_CIFilterIKFilterUIAddition {
65    pub trait Sealed {}
66}
67
68/// Category "IKFilterUIAddition" on [`CIFilter`].
69///
70/// The IKFilterUIAddition category to IKFilter provides the API for the Image Unit UI generation.
71///
72/// (comprehensive description)
73#[doc(alias = "IKFilterUIAddition")]
74pub unsafe trait CIFilterIKFilterUIAddition:
75    ClassType + Sized + private_CIFilterIKFilterUIAddition::Sealed
76{
77    extern_methods!(
78        #[cfg(feature = "IKFilterUIView")]
79        /// The viewForUIConfiguration returns a IKFilterView for the filter. The UI is either created by the filter or automatically generated by the CoreImageKit framework.
80        ///
81        /// The viewForUIConfiguration first requests that the filter provides a UI by calling provideViewForUIConfiguration. If this method is not implemented or the filter cannot provide a UI for the given configuration, the CoreImageKit framework will generate a UI.
82        /// The UIConfiguration dictionary is an NSDictionary with the following defined keys:
83        ///
84        /// Parameter `UIConfiguration`: Dictionary with the IKUISizeFlavor and the kCIUIParameterSet information - see below.
85        ///
86        /// Parameter `excludedKeys`: An array of keys that should not be included in the view (for example inputImage will often be excluded). This can be nil, if no keys should be excluded
87        ///
88        /// IKUISizeFlavor:
89        ///
90        /// mini:        IKUISizeMini
91        ///
92        /// small:        IKUISizeSmall
93        ///
94        /// regular:    IKUISizeRegular
95        ///
96        /// These sizes follow the size conventions available in Tiger IB
97        ///
98        /// kCIUIParameterSet:
99        ///
100        /// basic:            kCIUISetBasic
101        ///
102        /// intermediate:        kCIUISetIntermediate
103        ///
104        /// advanced:        kCIUISetAdvanced
105        ///
106        /// development:    kCIUISetDevelopment
107        ///
108        /// When a client app requests a UI for a parameter set, all keys for that set and below will be included - example: advanced consists of all parameters in the basic, intermediate and advanced set.
109        /// The development set is targeted towards the development of filters and client apps. Parameters in this set are either experimental or for debugging purposes and should not be shown in a shipping product.
110        /// IKUImaxSize:(NSSize)maxSize;    Maximum allowed dimension of the returned view. If the size requested is too small, the filter is expected to return a view as small as possible. It is up to the client to verify that the returned view fits into his context.
111        /// IKUIFlavorAllowFallback:Boolean    If a requested flavor set-size combination is not supported, the filter can return a view for a different set-size combination. If this is set to no (which is the default), NULL should be returned by the filter
112        ///
113        /// # Safety
114        ///
115        /// - `in_ui_configuration` generic should be of the correct type.
116        /// - `in_ui_configuration` might not allow `None`.
117        /// - `in_keys` generic should be of the correct type.
118        /// - `in_keys` might not allow `None`.
119        #[unsafe(method(viewForUIConfiguration:excludedKeys:))]
120        #[unsafe(method_family = none)]
121        unsafe fn viewForUIConfiguration_excludedKeys(
122            &self,
123            in_ui_configuration: Option<&NSDictionary>,
124            in_keys: Option<&NSArray>,
125            mtm: MainThreadMarker,
126        ) -> Option<Retained<IKFilterUIView>>;
127    );
128}
129
130#[cfg(feature = "objc2-core-image")]
131impl private_CIFilterIKFilterUIAddition::Sealed for CIFilter {}
132#[cfg(feature = "objc2-core-image")]
133unsafe impl CIFilterIKFilterUIAddition for CIFilter {}
134
135extern_protocol!(
136    /// The IKFilterCustomUIProvider needs to be implemented by a filter to implement its own UI.
137    ///
138    /// When a filter wants to provide its own UI for all or only some configurations, it has to implement the provideViewForUIConfiguration method.
139    ///
140    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfiltercustomuiprovider?language=objc)
141    pub unsafe trait IKFilterCustomUIProvider {
142        #[cfg(feature = "IKFilterUIView")]
143        /// The provideViewForUIConfiguration gets called, when a client requests a filter UI by calling viewForUIConfiguration:excludedKeys.
144        ///
145        /// See description in viewForUIConfiguration:excludedKeys for details on the parameters. If a filter cannot provide a IKFilterUIView for a given UIConfiguration, it can return nil and the CoreImageKit framework will try to provide a UI for it instead.
146        ///
147        /// # Safety
148        ///
149        /// - `in_ui_configuration` generic should be of the correct type.
150        /// - `in_ui_configuration` might not allow `None`.
151        /// - `in_keys` generic should be of the correct type.
152        /// - `in_keys` might not allow `None`.
153        #[unsafe(method(provideViewForUIConfiguration:excludedKeys:))]
154        #[unsafe(method_family = none)]
155        unsafe fn provideViewForUIConfiguration_excludedKeys(
156            &self,
157            in_ui_configuration: Option<&NSDictionary>,
158            in_keys: Option<&NSArray>,
159            mtm: MainThreadMarker,
160        ) -> Option<Retained<IKFilterUIView>>;
161    }
162);