icrate 0.1.2

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(NSUInteger)]
    pub enum NSDateIntervalFormatterStyle {
        NSDateIntervalFormatterNoStyle = 0,
        NSDateIntervalFormatterShortStyle = 1,
        NSDateIntervalFormatterMediumStyle = 2,
        NSDateIntervalFormatterLongStyle = 3,
        NSDateIntervalFormatterFullStyle = 4,
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "Foundation_NSDateIntervalFormatter")]
    pub struct NSDateIntervalFormatter;

    #[cfg(feature = "Foundation_NSDateIntervalFormatter")]
    unsafe impl ClassType for NSDateIntervalFormatter {
        #[inherits(NSObject)]
        type Super = NSFormatter;
        type Mutability = InteriorMutable;
    }
);

#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl Send for NSDateIntervalFormatter {}

#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl Sync for NSDateIntervalFormatter {}

#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl NSCoding for NSDateIntervalFormatter {}

#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl NSCopying for NSDateIntervalFormatter {}

#[cfg(feature = "Foundation_NSDateIntervalFormatter")]
unsafe impl NSObjectProtocol for NSDateIntervalFormatter {}

extern_methods!(
    #[cfg(feature = "Foundation_NSDateIntervalFormatter")]
    unsafe impl NSDateIntervalFormatter {
        #[cfg(feature = "Foundation_NSLocale")]
        #[method_id(@__retain_semantics Other locale)]
        pub unsafe fn locale(&self) -> Id<NSLocale>;

        #[cfg(feature = "Foundation_NSLocale")]
        #[method(setLocale:)]
        pub unsafe fn setLocale(&self, locale: Option<&NSLocale>);

        #[cfg(feature = "Foundation_NSCalendar")]
        #[method_id(@__retain_semantics Other calendar)]
        pub unsafe fn calendar(&self) -> Id<NSCalendar>;

        #[cfg(feature = "Foundation_NSCalendar")]
        #[method(setCalendar:)]
        pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>);

        #[cfg(feature = "Foundation_NSTimeZone")]
        #[method_id(@__retain_semantics Other timeZone)]
        pub unsafe fn timeZone(&self) -> Id<NSTimeZone>;

        #[cfg(feature = "Foundation_NSTimeZone")]
        #[method(setTimeZone:)]
        pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);

        #[cfg(feature = "Foundation_NSString")]
        #[method_id(@__retain_semantics Other dateTemplate)]
        pub unsafe fn dateTemplate(&self) -> Id<NSString>;

        #[cfg(feature = "Foundation_NSString")]
        #[method(setDateTemplate:)]
        pub unsafe fn setDateTemplate(&self, date_template: Option<&NSString>);

        #[method(dateStyle)]
        pub unsafe fn dateStyle(&self) -> NSDateIntervalFormatterStyle;

        #[method(setDateStyle:)]
        pub unsafe fn setDateStyle(&self, date_style: NSDateIntervalFormatterStyle);

        #[method(timeStyle)]
        pub unsafe fn timeStyle(&self) -> NSDateIntervalFormatterStyle;

        #[method(setTimeStyle:)]
        pub unsafe fn setTimeStyle(&self, time_style: NSDateIntervalFormatterStyle);

        #[cfg(all(feature = "Foundation_NSDate", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other stringFromDate:toDate:)]
        pub unsafe fn stringFromDate_toDate(
            &self,
            from_date: &NSDate,
            to_date: &NSDate,
        ) -> Id<NSString>;

        #[cfg(all(feature = "Foundation_NSDateInterval", feature = "Foundation_NSString"))]
        #[method_id(@__retain_semantics Other stringFromDateInterval:)]
        pub unsafe fn stringFromDateInterval(
            &self,
            date_interval: &NSDateInterval,
        ) -> Option<Id<NSString>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(feature = "Foundation_NSDateIntervalFormatter")]
    unsafe impl NSDateIntervalFormatter {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Id<Self>;
    }
);