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 NSFormattingContext {
        NSFormattingContextUnknown = 0,
        NSFormattingContextDynamic = 1,
        NSFormattingContextStandalone = 2,
        NSFormattingContextListItem = 3,
        NSFormattingContextBeginningOfSentence = 4,
        NSFormattingContextMiddleOfSentence = 5,
    }
);

ns_enum!(
    #[underlying(NSInteger)]
    pub enum NSFormattingUnitStyle {
        NSFormattingUnitStyleShort = 1,
        NSFormattingUnitStyleMedium = 2,
        NSFormattingUnitStyleLong = 3,
    }
);

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

    unsafe impl ClassType for NSFormatter {
        type Super = NSObject;
    }
);

extern_methods!(
    unsafe impl NSFormatter {
        #[method_id(@__retain_semantics Other stringForObjectValue:)]
        pub unsafe fn stringForObjectValue(
            &self,
            obj: Option<&Object>,
        ) -> Option<Id<NSString, Shared>>;

        #[method_id(@__retain_semantics Other attributedStringForObjectValue:withDefaultAttributes:)]
        pub unsafe fn attributedStringForObjectValue_withDefaultAttributes(
            &self,
            obj: &Object,
            attrs: Option<&NSDictionary<NSAttributedStringKey, Object>>,
        ) -> Option<Id<NSAttributedString, Shared>>;

        #[method_id(@__retain_semantics Other editingStringForObjectValue:)]
        pub unsafe fn editingStringForObjectValue(
            &self,
            obj: &Object,
        ) -> Option<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;

        #[method(isPartialStringValid:newEditingString:errorDescription:)]
        pub unsafe fn isPartialStringValid_newEditingString_errorDescription(
            &self,
            partialString: &NSString,
            newString: *mut *mut NSString,
            error: *mut *mut NSString,
        ) -> bool;

        #[method(isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:)]
        pub unsafe fn isPartialStringValid_proposedSelectedRange_originalString_originalSelectedRange_errorDescription(
            &self,
            partialStringPtr: NonNull<NonNull<NSString>>,
            proposedSelRangePtr: NSRangePointer,
            origString: &NSString,
            origSelRange: NSRange,
            error: *mut *mut NSString,
        ) -> bool;
    }
);