objc2_av_foundation/generated/
AVCaptureSystemZoomSlider.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8
9use crate::*;
10
11extern_class!(
12    /// The system's recommended continuous zoom control for `-[AVCaptureDevice videoZoomFactor]`.
13    ///
14    ///
15    /// `AVCaptureSystemZoomSlider` uses the range specified by the `systemRecommendedVideoZoomRange` on the `activeFormat` from the `AVCaptureDevice` specified during initialization. As the device's `activeFormat` changes, the slider updates its range with the new format's `systemRecommendedVideoZoomRange`.
16    ///
17    /// Controls may be added to an `AVCaptureSession` using `-[AVCaptureSession addControl:]`.
18    ///
19    /// See also [Apple's documentation](https://developer.apple.com/documentation/avfoundation/avcapturesystemzoomslider?language=objc)
20    #[unsafe(super(AVCaptureControl, NSObject))]
21    #[derive(Debug, PartialEq, Eq, Hash)]
22    #[cfg(feature = "AVCaptureControl")]
23    pub struct AVCaptureSystemZoomSlider;
24);
25
26#[cfg(feature = "AVCaptureControl")]
27extern_conformance!(
28    unsafe impl NSObjectProtocol for AVCaptureSystemZoomSlider {}
29);
30
31#[cfg(feature = "AVCaptureControl")]
32impl AVCaptureSystemZoomSlider {
33    extern_methods!(
34        #[cfg(feature = "AVCaptureDevice")]
35        /// Initializes an `AVCaptureSystemZoomSlider` for controlling `device`.
36        ///
37        ///
38        /// Parameter `device`: The device to control.
39        ///
40        ///
41        /// `AVCaptureSystemZoomSlider` may only be initialized with `AVCaptureDevice` instances that support setting `videoZoomFactor`, otherwise an `NSInvalidArgumentException` is thrown.
42        #[unsafe(method(initWithDevice:))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn initWithDevice(
45            this: Allocated<Self>,
46            device: &AVCaptureDevice,
47        ) -> Retained<Self>;
48
49        #[cfg(all(
50            feature = "AVCaptureDevice",
51            feature = "block2",
52            feature = "objc2-core-foundation"
53        ))]
54        /// Initializes an `AVCaptureSystemZoomSlider` for controlling `device` with a `
55        /// MainThreadOnly` `action` for handling `videoZoomFactor` changes.
56        ///
57        ///
58        /// Parameter `device`: The device to control.
59        ///
60        /// Parameter `action`: An action called on `
61        /// MainThreadOnly` to handle `videoZoomFactor` changes by `AVCaptureSystemZoomSlider`.
62        ///
63        ///
64        /// `action` is **only** called when `videoZoomFactor` is changed by this control. Clients should not change `videoZoomFactor` on the device when `action` is called.
65        ///
66        /// If you need to react to other sources of `videoZoomFactor` changes like `rampToVideoZoomFactor:withRate:` you will still need to use key-value observation.
67        ///
68        /// `AVCaptureSystemZoomSlider` may only be initialized with `AVCaptureDevice` instances that support setting `videoZoomFactor`, otherwise an `NSInvalidArgumentException` is thrown.
69        #[unsafe(method(initWithDevice:action:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithDevice_action(
72            this: Allocated<Self>,
73            device: &AVCaptureDevice,
74            action: &block2::DynBlock<dyn Fn(CGFloat)>,
75        ) -> Retained<Self>;
76    );
77}
78
79/// Methods declared on superclass `AVCaptureControl`.
80#[cfg(feature = "AVCaptureControl")]
81impl AVCaptureSystemZoomSlider {
82    extern_methods!(
83        #[unsafe(method(init))]
84        #[unsafe(method_family = init)]
85        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
86
87        #[unsafe(method(new))]
88        #[unsafe(method_family = new)]
89        pub unsafe fn new() -> Retained<Self>;
90    );
91}