icrate 0.0.1

Bindings to Apple's frameworks
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use crate::common::*;
use crate::Foundation::*;

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSLengthFormatterUnit {
        NSLengthFormatterUnitMillimeter = 8,
        NSLengthFormatterUnitCentimeter = 9,
        NSLengthFormatterUnitMeter = 11,
        NSLengthFormatterUnitKilometer = 14,
        NSLengthFormatterUnitInch = (5 << 8) + 1,
        NSLengthFormatterUnitFoot = (5 << 8) + 2,
        NSLengthFormatterUnitYard = (5 << 8) + 3,
        NSLengthFormatterUnitMile = (5 << 8) + 4,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSLengthFormatter;

    unsafe impl ClassType for NSLengthFormatter {
        #[inherits(NSObject)]
        type Super = NSFormatter;
    }
);

extern_methods!(
    unsafe impl NSLengthFormatter {
        #[method_id(@__retain_semantics Other numberFormatter)]
        pub unsafe fn numberFormatter(&self) -> Id<NSNumberFormatter, Shared>;

        #[method(setNumberFormatter:)]
        pub unsafe fn setNumberFormatter(&self, numberFormatter: Option<&NSNumberFormatter>);

        #[method(unitStyle)]
        pub unsafe fn unitStyle(&self) -> NSFormattingUnitStyle;

        #[method(setUnitStyle:)]
        pub unsafe fn setUnitStyle(&self, unitStyle: NSFormattingUnitStyle);

        #[method(isForPersonHeightUse)]
        pub unsafe fn isForPersonHeightUse(&self) -> bool;

        #[method(setForPersonHeightUse:)]
        pub unsafe fn setForPersonHeightUse(&self, forPersonHeightUse: bool);

        #[method_id(@__retain_semantics Other stringFromValue:unit:)]
        pub unsafe fn stringFromValue_unit(
            &self,
            value: c_double,
            unit: NSLengthFormatterUnit,
        ) -> Id<NSString, Shared>;

        #[method_id(@__retain_semantics Other stringFromMeters:)]
        pub unsafe fn stringFromMeters(&self, numberInMeters: c_double) -> Id<NSString, Shared>;

        #[method_id(@__retain_semantics Other unitStringFromValue:unit:)]
        pub unsafe fn unitStringFromValue_unit(
            &self,
            value: c_double,
            unit: NSLengthFormatterUnit,
        ) -> Id<NSString, Shared>;

        #[method_id(@__retain_semantics Other unitStringFromMeters:usedUnit:)]
        pub unsafe fn unitStringFromMeters_usedUnit(
            &self,
            numberInMeters: c_double,
            unitp: *mut NSLengthFormatterUnit,
        ) -> Id<NSString, Shared>;

        #[method(getObjectValue:forString:errorDescription:)]
        pub unsafe fn getObjectValue_forString_errorDescription(
            &self,
            obj: *mut *mut Object,
            string: &NSString,
            error: *mut *mut NSString,
        ) -> bool;
    }
);