Mercurial > projects > dstep
annotate dstep/foundation/NSNumberFormatter.d @ 16:19885b43130e
Huge update, the bridge actually works now
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Sun, 03 Jan 2010 22:06:11 +0100 |
parents | 89f3c3ef1fd2 |
children | b9de51448c6b |
rev | line source |
---|---|
14 | 1 /** |
2 * Copyright: Copyright (c) 2009 Jacob Carlborg. | |
3 * Authors: Jacob Carlborg | |
4 * Version: Initial created: Aug 3, 2009 | |
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0) | |
6 */ | |
7 module dstep.foundation.NSNumberFormatter; | |
8 | |
9 import dstep.corefoundation.CFNumberFormatter; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
10 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
11 import dstep.foundation.NSAttributedString; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
12 import dstep.foundation.NSDecimalNumber; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
13 import dstep.foundation.NSDictionary; |
14 | 14 import dstep.foundation.NSError; |
15 import dstep.foundation.NSFormatter; | |
16 import dstep.foundation.NSLocale; | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
17 import dstep.foundation.NSObjCRuntime; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
18 import dstep.foundation.NSRange; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
19 import dstep.foundation.NSString; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
20 import dstep.foundation.NSValue; |
14 | 21 import dstep.objc.bridge.Bridge; |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
22 import dstep.objc.objc; |
14 | 23 |
24 alias NSUInteger NSNumberFormatterStyle; | |
25 alias NSUInteger NSNumberFormatterBehavior; | |
26 alias NSUInteger NSNumberFormatterPadPosition; | |
27 alias NSUInteger NSNumberFormatterRoundingMode; | |
28 | |
29 enum | |
30 { | |
31 NSNumberFormatterNoStyle = kCFNumberFormatterNoStyle, | |
32 NSNumberFormatterDecimalStyle = kCFNumberFormatterDecimalStyle, | |
33 NSNumberFormatterCurrencyStyle = kCFNumberFormatterCurrencyStyle, | |
34 NSNumberFormatterPercentStyle = kCFNumberFormatterPercentStyle, | |
35 NSNumberFormatterScientificStyle = kCFNumberFormatterScientificStyle, | |
36 NSNumberFormatterSpellOutStyle = kCFNumberFormatterSpellOutStyle | |
37 } | |
38 | |
39 enum | |
40 { | |
41 NSNumberFormatterBehaviorDefault = 0, | |
42 NSNumberFormatterBehavior10_0 = 1000, | |
43 NSNumberFormatterBehavior10_4 = 1040 | |
44 } | |
45 | |
46 enum | |
47 { | |
48 NSNumberFormatterPadBeforePrefix = kCFNumberFormatterPadBeforePrefix, | |
49 NSNumberFormatterPadAfterPrefix = kCFNumberFormatterPadAfterPrefix, | |
50 NSNumberFormatterPadBeforeSuffix = kCFNumberFormatterPadBeforeSuffix, | |
51 NSNumberFormatterPadAfterSuffix = kCFNumberFormatterPadAfterSuffix | |
52 } | |
53 | |
54 enum | |
55 { | |
56 NSNumberFormatterRoundCeiling = kCFNumberFormatterRoundCeiling, | |
57 NSNumberFormatterRoundFloor = kCFNumberFormatterRoundFloor, | |
58 NSNumberFormatterRoundDown = kCFNumberFormatterRoundDown, | |
59 NSNumberFormatterRoundUp = kCFNumberFormatterRoundUp, | |
60 NSNumberFormatterRoundHalfEven = kCFNumberFormatterRoundHalfEven, | |
61 NSNumberFormatterRoundHalfDown = kCFNumberFormatterRoundHalfDown, | |
62 NSNumberFormatterRoundHalfUp = kCFNumberFormatterRoundHalfUp | |
63 } | |
64 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
65 const TNSNumberFormatterCompatibility = ` |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
66 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
67 bool hasThousandSeparators () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
68 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
69 return invokeObjcSelf!(bool, "hasThousandSeparators"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
70 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
71 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
72 void setHasThousandSeparators (bool flag) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
73 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
74 return invokeObjcSelf!(void, "setHasThousandSeparators:", bool)(flag); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
75 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
76 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
77 NSString thousandSeparator () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
78 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
79 return invokeObjcSelf!(NSString, "thousandSeparator"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
80 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
81 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
82 void setThousandSeparator (NSString newSeparator) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
83 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
84 return invokeObjcSelf!(void, "setThousandSeparator:", NSString)(newSeparator); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
85 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
86 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
87 bool localizesFormat () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
88 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
89 return invokeObjcSelf!(bool, "localizesFormat"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
90 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
91 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
92 void setLocalizesFormat (bool flag) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
93 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
94 return invokeObjcSelf!(void, "setLocalizesFormat:", bool)(flag); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
95 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
96 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
97 NSString format () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
98 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
99 return invokeObjcSelf!(NSString, "format"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
100 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
101 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
102 void setFormat (NSString string) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
103 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
104 return invokeObjcSelf!(void, "setFormat:", NSString)(string); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
105 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
106 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
107 NSAttributedString attributedStringForZero () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
108 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
109 return invokeObjcSelf!(NSAttributedString, "attributedStringForZero"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
110 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
111 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
112 void setAttributedStringForZero (NSAttributedString newAttributedString) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
113 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
114 return invokeObjcSelf!(void, "setAttributedStringForZero:", NSAttributedString)(newAttributedString); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
115 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
116 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
117 NSAttributedString attributedStringForNil () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
118 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
119 return invokeObjcSelf!(NSAttributedString, "attributedStringForNil"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
120 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
121 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
122 void setAttributedStringForNil (NSAttributedString newAttributedString) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
123 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
124 return invokeObjcSelf!(void, "setAttributedStringForNil:", NSAttributedString)(newAttributedString); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
125 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
126 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
127 NSAttributedString attributedStringForNotANumber () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
128 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
129 return invokeObjcSelf!(NSAttributedString, "attributedStringForNotANumber"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
130 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
131 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
132 void setAttributedStringForNotANumber (NSAttributedString newAttributedString) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
133 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
134 return invokeObjcSelf!(void, "setAttributedStringForNotANumber:", NSAttributedString)(newAttributedString); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
135 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
136 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
137 NSDecimalNumberHandler roundingBehavior () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
138 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
139 return invokeObjcSelf!(NSDecimalNumberHandler, "roundingBehavior"); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
140 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
141 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
142 void setRoundingBehavior (NSDecimalNumberHandler newRoundingBehavior) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
143 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
144 return invokeObjcSelf!(void, "setRoundingBehavior:", NSDecimalNumberHandler)(newRoundingBehavior); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
145 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
146 `; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
147 |
14 | 148 class NSNumberFormatter : NSFormatter |
149 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
150 mixin (ObjcWrap); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
151 |
14 | 152 this () |
153 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
154 super(typeof(this).alloc.init.objcObject); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
155 } |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
156 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
157 typeof(this) init () |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
158 { |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
159 return invokeObjcSelf!(typeof(this), "init"); |
14 | 160 } |
161 | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
162 bool getObjectValue (id* obj, NSString string, NSRange* rangep, ref NSError error) |
14 | 163 { |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
164 id err; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
165 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
166 if (error) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
167 err = new objc_object; |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
168 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
169 bool result = invokeObjcSelf!(bool, "getObjectValue:forString:range:error:", id*, NSString, NSRange*, id*)(obj, string, rangep, &err); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
170 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
171 if (err) |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
172 error = new NSError(err); |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
173 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
174 return result; |
14 | 175 } |
176 | |
177 NSString stringFromNumber (NSNumber number) | |
178 { | |
179 return invokeObjcSelf!(NSString, "stringFromNumber:", NSNumber)(number); | |
180 } | |
181 | |
182 NSNumber numberFromString (NSString string) | |
183 { | |
184 return invokeObjcSelf!(NSNumber, "numberFromString:", NSString)(string); | |
185 } | |
186 | |
187 uint numberStyle () | |
188 { | |
189 return invokeObjcSelf!(uint, "numberStyle"); | |
190 } | |
191 | |
192 void setNumberStyle (uint style) | |
193 { | |
194 return invokeObjcSelf!(void, "setNumberStyle:", uint)(style); | |
195 } | |
196 | |
197 NSLocale locale () | |
198 { | |
199 return invokeObjcSelf!(NSLocale, "locale"); | |
200 } | |
201 | |
202 void setLocale (NSLocale locale) | |
203 { | |
204 return invokeObjcSelf!(void, "setLocale:", NSLocale)(locale); | |
205 } | |
206 | |
207 bool generatesDecimalNumbers () | |
208 { | |
209 return invokeObjcSelf!(bool, "generatesDecimalNumbers"); | |
210 } | |
211 | |
212 void setGeneratesDecimalNumbers (bool b) | |
213 { | |
214 return invokeObjcSelf!(void, "setGeneratesDecimalNumbers:", bool)(b); | |
215 } | |
216 | |
217 uint formatterBehavior () | |
218 { | |
219 return invokeObjcSelf!(uint, "formatterBehavior"); | |
220 } | |
221 | |
222 void setFormatterBehavior (uint behavior) | |
223 { | |
224 return invokeObjcSelf!(void, "setFormatterBehavior:", uint)(behavior); | |
225 } | |
226 | |
227 static uint defaultFormatterBehavior () | |
228 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
229 return invokeObjcSuperClass!(uint, "defaultFormatterBehavior"); |
14 | 230 } |
231 | |
232 static void setDefaultFormatterBehavior (uint behavior) | |
233 { | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
234 return invokeObjcSuperClass!(void, "setDefaultFormatterBehavior:", uint)(behavior); |
14 | 235 } |
236 | |
237 NSString negativeFormat () | |
238 { | |
239 return invokeObjcSelf!(NSString, "negativeFormat"); | |
240 } | |
241 | |
242 void setNegativeFormat (NSString format) | |
243 { | |
244 return invokeObjcSelf!(void, "setNegativeFormat:", NSString)(format); | |
245 } | |
246 | |
247 NSDictionary textAttributesForNegativeValues () | |
248 { | |
249 return invokeObjcSelf!(NSDictionary, "textAttributesForNegativeValues"); | |
250 } | |
251 | |
252 void setTextAttributesForNegativeValues (NSDictionary newAttributes) | |
253 { | |
254 return invokeObjcSelf!(void, "setTextAttributesForNegativeValues:", NSDictionary)(newAttributes); | |
255 } | |
256 | |
257 NSString positiveFormat () | |
258 { | |
259 return invokeObjcSelf!(NSString, "positiveFormat"); | |
260 } | |
261 | |
262 void setPositiveFormat (NSString format) | |
263 { | |
264 return invokeObjcSelf!(void, "setPositiveFormat:", NSString)(format); | |
265 } | |
266 | |
267 NSDictionary textAttributesForPositiveValues () | |
268 { | |
269 return invokeObjcSelf!(NSDictionary, "textAttributesForPositiveValues"); | |
270 } | |
271 | |
272 void setTextAttributesForPositiveValues (NSDictionary newAttributes) | |
273 { | |
274 return invokeObjcSelf!(void, "setTextAttributesForPositiveValues:", NSDictionary)(newAttributes); | |
275 } | |
276 | |
277 bool allowsFloats () | |
278 { | |
279 return invokeObjcSelf!(bool, "allowsFloats"); | |
280 } | |
281 | |
282 void setAllowsFloats (bool flag) | |
283 { | |
284 return invokeObjcSelf!(void, "setAllowsFloats:", bool)(flag); | |
285 } | |
286 | |
287 NSString decimalSeparator () | |
288 { | |
289 return invokeObjcSelf!(NSString, "decimalSeparator"); | |
290 } | |
291 | |
292 void setDecimalSeparator (NSString string) | |
293 { | |
294 return invokeObjcSelf!(void, "setDecimalSeparator:", NSString)(string); | |
295 } | |
296 | |
297 bool alwaysShowsDecimalSeparator () | |
298 { | |
299 return invokeObjcSelf!(bool, "alwaysShowsDecimalSeparator"); | |
300 } | |
301 | |
302 void setAlwaysShowsDecimalSeparator (bool b) | |
303 { | |
304 return invokeObjcSelf!(void, "setAlwaysShowsDecimalSeparator:", bool)(b); | |
305 } | |
306 | |
307 NSString currencyDecimalSeparator () | |
308 { | |
309 return invokeObjcSelf!(NSString, "currencyDecimalSeparator"); | |
310 } | |
311 | |
312 void setCurrencyDecimalSeparator (NSString string) | |
313 { | |
314 return invokeObjcSelf!(void, "setCurrencyDecimalSeparator:", NSString)(string); | |
315 } | |
316 | |
317 bool usesGroupingSeparator () | |
318 { | |
319 return invokeObjcSelf!(bool, "usesGroupingSeparator"); | |
320 } | |
321 | |
322 void setUsesGroupingSeparator (bool b) | |
323 { | |
324 return invokeObjcSelf!(void, "setUsesGroupingSeparator:", bool)(b); | |
325 } | |
326 | |
327 NSString groupingSeparator () | |
328 { | |
329 return invokeObjcSelf!(NSString, "groupingSeparator"); | |
330 } | |
331 | |
332 void setGroupingSeparator (NSString string) | |
333 { | |
334 return invokeObjcSelf!(void, "setGroupingSeparator:", NSString)(string); | |
335 } | |
336 | |
337 NSString zeroSymbol () | |
338 { | |
339 return invokeObjcSelf!(NSString, "zeroSymbol"); | |
340 } | |
341 | |
342 void setZeroSymbol (NSString string) | |
343 { | |
344 return invokeObjcSelf!(void, "setZeroSymbol:", NSString)(string); | |
345 } | |
346 | |
347 NSDictionary textAttributesForZero () | |
348 { | |
349 return invokeObjcSelf!(NSDictionary, "textAttributesForZero"); | |
350 } | |
351 | |
352 void setTextAttributesForZero (NSDictionary newAttributes) | |
353 { | |
354 return invokeObjcSelf!(void, "setTextAttributesForZero:", NSDictionary)(newAttributes); | |
355 } | |
356 | |
357 NSString nilSymbol () | |
358 { | |
359 return invokeObjcSelf!(NSString, "nilSymbol"); | |
360 } | |
361 | |
362 void setNilSymbol (NSString string) | |
363 { | |
364 return invokeObjcSelf!(void, "setNilSymbol:", NSString)(string); | |
365 } | |
366 | |
367 NSDictionary textAttributesForNil () | |
368 { | |
369 return invokeObjcSelf!(NSDictionary, "textAttributesForNil"); | |
370 } | |
371 | |
372 void setTextAttributesForNil (NSDictionary newAttributes) | |
373 { | |
374 return invokeObjcSelf!(void, "setTextAttributesForNil:", NSDictionary)(newAttributes); | |
375 } | |
376 | |
377 NSString notANumberSymbol () | |
378 { | |
379 return invokeObjcSelf!(NSString, "notANumberSymbol"); | |
380 } | |
381 | |
382 void setNotANumberSymbol (NSString string) | |
383 { | |
384 return invokeObjcSelf!(void, "setNotANumberSymbol:", NSString)(string); | |
385 } | |
386 | |
387 NSDictionary textAttributesForNotANumber () | |
388 { | |
389 return invokeObjcSelf!(NSDictionary, "textAttributesForNotANumber"); | |
390 } | |
391 | |
392 void setTextAttributesForNotANumber (NSDictionary newAttributes) | |
393 { | |
394 return invokeObjcSelf!(void, "setTextAttributesForNotANumber:", NSDictionary)(newAttributes); | |
395 } | |
396 | |
397 NSString positiveInfinitySymbol () | |
398 { | |
399 return invokeObjcSelf!(NSString, "positiveInfinitySymbol"); | |
400 } | |
401 | |
402 void setPositiveInfinitySymbol (NSString string) | |
403 { | |
404 return invokeObjcSelf!(void, "setPositiveInfinitySymbol:", NSString)(string); | |
405 } | |
406 | |
407 NSDictionary textAttributesForPositiveInfinity () | |
408 { | |
409 return invokeObjcSelf!(NSDictionary, "textAttributesForPositiveInfinity"); | |
410 } | |
411 | |
412 void setTextAttributesForPositiveInfinity (NSDictionary newAttributes) | |
413 { | |
414 return invokeObjcSelf!(void, "setTextAttributesForPositiveInfinity:", NSDictionary)(newAttributes); | |
415 } | |
416 | |
417 NSString negativeInfinitySymbol () | |
418 { | |
419 return invokeObjcSelf!(NSString, "negativeInfinitySymbol"); | |
420 } | |
421 | |
422 void setNegativeInfinitySymbol (NSString string) | |
423 { | |
424 return invokeObjcSelf!(void, "setNegativeInfinitySymbol:", NSString)(string); | |
425 } | |
426 | |
427 NSDictionary textAttributesForNegativeInfinity () | |
428 { | |
429 return invokeObjcSelf!(NSDictionary, "textAttributesForNegativeInfinity"); | |
430 } | |
431 | |
432 void setTextAttributesForNegativeInfinity (NSDictionary newAttributes) | |
433 { | |
434 return invokeObjcSelf!(void, "setTextAttributesForNegativeInfinity:", NSDictionary)(newAttributes); | |
435 } | |
436 | |
437 NSString positivePrefix () | |
438 { | |
439 return invokeObjcSelf!(NSString, "positivePrefix"); | |
440 } | |
441 | |
442 void setPositivePrefix (NSString string) | |
443 { | |
444 return invokeObjcSelf!(void, "setPositivePrefix:", NSString)(string); | |
445 } | |
446 | |
447 NSString positiveSuffix () | |
448 { | |
449 return invokeObjcSelf!(NSString, "positiveSuffix"); | |
450 } | |
451 | |
452 void setPositiveSuffix (NSString string) | |
453 { | |
454 return invokeObjcSelf!(void, "setPositiveSuffix:", NSString)(string); | |
455 } | |
456 | |
457 NSString negativePrefix () | |
458 { | |
459 return invokeObjcSelf!(NSString, "negativePrefix"); | |
460 } | |
461 | |
462 void setNegativePrefix (NSString string) | |
463 { | |
464 return invokeObjcSelf!(void, "setNegativePrefix:", NSString)(string); | |
465 } | |
466 | |
467 NSString negativeSuffix () | |
468 { | |
469 return invokeObjcSelf!(NSString, "negativeSuffix"); | |
470 } | |
471 | |
472 void setNegativeSuffix (NSString string) | |
473 { | |
474 return invokeObjcSelf!(void, "setNegativeSuffix:", NSString)(string); | |
475 } | |
476 | |
477 NSString currencyCode () | |
478 { | |
479 return invokeObjcSelf!(NSString, "currencyCode"); | |
480 } | |
481 | |
482 void setCurrencyCode (NSString string) | |
483 { | |
484 return invokeObjcSelf!(void, "setCurrencyCode:", NSString)(string); | |
485 } | |
486 | |
487 NSString currencySymbol () | |
488 { | |
489 return invokeObjcSelf!(NSString, "currencySymbol"); | |
490 } | |
491 | |
492 void setCurrencySymbol (NSString string) | |
493 { | |
494 return invokeObjcSelf!(void, "setCurrencySymbol:", NSString)(string); | |
495 } | |
496 | |
497 NSString internationalCurrencySymbol () | |
498 { | |
499 return invokeObjcSelf!(NSString, "internationalCurrencySymbol"); | |
500 } | |
501 | |
502 void setInternationalCurrencySymbol (NSString string) | |
503 { | |
504 return invokeObjcSelf!(void, "setInternationalCurrencySymbol:", NSString)(string); | |
505 } | |
506 | |
507 NSString percentSymbol () | |
508 { | |
509 return invokeObjcSelf!(NSString, "percentSymbol"); | |
510 } | |
511 | |
512 void setPercentSymbol (NSString string) | |
513 { | |
514 return invokeObjcSelf!(void, "setPercentSymbol:", NSString)(string); | |
515 } | |
516 | |
517 NSString perMillSymbol () | |
518 { | |
519 return invokeObjcSelf!(NSString, "perMillSymbol"); | |
520 } | |
521 | |
522 void setPerMillSymbol (NSString string) | |
523 { | |
524 return invokeObjcSelf!(void, "setPerMillSymbol:", NSString)(string); | |
525 } | |
526 | |
527 NSString minusSign () | |
528 { | |
529 return invokeObjcSelf!(NSString, "minusSign"); | |
530 } | |
531 | |
532 void setMinusSign (NSString string) | |
533 { | |
534 return invokeObjcSelf!(void, "setMinusSign:", NSString)(string); | |
535 } | |
536 | |
537 NSString plusSign () | |
538 { | |
539 return invokeObjcSelf!(NSString, "plusSign"); | |
540 } | |
541 | |
542 void setPlusSign (NSString string) | |
543 { | |
544 return invokeObjcSelf!(void, "setPlusSign:", NSString)(string); | |
545 } | |
546 | |
547 NSString exponentSymbol () | |
548 { | |
549 return invokeObjcSelf!(NSString, "exponentSymbol"); | |
550 } | |
551 | |
552 void setExponentSymbol (NSString string) | |
553 { | |
554 return invokeObjcSelf!(void, "setExponentSymbol:", NSString)(string); | |
555 } | |
556 | |
557 NSUInteger groupingSize () | |
558 { | |
559 return invokeObjcSelf!(NSUInteger, "groupingSize"); | |
560 } | |
561 | |
562 void setGroupingSize (NSUInteger number) | |
563 { | |
564 return invokeObjcSelf!(void, "setGroupingSize:", NSUInteger)(number); | |
565 } | |
566 | |
567 NSUInteger secondaryGroupingSize () | |
568 { | |
569 return invokeObjcSelf!(NSUInteger, "secondaryGroupingSize"); | |
570 } | |
571 | |
572 void setSecondaryGroupingSize (NSUInteger number) | |
573 { | |
574 return invokeObjcSelf!(void, "setSecondaryGroupingSize:", NSUInteger)(number); | |
575 } | |
576 | |
577 NSNumber multiplier () | |
578 { | |
579 return invokeObjcSelf!(NSNumber, "multiplier"); | |
580 } | |
581 | |
582 void setMultiplier (NSNumber number) | |
583 { | |
584 return invokeObjcSelf!(void, "setMultiplier:", NSNumber)(number); | |
585 } | |
586 | |
587 NSUInteger formatWidth () | |
588 { | |
589 return invokeObjcSelf!(NSUInteger, "formatWidth"); | |
590 } | |
591 | |
592 void setFormatWidth (NSUInteger number) | |
593 { | |
594 return invokeObjcSelf!(void, "setFormatWidth:", NSUInteger)(number); | |
595 } | |
596 | |
597 NSString paddingCharacter () | |
598 { | |
599 return invokeObjcSelf!(NSString, "paddingCharacter"); | |
600 } | |
601 | |
602 void setPaddingCharacter (NSString string) | |
603 { | |
604 return invokeObjcSelf!(void, "setPaddingCharacter:", NSString)(string); | |
605 } | |
606 | |
607 uint paddingPosition () | |
608 { | |
609 return invokeObjcSelf!(uint, "paddingPosition"); | |
610 } | |
611 | |
612 void setPaddingPosition (uint position) | |
613 { | |
614 return invokeObjcSelf!(void, "setPaddingPosition:", uint)(position); | |
615 } | |
616 | |
617 uint roundingMode () | |
618 { | |
619 return invokeObjcSelf!(uint, "roundingMode"); | |
620 } | |
621 | |
622 void setRoundingMode (uint mode) | |
623 { | |
624 return invokeObjcSelf!(void, "setRoundingMode:", uint)(mode); | |
625 } | |
626 | |
627 NSNumber roundingIncrement () | |
628 { | |
629 return invokeObjcSelf!(NSNumber, "roundingIncrement"); | |
630 } | |
631 | |
632 void setRoundingIncrement (NSNumber number) | |
633 { | |
634 return invokeObjcSelf!(void, "setRoundingIncrement:", NSNumber)(number); | |
635 } | |
636 | |
637 NSUInteger minimumIntegerDigits () | |
638 { | |
639 return invokeObjcSelf!(NSUInteger, "minimumIntegerDigits"); | |
640 } | |
641 | |
642 void setMinimumIntegerDigits (NSUInteger number) | |
643 { | |
644 return invokeObjcSelf!(void, "setMinimumIntegerDigits:", NSUInteger)(number); | |
645 } | |
646 | |
647 NSUInteger maximumIntegerDigits () | |
648 { | |
649 return invokeObjcSelf!(NSUInteger, "maximumIntegerDigits"); | |
650 } | |
651 | |
652 void setMaximumIntegerDigits (NSUInteger number) | |
653 { | |
654 return invokeObjcSelf!(void, "setMaximumIntegerDigits:", NSUInteger)(number); | |
655 } | |
656 | |
657 NSUInteger minimumFractionDigits () | |
658 { | |
659 return invokeObjcSelf!(NSUInteger, "minimumFractionDigits"); | |
660 } | |
661 | |
662 void setMinimumFractionDigits (NSUInteger number) | |
663 { | |
664 return invokeObjcSelf!(void, "setMinimumFractionDigits:", NSUInteger)(number); | |
665 } | |
666 | |
667 NSUInteger maximumFractionDigits () | |
668 { | |
669 return invokeObjcSelf!(NSUInteger, "maximumFractionDigits"); | |
670 } | |
671 | |
672 void setMaximumFractionDigits (NSUInteger number) | |
673 { | |
674 return invokeObjcSelf!(void, "setMaximumFractionDigits:", NSUInteger)(number); | |
675 } | |
676 | |
677 NSNumber minimum () | |
678 { | |
679 return invokeObjcSelf!(NSNumber, "minimum"); | |
680 } | |
681 | |
682 void setMinimum (NSNumber number) | |
683 { | |
684 return invokeObjcSelf!(void, "setMinimum:", NSNumber)(number); | |
685 } | |
686 | |
687 NSNumber maximum () | |
688 { | |
689 return invokeObjcSelf!(NSNumber, "maximum"); | |
690 } | |
691 | |
692 void setMaximum (NSNumber number) | |
693 { | |
694 return invokeObjcSelf!(void, "setMaximum:", NSNumber)(number); | |
695 } | |
696 | |
697 NSString currencyGroupingSeparator () | |
698 { | |
699 return invokeObjcSelf!(NSString, "currencyGroupingSeparator"); | |
700 } | |
701 | |
702 void setCurrencyGroupingSeparator (NSString string) | |
703 { | |
704 return invokeObjcSelf!(void, "setCurrencyGroupingSeparator:", NSString)(string); | |
705 } | |
706 | |
707 bool isLenient () | |
708 { | |
709 return invokeObjcSelf!(bool, "isLenient"); | |
710 } | |
711 | |
712 void setLenient (bool b) | |
713 { | |
714 return invokeObjcSelf!(void, "setLenient:", bool)(b); | |
715 } | |
716 | |
717 bool usesSignificantDigits () | |
718 { | |
719 return invokeObjcSelf!(bool, "usesSignificantDigits"); | |
720 } | |
721 | |
722 void setUsesSignificantDigits (bool b) | |
723 { | |
724 return invokeObjcSelf!(void, "setUsesSignificantDigits:", bool)(b); | |
725 } | |
726 | |
727 NSUInteger minimumSignificantDigits () | |
728 { | |
729 return invokeObjcSelf!(NSUInteger, "minimumSignificantDigits"); | |
730 } | |
731 | |
732 void setMinimumSignificantDigits (NSUInteger number) | |
733 { | |
734 return invokeObjcSelf!(void, "setMinimumSignificantDigits:", NSUInteger)(number); | |
735 } | |
736 | |
737 NSUInteger maximumSignificantDigits () | |
738 { | |
739 return invokeObjcSelf!(NSUInteger, "maximumSignificantDigits"); | |
740 } | |
741 | |
742 void setMaximumSignificantDigits (NSUInteger number) | |
743 { | |
744 return invokeObjcSelf!(void, "setMaximumSignificantDigits:", NSUInteger)(number); | |
745 } | |
746 | |
747 bool isPartialStringValidationEnabled () | |
748 { | |
749 return invokeObjcSelf!(bool, "isPartialStringValidationEnabled"); | |
750 } | |
751 | |
752 void setPartialStringValidationEnabled (bool b) | |
753 { | |
754 return invokeObjcSelf!(void, "setPartialStringValidationEnabled:", bool)(b); | |
755 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
756 |
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
757 // TNSNumberFormatterCompatibility |
14 | 758 bool hasThousandSeparators () |
759 { | |
760 return invokeObjcSelf!(bool, "hasThousandSeparators"); | |
761 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
762 |
14 | 763 void setHasThousandSeparators (bool flag) |
764 { | |
765 return invokeObjcSelf!(void, "setHasThousandSeparators:", bool)(flag); | |
766 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
767 |
14 | 768 NSString thousandSeparator () |
769 { | |
770 return invokeObjcSelf!(NSString, "thousandSeparator"); | |
771 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
772 |
14 | 773 void setThousandSeparator (NSString newSeparator) |
774 { | |
775 return invokeObjcSelf!(void, "setThousandSeparator:", NSString)(newSeparator); | |
776 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
777 |
14 | 778 bool localizesFormat () |
779 { | |
780 return invokeObjcSelf!(bool, "localizesFormat"); | |
781 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
782 |
14 | 783 void setLocalizesFormat (bool flag) |
784 { | |
785 return invokeObjcSelf!(void, "setLocalizesFormat:", bool)(flag); | |
786 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
787 |
14 | 788 NSString format () |
789 { | |
790 return invokeObjcSelf!(NSString, "format"); | |
791 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
792 |
14 | 793 void setFormat (NSString string) |
794 { | |
795 return invokeObjcSelf!(void, "setFormat:", NSString)(string); | |
796 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
797 |
14 | 798 NSAttributedString attributedStringForZero () |
799 { | |
800 return invokeObjcSelf!(NSAttributedString, "attributedStringForZero"); | |
801 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
802 |
14 | 803 void setAttributedStringForZero (NSAttributedString newAttributedString) |
804 { | |
805 return invokeObjcSelf!(void, "setAttributedStringForZero:", NSAttributedString)(newAttributedString); | |
806 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
807 |
14 | 808 NSAttributedString attributedStringForNil () |
809 { | |
810 return invokeObjcSelf!(NSAttributedString, "attributedStringForNil"); | |
811 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
812 |
14 | 813 void setAttributedStringForNil (NSAttributedString newAttributedString) |
814 { | |
815 return invokeObjcSelf!(void, "setAttributedStringForNil:", NSAttributedString)(newAttributedString); | |
816 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
817 |
14 | 818 NSAttributedString attributedStringForNotANumber () |
819 { | |
820 return invokeObjcSelf!(NSAttributedString, "attributedStringForNotANumber"); | |
821 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
822 |
14 | 823 void setAttributedStringForNotANumber (NSAttributedString newAttributedString) |
824 { | |
825 return invokeObjcSelf!(void, "setAttributedStringForNotANumber:", NSAttributedString)(newAttributedString); | |
826 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
827 |
14 | 828 NSDecimalNumberHandler roundingBehavior () |
829 { | |
830 return invokeObjcSelf!(NSDecimalNumberHandler, "roundingBehavior"); | |
831 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
832 |
14 | 833 void setRoundingBehavior (NSDecimalNumberHandler newRoundingBehavior) |
834 { | |
835 return invokeObjcSelf!(void, "setRoundingBehavior:", NSDecimalNumberHandler)(newRoundingBehavior); | |
836 } | |
16
19885b43130e
Huge update, the bridge actually works now
Jacob Carlborg <doob@me.com>
parents:
14
diff
changeset
|
837 } |