~ubuntu-branches/ubuntu/edgy/sope/edgy

« back to all changes in this revision

Viewing changes to libFoundation/Foundation/NSNumberFormatter.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Ley
  • Date: 2005-08-19 16:53:31 UTC
  • Revision ID: james.westby@ubuntu.com-20050819165331-hs683wz1osm708pw
Tags: upstream-4.4rc.2
ImportĀ upstreamĀ versionĀ 4.4rc.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
   NSNumberFormatter.h
 
3
 
 
4
   Copyright (C) 1998 MDlink online service center, Helge Hess
 
5
   All rights reserved.
 
6
 
 
7
   Author: Helge Hess (helge@mdlink.de), Martin Spindler (spindler@mdlink.de)
 
8
 
 
9
   This file is part of libFoundation.
 
10
 
 
11
   Permission to use, copy, modify, and distribute this software and its
 
12
   documentation for any purpose and without fee is hereby granted, provided
 
13
   that the above copyright notice appear in all copies and that both that
 
14
   copyright notice and this permission notice appear in supporting
 
15
   documentation.
 
16
 
 
17
   We disclaim all warranties with regard to this software, including all
 
18
   implied warranties of merchantability and fitness, in no event shall
 
19
   we be liable for any special, indirect or consequential damages or any
 
20
   damages whatsoever resulting from loss of use, data or profits, whether in
 
21
   an action of contract, negligence or other tortious action, arising out of
 
22
   or in connection with the use or performance of this software.
 
23
*/
 
24
// $Id: NSNumberFormatter.h 827 2005-06-03 14:18:27Z helge $
 
25
 
 
26
#ifndef __NSNumberFormatter_h__
 
27
#define __NSNumberFormatter_h__
 
28
 
 
29
#include <Foundation/NSFormatter.h>
 
30
#include <Foundation/NSString.h>
 
31
 
 
32
@class NSNumber;
 
33
 
 
34
@interface NSNumberFormatter : NSFormatter
 
35
{
 
36
@protected
 
37
    NSString  *negativeFormat;
 
38
    NSString  *positiveFormat;
 
39
    NSNumber  *minimum;
 
40
    NSNumber  *maximum;
 
41
 
 
42
    unichar   decimalSeparator;
 
43
    unichar   thousandSeparator;
 
44
    BOOL      hasThousandSeparator;
 
45
}
 
46
 
 
47
// setting formats
 
48
 
 
49
- (void)setPositiveFormat:(NSString *)_format;
 
50
- (NSString *)positiveFormat;
 
51
 
 
52
- (void)setNegativeFormat:(NSString *)_format;
 
53
- (NSString *)negativeFormat;
 
54
 
 
55
- (void)setFormat:(NSString *)_format;
 
56
- (NSString *)format;
 
57
 
 
58
// attributed string support
 
59
 
 
60
#if HAVE_ATTRIBUTED_STRING
 
61
 
 
62
- (void)setTextAttributesForPositiveValues:(NSDictionary *)_attrs;
 
63
- (NSDictionary *)textAttributesForPositiveValues;
 
64
 
 
65
- (void)setTextAttributesForNegativeValues:(NSDictionary *)_attrs;
 
66
- (NSDictionary *)textAttributesForNegativeValues;
 
67
 
 
68
- (void)setAttributedStringForZero:(NSAttributedString *)_string;
 
69
- (NSAttributedString *)attributedStringForZero;
 
70
 
 
71
- (void)setAttributedStringForNil:(NSAttributedString *)_string;
 
72
- (NSAttributedString *)attributedStringForNil;
 
73
 
 
74
- (void)setAttributedStringForNotANumber:(NSAttributedString *)_string;
 
75
- (NSAttributedString *)attributedStringForNotANumber;
 
76
 
 
77
#endif
 
78
 
 
79
// separators
 
80
 
 
81
- (void)setThousandSeparator:(NSString *)_string;
 
82
- (NSString *)thousandSeparator;
 
83
 
 
84
- (void)setDecimalSeparator:(NSString *)_string;
 
85
- (NSString *)decimalSeparator;
 
86
 
 
87
- (void)setHasThousandSeparators:(BOOL)_flag;
 
88
- (BOOL)hasThousandSeparators;
 
89
 
 
90
// ranges
 
91
 
 
92
#if HAVE_DECIMAL_NUMBER
 
93
 
 
94
- (void)setMinimum:(NSDecimalNumber *)_number;
 
95
- (NSDecimalNumber *)minimum;
 
96
 
 
97
- (void)setMaximum:(NSDecimalNumber *)_number;
 
98
- (NSDecimalNumber *)maximum;
 
99
 
 
100
- (void)setRoundingBehaviour:(NSDecimalNumberHandler *)_handler;
 
101
- (NSDecimalNumberHandler *)roundingBehaviour;
 
102
 
 
103
#else
 
104
 
 
105
- (void)setMinimum:(NSNumber *)_number;
 
106
- (NSNumber *)minimum;
 
107
 
 
108
- (void)setMaximum:(NSNumber *)_number;
 
109
- (NSNumber *)maximum;
 
110
 
 
111
#endif
 
112
 
 
113
- (void)setAllowsFloats:(BOOL)_flag;
 
114
- (BOOL)allowsFloats;
 
115
 
 
116
@end
 
117
 
 
118
#endif
 
119
 
 
120
/*
 
121
  Local Variables:
 
122
  c-basic-offset: 4
 
123
  tab-width: 8
 
124
  End:
 
125
*/