view dwt/internal/cocoa/NSNumberFormatter.d @ 13:f565d3a95c0a

Ported dwt.internal
author Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com>
date Fri, 22 Aug 2008 16:46:34 +0200
parents 8b48be5454ce
children d8635bb48c7c
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2007 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     
 * Port to the D programming language:
 *     Jacob Carlborg <jacob.carlborg@gmail.com>
 *******************************************************************************/
module dwt.internal.cocoa.NSNumberFormatter;

import dwt.internal.cocoa.CFNumberFormatter;
import dwt.internal.cocoa.NSAttributedString;
import dwt.internal.cocoa.NSDecimalNumberHandler;
import dwt.internal.cocoa.NSDictionary;
import dwt.internal.cocoa.NSFormatter;
import dwt.internal.cocoa.NSInteger;
import dwt.internal.cocoa.NSLocale;
import dwt.internal.cocoa.NSNumber;
import dwt.internal.cocoa.NSString;
import dwt.internal.cocoa.OS;
import objc = dwt.internal.objc.runtime;

enum NSNumberFormatterBehavior : NSUInteger
{
    NSNumberFormatterBehaviorDefault = 0,
    NSNumberFormatterBehavior10_0 = 1000,
    NSNumberFormatterBehavior10_4 = 1040,
}

alias NSNumberFormatterBehavior.NSNumberFormatterBehaviorDefault NSNumberFormatterBehaviorDefault;
alias NSNumberFormatterBehavior.NSNumberFormatterBehavior10_0 NSNumberFormatterBehavior10_0;
alias NSNumberFormatterBehavior.NSNumberFormatterBehavior10_4 NSNumberFormatterBehavior10_4;

enum NSNumberFormatterPadPosition : NSUInteger
{
    NSNumberFormatterPadBeforePrefix = kCFNumberFormatterPadBeforePrefix,
    NSNumberFormatterPadAfterPrefix = kCFNumberFormatterPadAfterPrefix,
    NSNumberFormatterPadBeforeSuffix = kCFNumberFormatterPadBeforeSuffix,
    NSNumberFormatterPadAfterSuffix = 3//kCFNumberFormatterPadAfterSuffix
}

alias NSNumberFormatterPadPosition.NSNumberFormatterPadBeforePrefix NSNumberFormatterPadBeforePrefix;
alias NSNumberFormatterPadPosition.NSNumberFormatterPadAfterPrefix NSNumberFormatterPadAfterPrefix;
alias NSNumberFormatterPadPosition.NSNumberFormatterPadBeforeSuffix NSNumberFormatterPadBeforeSuffix;
alias NSNumberFormatterPadPosition.NSNumberFormatterPadAfterSuffix NSNumberFormatterPadAfterSuffix;

enum 
{
    NSNumberFormatterRoundCeiling = kCFNumberFormatterRoundCeiling,
    NSNumberFormatterRoundFloor = kCFNumberFormatterRoundFloor,
    NSNumberFormatterRoundDown = kCFNumberFormatterRoundDown,
    NSNumberFormatterRoundUp = kCFNumberFormatterRoundUp,
    NSNumberFormatterRoundHalfEven = kCFNumberFormatterRoundHalfEven,
    NSNumberFormatterRoundHalfDown = kCFNumberFormatterRoundHalfDown,
    NSNumberFormatterRoundHalfUp = kCFNumberFormatterRoundHalfUp
}

alias NSUInteger NSNumberFormatterRoundingMode;

/*alias NSNumberFormatterRoundingMode.NSNumberFormatterRoundCeiling NSNumberFormatterRoundCeiling;
alias NSNumberFormatterRoundingMode.NSNumberFormatterRoundFloor NSNumberFormatterRoundFloor;
alias NSNumberFormatterRoundingMode.NSNumberFormatterRoundDown NSNumberFormatterRoundDown;
alias NSNumberFormatterRoundingMode.NSNumberFormatterRoundUp NSNumberFormatterRoundUp;
alias NSNumberFormatterRoundingMode.NSNumberFormatterRoundHalfEven NSNumberFormatterRoundHalfEven;
alias NSNumberFormatterRoundingMode.NSNumberFormatterRoundHalfDown NSNumberFormatterRoundCeiling;
alias NSNumberFormatterRoundingMode.NSNumberFormatterRoundHalfUp NSNumberFormatterRoundHalfUp;*/

enum NSNumberFormatterStyle : NSUInteger
{
    NSNumberFormatterNoStyle = kCFNumberFormatterNoStyle,
    NSNumberFormatterDecimalStyle = kCFNumberFormatterDecimalStyle,
    NSNumberFormatterCurrencyStyle = kCFNumberFormatterCurrencyStyle,
    NSNumberFormatterPercentStyle = kCFNumberFormatterPercentStyle,
    NSNumberFormatterScientificStyle = kCFNumberFormatterScientificStyle,
    NSNumberFormatterSpellOutStyle = kCFNumberFormatterSpellOutStyle
}

alias NSNumberFormatterStyle.NSNumberFormatterNoStyle NSNumberFormatterNoStyle;
alias NSNumberFormatterStyle.NSNumberFormatterDecimalStyle NSNumberFormatterDecimalStyle;
alias NSNumberFormatterStyle.NSNumberFormatterCurrencyStyle NSNumberFormatterCurrencyStyle;
alias NSNumberFormatterStyle.NSNumberFormatterPercentStyle NSNumberFormatterPercentStyle;
alias NSNumberFormatterStyle.NSNumberFormatterScientificStyle NSNumberFormatterScientificStyle;
alias NSNumberFormatterStyle.NSNumberFormatterSpellOutStyle NSNumberFormatterSpellOutStyle;

public class NSNumberFormatter : NSFormatter
{

    public this ()
    {
        super();
    }

    public this (objc.id id)
    {
        super(id);
    }

    public bool allowsFloats ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_allowsFloats) !is null;
    }

    public bool alwaysShowsDecimalSeparator ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_alwaysShowsDecimalSeparator) !is null;
    }

    public NSAttributedString attributedStringForNil ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributedStringForNil);
        return result !is null ? new NSAttributedString(result) : null;
    }

    public NSAttributedString attributedStringForNotANumber ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributedStringForNotANumber);
        return result !is null ? new NSAttributedString(result) : null;
    }

    public NSAttributedString attributedStringForZero ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_attributedStringForZero);
        return result !is null ? new NSAttributedString(result) : null;
    }

    public NSString currencyCode ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_currencyCode);
        return result !is null ? new NSString(result) : null;
    }

    public NSString currencyDecimalSeparator ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_currencyDecimalSeparator);
        return result !is null ? new NSString(result) : null;
    }

    public NSString currencyGroupingSeparator ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_currencyGroupingSeparator);
        return result !is null ? new NSString(result) : null;
    }

    public NSString currencySymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_currencySymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSString decimalSeparator ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_decimalSeparator);
        return result !is null ? new NSString(result) : null;
    }

    public static NSNumberFormatterBehavior defaultFormatterBehavior ()
    {
        return cast(NSNumberFormatterBehavior) OS.objc_msgSend(OS.class_NSNumberFormatter, OS.sel_defaultFormatterBehavior);
    }

    public NSString exponentSymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_exponentSymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSString format ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_format);
        return result !is null ? new NSString(result) : null;
    }

    public NSUInteger formatWidth ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_formatWidth);
    }

    public NSNumberFormatterBehavior formatterBehavior ()
    {
        return cast(NSNumberFormatterBehavior) OS.objc_msgSend(this.id_, OS.sel_formatterBehavior);
    }

    public bool generatesDecimalNumbers ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_generatesDecimalNumbers) !is null;
    }

    public bool getObjectValue (/*out*/objc.id* obj, NSString str, /*inout NSRange* */objc.id* rangep, /*out NSError** */objc.id** error)
    {
        return OS.objc_msgSend(this.id_, OS.sel_getObjectValue_1forString_1range_1error_1, obj, str !is null ? str.id_ : null, rangep, error) !is null;
    }

    public NSString groupingSeparator ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_groupingSeparator);
        return result !is null ? new NSString(result) : null;
    }

    public NSUInteger groupingSize ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_groupingSize);
    }

    public bool hasThousandSeparators ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_hasThousandSeparators) !is null;
    }

    public NSString internationalCurrencySymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_internationalCurrencySymbol);
        return result !is null ? new NSString(result) : null;
    }

    public bool isLenient ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isLenient) !is null;
    }

    public bool isPartialStringValidationEnabled ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_isPartialStringValidationEnabled) !is null;
    }

    public NSLocale locale ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_locale);
        return result !is null ? new NSLocale(result) : null;
    }

    public bool localizesFormat ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_localizesFormat) !is null;
    }

    public NSNumber maximum ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_maximum);
        return result !is null ? new NSNumber(result) : null;
    }

    public NSUInteger maximumFractionDigits ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_maximumFractionDigits);
    }

    public NSUInteger maximumIntegerDigits ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_maximumIntegerDigits);
    }

    public NSUInteger maximumSignificantDigits ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_maximumSignificantDigits);
    }

    public NSNumber minimum ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_minimum);
        return result !is null ? new NSNumber(result) : null;
    }

    public NSUInteger minimumFractionDigits ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_minimumFractionDigits);
    }

    public NSUInteger minimumIntegerDigits ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_minimumIntegerDigits);
    }

    public NSUInteger minimumSignificantDigits ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_minimumSignificantDigits);
    }

    public NSString minusSign ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_minusSign);
        return result !is null ? new NSString(result) : null;
    }

    public NSNumber multiplier ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_multiplier);
        return result !is null ? new NSNumber(result) : null;
    }

    public NSString negativeFormat ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_negativeFormat);
        return result !is null ? new NSString(result) : null;
    }

    public NSString negativeInfinitySymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_negativeInfinitySymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSString negativePrefix ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_negativePrefix);
        return result !is null ? new NSString(result) : null;
    }

    public NSString negativeSuffix ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_negativeSuffix);
        return result !is null ? new NSString(result) : null;
    }

    public NSString nilSymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_nilSymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSString notANumberSymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_notANumberSymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSNumber numberFromString (NSString string)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_numberFromString_1, string !is null ? string.id_ : null);
        return result !is null ? new NSNumber(result) : null;
    }

    public NSNumberFormatterStyle numberStyle ()
    {
        return cast(NSNumberFormatterStyle) OS.objc_msgSend(this.id_, OS.sel_numberStyle);
    }

    public NSString paddingCharacter ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_paddingCharacter);
        return result !is null ? new NSString(result) : null;
    }

    public NSNumberFormatterPadPosition paddingPosition ()
    {
        return cast(NSNumberFormatterPadPosition) OS.objc_msgSend(this.id_, OS.sel_paddingPosition);
    }

    public NSString perMillSymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_perMillSymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSString percentSymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_percentSymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSString plusSign ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_plusSign);
        return result !is null ? new NSString(result) : null;
    }

    public NSString positiveFormat ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_positiveFormat);
        return result !is null ? new NSString(result) : null;
    }

    public NSString positiveInfinitySymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_positiveInfinitySymbol);
        return result !is null ? new NSString(result) : null;
    }

    public NSString positivePrefix ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_positivePrefix);
        return result !is null ? new NSString(result) : null;
    }

    public NSString positiveSuffix ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_positiveSuffix);
        return result !is null ? new NSString(result) : null;
    }

    public NSDecimalNumberHandler roundingBehavior ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_roundingBehavior);
        return result !is null ? new NSDecimalNumberHandler(result) : null;
    }

    public NSNumber roundingIncrement ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_roundingIncrement);
        return result !is null ? new NSNumber(result) : null;
    }

    public NSNumberFormatterRoundingMode roundingMode ()
    {
        return cast(NSNumberFormatterRoundingMode) OS.objc_msgSend(this.id_, OS.sel_roundingMode);
    }

    public NSUInteger secondaryGroupingSize ()
    {
        return cast(NSUInteger) OS.objc_msgSend(this.id_, OS.sel_secondaryGroupingSize);
    }

    public void setAllowsFloats (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAllowsFloats_1, flag);
    }

    public void setAlwaysShowsDecimalSeparator (bool b)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAlwaysShowsDecimalSeparator_1, b);
    }

    public void setAttributedStringForNil (NSAttributedString newAttributedString)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAttributedStringForNil_1, newAttributedString !is null ? newAttributedString.id_ : null);
    }

    public void setAttributedStringForNotANumber (NSAttributedString newAttributedString)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAttributedStringForNotANumber_1, newAttributedString !is null ? newAttributedString.id_ : null);
    }

    public void setAttributedStringForZero (NSAttributedString newAttributedString)
    {
        OS.objc_msgSend(this.id_, OS.sel_setAttributedStringForZero_1, newAttributedString !is null ? newAttributedString.id_ : null);
    }

    public void setCurrencyCode (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setCurrencyCode_1, string !is null ? string.id_ : null);
    }

    public void setCurrencyDecimalSeparator (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setCurrencyDecimalSeparator_1, string !is null ? string.id_ : null);
    }

    public void setCurrencyGroupingSeparator (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setCurrencyGroupingSeparator_1, string !is null ? string.id_ : null);
    }

    public void setCurrencySymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setCurrencySymbol_1, string !is null ? string.id_ : null);
    }

    public void setDecimalSeparator (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setDecimalSeparator_1, string !is null ? string.id_ : null);
    }

    public static void setDefaultFormatterBehavior (NSNumberFormatterBehavior behavior)
    {
        OS.objc_msgSend(OS.class_NSNumberFormatter, OS.sel_setDefaultFormatterBehavior_1, behavior);
    }

    public void setExponentSymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setExponentSymbol_1, string !is null ? string.id_ : null);
    }

    public void setFormat (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setFormat_1, string !is null ? string.id_ : null);
    }

    public void setFormatWidth (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setFormatWidth_1, number);
    }

    public void setFormatterBehavior (NSNumberFormatterBehavior behavior)
    {
        OS.objc_msgSend(this.id_, OS.sel_setFormatterBehavior_1, behavior);
    }

    public void setGeneratesDecimalNumbers (bool b)
    {
        OS.objc_msgSend(this.id_, OS.sel_setGeneratesDecimalNumbers_1, b);
    }

    public void setGroupingSeparator (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setGroupingSeparator_1, string !is null ? string.id_ : null);
    }

    public void setGroupingSize (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setGroupingSize_1, number);
    }

    public void setHasThousandSeparators (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setHasThousandSeparators_1, flag);
    }

    public void setInternationalCurrencySymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setInternationalCurrencySymbol_1, string !is null ? string.id_ : null);
    }

    public void setLenient (bool b)
    {
        OS.objc_msgSend(this.id_, OS.sel_setLenient_1, b);
    }

    public void setLocale (NSLocale locale)
    {
        OS.objc_msgSend(this.id_, OS.sel_setLocale_1, locale !is null ? locale.id_ : null);
    }

    public void setLocalizesFormat (bool flag)
    {
        OS.objc_msgSend(this.id_, OS.sel_setLocalizesFormat_1, flag);
    }

    public void setMaximum (NSNumber number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMaximum_1, number !is null ? number.id_ : null);
    }

    public void setMaximumFractionDigits (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMaximumFractionDigits_1, number);
    }

    public void setMaximumIntegerDigits (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMaximumIntegerDigits_1, number);
    }

    public void setMaximumSignificantDigits (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMaximumSignificantDigits_1, number);
    }

    public void setMinimum (NSNumber number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMinimum_1, number !is null ? number.id_ : null);
    }

    public void setMinimumFractionDigits (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMinimumFractionDigits_1, number);
    }

    public void setMinimumIntegerDigits (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMinimumIntegerDigits_1, number);
    }

    public void setMinimumSignificantDigits (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMinimumSignificantDigits_1, number);
    }

    public void setMinusSign (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMinusSign_1, string !is null ? string.id_ : null);
    }

    public void setMultiplier (NSNumber number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setMultiplier_1, number !is null ? number.id_ : null);
    }

    public void setNegativeFormat (NSString format)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNegativeFormat_1, format !is null ? format.id_ : null);
    }

    public void setNegativeInfinitySymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNegativeInfinitySymbol_1, string !is null ? string.id_ : null);
    }

    public void setNegativePrefix (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNegativePrefix_1, string !is null ? string.id_ : null);
    }

    public void setNegativeSuffix (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNegativeSuffix_1, string !is null ? string.id_ : null);
    }

    public void setNilSymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNilSymbol_1, string !is null ? string.id_ : null);
    }

    public void setNotANumberSymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNotANumberSymbol_1, string !is null ? string.id_ : null);
    }

    public void setNumberStyle (NSNumberFormatterStyle style)
    {
        OS.objc_msgSend(this.id_, OS.sel_setNumberStyle_1, style);
    }

    public void setPaddingCharacter (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPaddingCharacter_1, string !is null ? string.id_ : null);
    }

    public void setPaddingPosition (NSNumberFormatterPadPosition position)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPaddingPosition_1, position);
    }

    public void setPartialStringValidationEnabled (bool b)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPartialStringValidationEnabled_1, b);
    }

    public void setPerMillSymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPerMillSymbol_1, string !is null ? string.id_ : null);
    }

    public void setPercentSymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPercentSymbol_1, string !is null ? string.id_ : null);
    }

    public void setPlusSign (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPlusSign_1, string !is null ? string.id_ : null);
    }

    public void setPositiveFormat (NSString format)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPositiveFormat_1, format !is null ? format.id_ : null);
    }

    public void setPositiveInfinitySymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPositiveInfinitySymbol_1, string !is null ? string.id_ : null);
    }

    public void setPositivePrefix (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPositivePrefix_1, string !is null ? string.id_ : null);
    }

    public void setPositiveSuffix (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setPositiveSuffix_1, string !is null ? string.id_ : null);
    }

    public void setRoundingBehavior (NSDecimalNumberHandler newRoundingBehavior)
    {
        OS.objc_msgSend(this.id_, OS.sel_setRoundingBehavior_1, newRoundingBehavior !is null ? newRoundingBehavior.id_ : null);
    }

    public void setRoundingIncrement (NSNumber number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setRoundingIncrement_1, number !is null ? number.id_ : null);
    }

    public void setRoundingMode (NSNumberFormatterRoundingMode mode)
    {
        OS.objc_msgSend(this.id_, OS.sel_setRoundingMode_1, mode);
    }

    public void setSecondaryGroupingSize (NSUInteger number)
    {
        OS.objc_msgSend(this.id_, OS.sel_setSecondaryGroupingSize_1, number);
    }

    public void setTextAttributesForNegativeInfinity (NSDictionary newAttributes)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextAttributesForNegativeInfinity_1, newAttributes !is null ? newAttributes.id_ : null);
    }

    public void setTextAttributesForNegativeValues (NSDictionary newAttributes)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextAttributesForNegativeValues_1, newAttributes !is null ? newAttributes.id_ : null);
    }

    public void setTextAttributesForNil (NSDictionary newAttributes)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextAttributesForNil_1, newAttributes !is null ? newAttributes.id_ : null);
    }

    public void setTextAttributesForNotANumber (NSDictionary newAttributes)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextAttributesForNotANumber_1, newAttributes !is null ? newAttributes.id_ : null);
    }

    public void setTextAttributesForPositiveInfinity (NSDictionary newAttributes)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextAttributesForPositiveInfinity_1, newAttributes !is null ? newAttributes.id_ : null);
    }

    public void setTextAttributesForPositiveValues (NSDictionary newAttributes)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextAttributesForPositiveValues_1, newAttributes !is null ? newAttributes.id_ : null);
    }

    public void setTextAttributesForZero (NSDictionary newAttributes)
    {
        OS.objc_msgSend(this.id_, OS.sel_setTextAttributesForZero_1, newAttributes !is null ? newAttributes.id_ : null);
    }

    public void setThousandSeparator (NSString newSeparator)
    {
        OS.objc_msgSend(this.id_, OS.sel_setThousandSeparator_1, newSeparator !is null ? newSeparator.id_ : null);
    }

    public void setUsesGroupingSeparator (bool b)
    {
        OS.objc_msgSend(this.id_, OS.sel_setUsesGroupingSeparator_1, b);
    }

    public void setUsesSignificantDigits (bool b)
    {
        OS.objc_msgSend(this.id_, OS.sel_setUsesSignificantDigits_1, b);
    }

    public void setZeroSymbol (NSString string)
    {
        OS.objc_msgSend(this.id_, OS.sel_setZeroSymbol_1, string !is null ? string.id_ : null);
    }

    public NSString stringFromNumber (NSNumber number)
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_stringFromNumber_1, number !is null ? number.id_ : null);
        return result !is null ? new NSString(result) : null;
    }

    public NSDictionary textAttributesForNegativeInfinity ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textAttributesForNegativeInfinity);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSDictionary textAttributesForNegativeValues ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textAttributesForNegativeValues);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSDictionary textAttributesForNil ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textAttributesForNil);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSDictionary textAttributesForNotANumber ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textAttributesForNotANumber);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSDictionary textAttributesForPositiveInfinity ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textAttributesForPositiveInfinity);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSDictionary textAttributesForPositiveValues ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textAttributesForPositiveValues);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSDictionary textAttributesForZero ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_textAttributesForZero);
        return result !is null ? new NSDictionary(result) : null;
    }

    public NSString thousandSeparator ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_thousandSeparator);
        return result !is null ? new NSString(result) : null;
    }

    public bool usesGroupingSeparator ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_usesGroupingSeparator) !is null;
    }

    public bool usesSignificantDigits ()
    {
        return OS.objc_msgSend(this.id_, OS.sel_usesSignificantDigits) !is null;
    }

    public NSString zeroSymbol ()
    {
        objc.id result = OS.objc_msgSend(this.id_, OS.sel_zeroSymbol);
        return result !is null ? new NSString(result) : null;
    }

}