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/// The IKFilterUIAddition category to IKFilter provides the API for the Image Unit UI generation.
70///
71/// (comprehensive description)
72#[doc(alias = "IKFilterUIAddition")]
73pub unsafe trait CIFilterIKFilterUIAddition:
74    ClassType + Sized + private_CIFilterIKFilterUIAddition::Sealed
75{
76    extern_methods!(
77        #[cfg(feature = "IKFilterUIView")]
78        /// The viewForUIConfiguration returns a IKFilterView for the filter. The UI is either created by the filter or automatically generated by the CoreImageKit framework.
79        ///
80        /// 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.
81        /// The UIConfiguration dictionary is an NSDictionary with the following defined keys:
82        ///
83        /// Parameter `UIConfiguration`: Dictionary with the IKUISizeFlavor and the kCIUIParameterSet information - see below.
84        ///
85        /// 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
86        ///
87        /// IKUISizeFlavor:
88        ///
89        /// mini:        IKUISizeMini
90        ///
91        /// small:        IKUISizeSmall
92        ///
93        /// regular:    IKUISizeRegular
94        ///
95        /// These sizes follow the size conventions available in Tiger IB
96        ///
97        /// kCIUIParameterSet:
98        ///
99        /// basic:            kCIUISetBasic
100        ///
101        /// intermediate:        kCIUISetIntermediate
102        ///
103        /// advanced:        kCIUISetAdvanced
104        ///
105        /// development:    kCIUISetDevelopment
106        ///
107        /// 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.
108        /// 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.
109        /// 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.
110        /// 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
111        #[unsafe(method(viewForUIConfiguration:excludedKeys:))]
112        #[unsafe(method_family = none)]
113        unsafe fn viewForUIConfiguration_excludedKeys(
114            &self,
115            in_ui_configuration: Option<&NSDictionary>,
116            in_keys: Option<&NSArray>,
117            mtm: MainThreadMarker,
118        ) -> Option<Retained<IKFilterUIView>>;
119    );
120}
121
122#[cfg(feature = "objc2-core-image")]
123impl private_CIFilterIKFilterUIAddition::Sealed for CIFilter {}
124#[cfg(feature = "objc2-core-image")]
125unsafe impl CIFilterIKFilterUIAddition for CIFilter {}
126
127extern_protocol!(
128    /// The IKFilterCustomUIProvider needs to be implemented by a filter to implement its own UI.
129    ///
130    /// When a filter wants to provide its own UI for all or only some configurations, it has to implement the provideViewForUIConfiguration method.
131    ///
132    /// See also [Apple's documentation](https://developer.apple.com/documentation/quartz/ikfiltercustomuiprovider?language=objc)
133    pub unsafe trait IKFilterCustomUIProvider {
134        #[cfg(feature = "IKFilterUIView")]
135        /// The provideViewForUIConfiguration gets called, when a client requests a filter UI by calling viewForUIConfiguration:excludedKeys.
136        ///
137        /// 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.
138        #[unsafe(method(provideViewForUIConfiguration:excludedKeys:))]
139        #[unsafe(method_family = none)]
140        unsafe fn provideViewForUIConfiguration_excludedKeys(
141            &self,
142            in_ui_configuration: Option<&NSDictionary>,
143            in_keys: Option<&NSArray>,
144            mtm: MainThreadMarker,
145        ) -> Option<Retained<IKFilterUIView>>;
146    }
147);