comparison dstep/corefoundation/CFNumberFormatter.d @ 11:07194b026fa4

Added bindings to a couple of frameworks, new license + some other things
author Jacob Carlborg <doob@me.com>
date Sat, 01 Aug 2009 15:03:28 +0200
parents
children
comparison
equal deleted inserted replaced
10:27e00625790b 11:07194b026fa4
1 /**
2 * Copyright: Copyright (c) 2009 Jacob Carlborg.
3 * Authors: Jacob Carlborg
4 * Version: Initial created: Jul 12, 2009
5 * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost Software License 1.0)
6 */
7 module dstep.corefoundation.CFNumberFormatter;
8
9 import dstep.corefoundation.CFBase;
10 import dstep.corefoundation.CFLocale;
11 import dstep.corefoundation.CFNumber;
12 import dstep.objc.bridge.Bridge;
13 import dstep.objc.objc : id;
14
15 struct __CFNumberFormatter;
16 alias __CFNumberFormatter* CFNumberFormatterRef;
17 alias int CFNumberFormatterStyle;
18 alias uint CFNumberFormatterOptionFlags;
19 alias int CFNumberFormatterRoundingMode;
20 alias int CFNumberFormatterPadPosition;
21
22 extern (C)
23 {
24 extern
25 {
26 const CFStringRef kCFNumberFormatterCurrencyCode;
27 const CFStringRef kCFNumberFormatterDecimalSeparator;
28 const CFStringRef kCFNumberFormatterCurrencyDecimalSeparator;
29 const CFStringRef kCFNumberFormatterAlwaysShowDecimalSeparator;
30 const CFStringRef kCFNumberFormatterGroupingSeparator;
31 const CFStringRef kCFNumberFormatterUseGroupingSeparator;
32 const CFStringRef kCFNumberFormatterPercentSymbol;
33 const CFStringRef kCFNumberFormatterZeroSymbol;
34 const CFStringRef kCFNumberFormatterNaNSymbol;
35 const CFStringRef kCFNumberFormatterInfinitySymbol;
36 const CFStringRef kCFNumberFormatterMinusSign;
37 const CFStringRef kCFNumberFormatterPlusSign;
38 const CFStringRef kCFNumberFormatterCurrencySymbol;
39 const CFStringRef kCFNumberFormatterExponentSymbol;
40 const CFStringRef kCFNumberFormatterMinIntegerDigits;
41 const CFStringRef kCFNumberFormatterMaxIntegerDigits;
42 const CFStringRef kCFNumberFormatterMinFractionDigits;
43 const CFStringRef kCFNumberFormatterMaxFractionDigits;
44 const CFStringRef kCFNumberFormatterGroupingSize;
45 const CFStringRef kCFNumberFormatterSecondaryGroupingSize;
46 const CFStringRef kCFNumberFormatterRoundingMode;
47 const CFStringRef kCFNumberFormatterRoundingIncrement;
48 const CFStringRef kCFNumberFormatterFormatWidth;
49 const CFStringRef kCFNumberFormatterPaddingPosition;
50 const CFStringRef kCFNumberFormatterPaddingCharacter;
51 const CFStringRef kCFNumberFormatterDefaultFormat;
52 const CFStringRef kCFNumberFormatterMultiplier;
53 const CFStringRef kCFNumberFormatterPositivePrefix;
54 const CFStringRef kCFNumberFormatterPositiveSuffix;
55 const CFStringRef kCFNumberFormatterNegativePrefix;
56 const CFStringRef kCFNumberFormatterNegativeSuffix;
57 const CFStringRef kCFNumberFormatterPerMillSymbol;
58 const CFStringRef kCFNumberFormatterInternationalCurrencySymbol;
59 const CFStringRef kCFNumberFormatterCurrencyGroupingSeparator;
60 const CFStringRef kCFNumberFormatterIsLenient;
61 const CFStringRef kCFNumberFormatterUseSignificantDigits;
62 const CFStringRef kCFNumberFormatterMinSignificantDigits;
63 const CFStringRef kCFNumberFormatterMaxSignificantDigits;
64 }
65 }
66
67 enum
68 {
69 kCFNumberFormatterNoStyle = 0,
70 kCFNumberFormatterDecimalStyle = 1,
71 kCFNumberFormatterCurrencyStyle = 2,
72 kCFNumberFormatterPercentStyle = 3,
73 kCFNumberFormatterScientificStyle = 4,
74 kCFNumberFormatterSpellOutStyle = 5
75 }
76
77 enum
78 {
79 kCFNumberFormatterParseIntegersOnly = 1
80 }
81
82 enum
83 {
84 kCFNumberFormatterRoundCeiling = 0,
85 kCFNumberFormatterRoundFloor = 1,
86 kCFNumberFormatterRoundDown = 2,
87 kCFNumberFormatterRoundUp = 3,
88 kCFNumberFormatterRoundHalfEven = 4,
89 kCFNumberFormatterRoundHalfDown = 5,
90 kCFNumberFormatterRoundHalfUp = 6
91 }
92
93 enum
94 {
95 kCFNumberFormatterPadBeforePrefix = 0,
96 kCFNumberFormatterPadAfterPrefix = 1,
97 kCFNumberFormatterPadBeforeSuffix = 2,
98 kCFNumberFormatterPadAfterSuffix = 3
99 }
100
101 extern (C)
102 {
103 uint CFNumberFormatterGetTypeID ();
104 CFNumberFormatterRef CFNumberFormatterCreate (CFAllocatorRef allocator, CFLocaleRef locale, int style);
105 CFLocaleRef CFNumberFormatterGetLocale (CFNumberFormatterRef formatter);
106 int CFNumberFormatterGetStyle (CFNumberFormatterRef formatter);
107 CFStringRef CFNumberFormatterGetFormat (CFNumberFormatterRef formatter);
108 void CFNumberFormatterSetFormat (CFNumberFormatterRef formatter, CFStringRef formatString);
109 CFStringRef CFNumberFormatterCreateStringWithNumber (CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFNumberRef number);
110 CFStringRef CFNumberFormatterCreateStringWithValue (CFAllocatorRef allocator, CFNumberFormatterRef formatter, int numberType, void* valuePtr);
111 CFNumberRef CFNumberFormatterCreateNumberFromString (CFAllocatorRef allocator, CFNumberFormatterRef formatter, CFStringRef string, CFRange* rangep, uint options);
112 ubyte CFNumberFormatterGetValueFromString (CFNumberFormatterRef formatter, CFStringRef string, CFRange* rangep, int numberType, void* valuePtr);
113 void CFNumberFormatterSetProperty (CFNumberFormatterRef formatter, CFStringRef key, void* value);
114 void* CFNumberFormatterCopyProperty (CFNumberFormatterRef formatter, CFStringRef key);
115 ubyte CFNumberFormatterGetDecimalInfoForCurrencyCode (CFStringRef currencyCode, int* defaultFractionDigits, double* roundingIncrement);
116 }