home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / Foundation.framework / Versions / B / Headers / NSNumberFormatter.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-25  |  3.0 KB  |  89 lines

  1. /*    NSNumberFormatter.h
  2.     Copyright 1996, NeXT Software, Inc.  All rights reserved.
  3. */
  4.  
  5. #if !defined(STRICT_OPENSTEP)
  6.  
  7. #import <Foundation/NSFormatter.h>
  8.  
  9. @class NSDecimalNumber, NSAttributedString, NSDictionary, NString;
  10. @class NSDecimalNumberHandler;
  11.  
  12. @interface NSNumberFormatter : NSFormatter {
  13. @private
  14.     NSString               *_negativeFormat;
  15.     NSString               *_positiveFormat;
  16.     NSDictionary           *_negativeAttributes;
  17.     NSDictionary           *_positiveAttributes;
  18.     NSAttributedString     *_attributedStringForZero;
  19.     NSAttributedString     *_attributedStringForNil;
  20.     NSAttributedString     *_attributedStringForNotANumber; 
  21.     NSDecimalNumber        *_minimum;
  22.     NSDecimalNumber        *_maximum;
  23.     NSDecimalNumberHandler *_roundingBehavior;
  24.     NSString               *_decimalSeparator;
  25.     NSString               *_thousandSeparator;
  26.     void                   *_private;
  27.     struct {
  28.     unsigned int thousandSeparators:1;
  29.     unsigned int localizesFormat:1;
  30.     unsigned int allowsFloats:1;
  31.     unsigned int RESERVED:29;
  32.     } _flags;
  33.     
  34.     void *_reserved;
  35. }
  36.  
  37. - (NSString *)negativeFormat;
  38. - (void)setNegativeFormat:(NSString *)format;
  39. - (NSDictionary *)textAttributesForNegativeValues;
  40. - (void)setTextAttributesForNegativeValues:(NSDictionary *)newAttributes;
  41.  
  42. - (NSString *)positiveFormat;
  43. - (void)setPositiveFormat:(NSString *)format;
  44. - (NSDictionary *)textAttributesForPositiveValues;
  45. - (void)setTextAttributesForPositiveValues:(NSDictionary *)newAttributes;
  46.  
  47. - (NSAttributedString *)attributedStringForZero;
  48. - (void)setAttributedStringForZero:(NSAttributedString *)newAttributedString;
  49. - (NSAttributedString *)attributedStringForNil;
  50. - (void)setAttributedStringForNil:(NSAttributedString *)newAttributedString;
  51. - (NSAttributedString *)attributedStringForNotANumber;
  52. - (void)setAttributedStringForNotANumber:(NSAttributedString *)newAttributedString;
  53.  
  54. - (NSString *)format;
  55. - (void)setFormat:(NSString *)format;
  56.  
  57.     // The formatter string can consist of one, two or three parts separated
  58.     // by ';'. If the caller specifies three parts, the center part is used
  59.     // to set the attributedStringForZero. The center part is always a string
  60.     // constant. If attributedStringForZero has not been explicitly set, with
  61.     // -setAttributedStringForZero, zeros are formatted with the positive
  62.     // format.
  63.  
  64. - (BOOL)hasThousandSeparators;
  65. - (void)setHasThousandSeparators:(BOOL)flag;
  66. - (NSString *)thousandSeparator;
  67. - (void)setThousandSeparator:(NSString *)newSeparator;
  68.  
  69. - (NSString *)decimalSeparator;
  70. - (void)setDecimalSeparator:(NSString *)newSeparator;
  71.  
  72. - (BOOL)localizesFormat;
  73. - (void)setLocalizesFormat:(BOOL)flag;
  74.  
  75. - (BOOL)allowsFloats;
  76. - (void)setAllowsFloats:(BOOL)flag;
  77.  
  78. - (NSDecimalNumberHandler *)roundingBehavior;
  79. - (void)setRoundingBehavior:(NSDecimalNumberHandler *)newRoundingBehavior;
  80.  
  81. - (NSDecimalNumber *)minimum;
  82. - (void)setMinimum:(NSDecimalNumber *)aMinimum;
  83. - (NSDecimalNumber *)maximum;
  84. - (void)setMaximum:(NSDecimalNumber *)aMaximum;
  85.  
  86. @end
  87.  
  88. #endif
  89.