objc2_metric_kit/generated/
MXDisplayMetric.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9extern_class!(
10    /// An MXMetric subclass that encapsulates display metrics.
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/metrickit/mxdisplaymetric?language=objc)
13    #[unsafe(super(MXMetric, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(feature = "MXMetric")]
16    pub struct MXDisplayMetric;
17);
18
19#[cfg(feature = "MXMetric")]
20extern_conformance!(
21    unsafe impl NSCoding for MXDisplayMetric {}
22);
23
24#[cfg(feature = "MXMetric")]
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MXDisplayMetric {}
27);
28
29#[cfg(feature = "MXMetric")]
30extern_conformance!(
31    unsafe impl NSSecureCoding for MXDisplayMetric {}
32);
33
34#[cfg(feature = "MXMetric")]
35impl MXDisplayMetric {
36    extern_methods!(
37        #[cfg(all(feature = "MXAverage", feature = "MXUnit"))]
38        /// Average Pixel Luminance for the application.
39        ///
40        /// APL data ranges from 0-100, in increments of 1.
41        ///
42        /// This value is null when the device does not support APL.
43        ///
44        /// Dimensioned as MXUnitAveragePixelLuminance.
45        #[unsafe(method(averagePixelLuminance))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn averagePixelLuminance(
48            &self,
49        ) -> Option<Retained<MXAverage<MXUnitAveragePixelLuminance>>>;
50    );
51}
52
53/// Methods declared on superclass `NSObject`.
54#[cfg(feature = "MXMetric")]
55impl MXDisplayMetric {
56    extern_methods!(
57        #[unsafe(method(init))]
58        #[unsafe(method_family = init)]
59        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
60
61        #[unsafe(method(new))]
62        #[unsafe(method_family = new)]
63        pub unsafe fn new() -> Retained<Self>;
64    );
65}