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_options!(
    #[underlying(NSUInteger)]
    pub enum NSISO8601DateFormatOptions {
        NSISO8601DateFormatWithYear = 1,
        NSISO8601DateFormatWithMonth = 2,
        NSISO8601DateFormatWithWeekOfYear = 4,
        NSISO8601DateFormatWithDay = 16,
        NSISO8601DateFormatWithTime = 32,
        NSISO8601DateFormatWithTimeZone = 64,
        NSISO8601DateFormatWithSpaceBetweenDateAndTime = 128,
        NSISO8601DateFormatWithDashSeparatorInDate = 256,
        NSISO8601DateFormatWithColonSeparatorInTime = 512,
        NSISO8601DateFormatWithColonSeparatorInTimeZone = 1024,
        NSISO8601DateFormatWithFractionalSeconds = 2048,
        NSISO8601DateFormatWithFullDate = 275,
        NSISO8601DateFormatWithFullTime = 1632,
        NSISO8601DateFormatWithInternetDateTime = 1907,
    }
);

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

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

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

        #[method(setTimeZone:)]
        pub unsafe fn setTimeZone(&self, timeZone: Option<&NSTimeZone>);

        #[method(formatOptions)]
        pub unsafe fn formatOptions(&self) -> NSISO8601DateFormatOptions;

        #[method(setFormatOptions:)]
        pub unsafe fn setFormatOptions(&self, formatOptions: NSISO8601DateFormatOptions);

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Option<Allocated<Self>>) -> Id<Self, Shared>;

        #[method_id(@__retain_semantics Other stringFromDate:)]
        pub unsafe fn stringFromDate(&self, date: &NSDate) -> Id<NSString, Shared>;

        #[method_id(@__retain_semantics Other dateFromString:)]
        pub unsafe fn dateFromString(&self, string: &NSString) -> Option<Id<NSDate, Shared>>;

        #[method_id(@__retain_semantics Other stringFromDate:timeZone:formatOptions:)]
        pub unsafe fn stringFromDate_timeZone_formatOptions(
            date: &NSDate,
            timeZone: &NSTimeZone,
            formatOptions: NSISO8601DateFormatOptions,
        ) -> Id<NSString, Shared>;
    }
);