CFNumberFormatter.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. { CFNumberFormatter.h
  2. Copyright (c) 2003-2013, Apple Inc. All rights reserved.
  3. }
  4. {
  5. Modified for use with Free Pascal
  6. Version 308
  7. Please report any bugs to <[email protected]>
  8. }
  9. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  10. {$mode macpas}
  11. {$modeswitch cblocks}
  12. {$packenum 1}
  13. {$macro on}
  14. {$inline on}
  15. {$calling mwpascal}
  16. {$IFNDEF FPC_DOTTEDUNITS}
  17. unit CFNumberFormatter;
  18. {$ENDIF FPC_DOTTEDUNITS}
  19. interface
  20. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  21. {$setc GAP_INTERFACES_VERSION := $0308}
  22. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  23. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  24. {$endc}
  25. {$ifc defined CPUPOWERPC and defined CPUI386}
  26. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  27. {$endc}
  28. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  29. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  30. {$endc}
  31. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  32. {$setc __ppc__ := 1}
  33. {$elsec}
  34. {$setc __ppc__ := 0}
  35. {$endc}
  36. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  37. {$setc __ppc64__ := 1}
  38. {$elsec}
  39. {$setc __ppc64__ := 0}
  40. {$endc}
  41. {$ifc not defined __i386__ and defined CPUI386}
  42. {$setc __i386__ := 1}
  43. {$elsec}
  44. {$setc __i386__ := 0}
  45. {$endc}
  46. {$ifc not defined __x86_64__ and defined CPUX86_64}
  47. {$setc __x86_64__ := 1}
  48. {$elsec}
  49. {$setc __x86_64__ := 0}
  50. {$endc}
  51. {$ifc not defined __arm__ and defined CPUARM}
  52. {$setc __arm__ := 1}
  53. {$elsec}
  54. {$setc __arm__ := 0}
  55. {$endc}
  56. {$ifc not defined __arm64__ and defined CPUAARCH64}
  57. {$setc __arm64__ := 1}
  58. {$elsec}
  59. {$setc __arm64__ := 0}
  60. {$endc}
  61. {$ifc defined cpu64}
  62. {$setc __LP64__ := 1}
  63. {$elsec}
  64. {$setc __LP64__ := 0}
  65. {$endc}
  66. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  67. {$error Conflicting definitions for __ppc__ and __i386__}
  68. {$endc}
  69. {$ifc defined __ppc__ and __ppc__}
  70. {$setc TARGET_CPU_PPC := TRUE}
  71. {$setc TARGET_CPU_PPC64 := FALSE}
  72. {$setc TARGET_CPU_X86 := FALSE}
  73. {$setc TARGET_CPU_X86_64 := FALSE}
  74. {$setc TARGET_CPU_ARM := FALSE}
  75. {$setc TARGET_CPU_ARM64 := FALSE}
  76. {$setc TARGET_OS_MAC := TRUE}
  77. {$setc TARGET_OS_IPHONE := FALSE}
  78. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  79. {$setc TARGET_OS_EMBEDDED := FALSE}
  80. {$elifc defined __ppc64__ and __ppc64__}
  81. {$setc TARGET_CPU_PPC := FALSE}
  82. {$setc TARGET_CPU_PPC64 := TRUE}
  83. {$setc TARGET_CPU_X86 := FALSE}
  84. {$setc TARGET_CPU_X86_64 := FALSE}
  85. {$setc TARGET_CPU_ARM := FALSE}
  86. {$setc TARGET_CPU_ARM64 := FALSE}
  87. {$setc TARGET_OS_MAC := TRUE}
  88. {$setc TARGET_OS_IPHONE := FALSE}
  89. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  90. {$setc TARGET_OS_EMBEDDED := FALSE}
  91. {$elifc defined __i386__ and __i386__}
  92. {$setc TARGET_CPU_PPC := FALSE}
  93. {$setc TARGET_CPU_PPC64 := FALSE}
  94. {$setc TARGET_CPU_X86 := TRUE}
  95. {$setc TARGET_CPU_X86_64 := FALSE}
  96. {$setc TARGET_CPU_ARM := FALSE}
  97. {$setc TARGET_CPU_ARM64 := FALSE}
  98. {$ifc defined iphonesim}
  99. {$setc TARGET_OS_MAC := FALSE}
  100. {$setc TARGET_OS_IPHONE := TRUE}
  101. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  102. {$elsec}
  103. {$setc TARGET_OS_MAC := TRUE}
  104. {$setc TARGET_OS_IPHONE := FALSE}
  105. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  106. {$endc}
  107. {$setc TARGET_OS_EMBEDDED := FALSE}
  108. {$elifc defined __x86_64__ and __x86_64__}
  109. {$setc TARGET_CPU_PPC := FALSE}
  110. {$setc TARGET_CPU_PPC64 := FALSE}
  111. {$setc TARGET_CPU_X86 := FALSE}
  112. {$setc TARGET_CPU_X86_64 := TRUE}
  113. {$setc TARGET_CPU_ARM := FALSE}
  114. {$setc TARGET_CPU_ARM64 := FALSE}
  115. {$ifc defined iphonesim}
  116. {$setc TARGET_OS_MAC := FALSE}
  117. {$setc TARGET_OS_IPHONE := TRUE}
  118. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  119. {$elsec}
  120. {$setc TARGET_OS_MAC := TRUE}
  121. {$setc TARGET_OS_IPHONE := FALSE}
  122. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  123. {$endc}
  124. {$setc TARGET_OS_EMBEDDED := FALSE}
  125. {$elifc defined __arm__ and __arm__}
  126. {$setc TARGET_CPU_PPC := FALSE}
  127. {$setc TARGET_CPU_PPC64 := FALSE}
  128. {$setc TARGET_CPU_X86 := FALSE}
  129. {$setc TARGET_CPU_X86_64 := FALSE}
  130. {$setc TARGET_CPU_ARM := TRUE}
  131. {$setc TARGET_CPU_ARM64 := FALSE}
  132. {$setc TARGET_OS_MAC := FALSE}
  133. {$setc TARGET_OS_IPHONE := TRUE}
  134. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  135. {$setc TARGET_OS_EMBEDDED := TRUE}
  136. {$elifc defined __arm64__ and __arm64__}
  137. {$setc TARGET_CPU_PPC := FALSE}
  138. {$setc TARGET_CPU_PPC64 := FALSE}
  139. {$setc TARGET_CPU_X86 := FALSE}
  140. {$setc TARGET_CPU_X86_64 := FALSE}
  141. {$setc TARGET_CPU_ARM := FALSE}
  142. {$setc TARGET_CPU_ARM64 := TRUE}
  143. {$ifc defined ios}
  144. {$setc TARGET_OS_MAC := FALSE}
  145. {$setc TARGET_OS_IPHONE := TRUE}
  146. {$setc TARGET_OS_EMBEDDED := TRUE}
  147. {$elsec}
  148. {$setc TARGET_OS_MAC := TRUE}
  149. {$setc TARGET_OS_IPHONE := FALSE}
  150. {$setc TARGET_OS_EMBEDDED := FALSE}
  151. {$endc}
  152. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  153. {$elsec}
  154. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  155. {$endc}
  156. {$ifc defined __LP64__ and __LP64__ }
  157. {$setc TARGET_CPU_64 := TRUE}
  158. {$elsec}
  159. {$setc TARGET_CPU_64 := FALSE}
  160. {$endc}
  161. {$ifc defined FPC_BIG_ENDIAN}
  162. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  163. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  164. {$elifc defined FPC_LITTLE_ENDIAN}
  165. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  166. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  167. {$elsec}
  168. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  169. {$endc}
  170. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  171. {$setc CALL_NOT_IN_CARBON := FALSE}
  172. {$setc OLDROUTINENAMES := FALSE}
  173. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  174. {$setc OPAQUE_UPP_TYPES := TRUE}
  175. {$setc OTCARBONAPPLICATION := TRUE}
  176. {$setc OTKERNEL := FALSE}
  177. {$setc PM_USE_SESSION_APIS := TRUE}
  178. {$setc TARGET_API_MAC_CARBON := TRUE}
  179. {$setc TARGET_API_MAC_OS8 := FALSE}
  180. {$setc TARGET_API_MAC_OSX := TRUE}
  181. {$setc TARGET_CARBON := TRUE}
  182. {$setc TARGET_CPU_68K := FALSE}
  183. {$setc TARGET_CPU_MIPS := FALSE}
  184. {$setc TARGET_CPU_SPARC := FALSE}
  185. {$setc TARGET_OS_UNIX := FALSE}
  186. {$setc TARGET_OS_WIN32 := FALSE}
  187. {$setc TARGET_RT_MAC_68881 := FALSE}
  188. {$setc TARGET_RT_MAC_CFM := FALSE}
  189. {$setc TARGET_RT_MAC_MACHO := TRUE}
  190. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  191. {$setc TYPE_BOOL := FALSE}
  192. {$setc TYPE_EXTENDED := FALSE}
  193. {$setc TYPE_LONGLONG := TRUE}
  194. {$IFDEF FPC_DOTTEDUNITS}
  195. uses MacOsApi.MacTypes,MacOsApi.CFBase,MacOsApi.CFNumber,MacOsApi.CFLocale;
  196. {$ELSE FPC_DOTTEDUNITS}
  197. uses MacTypes,CFBase,CFNumber,CFLocale;
  198. {$ENDIF FPC_DOTTEDUNITS}
  199. {$endc} {not MACOSALLINCLUDE}
  200. {$ALIGN POWER}
  201. {#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3}
  202. type
  203. CFNumberFormatterRef = ^__CFNumberFormatter; { an opaque type }
  204. __CFNumberFormatter = record end;
  205. // CFNumberFormatters are not thread-safe. Do not use one from multiple threads!
  206. function CFNumberFormatterGetTypeID: CFTypeID; external name '_CFNumberFormatterGetTypeID';
  207. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  208. // number format styles
  209. type
  210. CFNumberFormatterStyle = CFIndex;
  211. const
  212. kCFNumberFormatterNoStyle = 0;
  213. kCFNumberFormatterDecimalStyle = 1;
  214. kCFNumberFormatterCurrencyStyle = 2;
  215. kCFNumberFormatterPercentStyle = 3;
  216. kCFNumberFormatterScientificStyle = 4;
  217. kCFNumberFormatterSpellOutStyle = 5;
  218. function CFNumberFormatterCreate( allocator: CFAllocatorRef; locale: CFLocaleRef; style: CFNumberFormatterStyle ): CFNumberFormatterRef; external name '_CFNumberFormatterCreate';
  219. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  220. // Returns a CFNumberFormatter, localized to the given locale, which
  221. // will format numbers to the given style.
  222. function CFNumberFormatterGetLocale( formatter: CFNumberFormatterRef ): CFLocaleRef; external name '_CFNumberFormatterGetLocale';
  223. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  224. function CFNumberFormatterGetStyle( formatter: CFNumberFormatterRef ): CFNumberFormatterStyle; external name '_CFNumberFormatterGetStyle';
  225. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  226. // Get the properties with which the number formatter was created.
  227. function CFNumberFormatterGetFormat( formatter: CFNumberFormatterRef ): CFStringRef; external name '_CFNumberFormatterGetFormat';
  228. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  229. procedure CFNumberFormatterSetFormat( formatter: CFNumberFormatterRef; formatString: CFStringRef ); external name '_CFNumberFormatterSetFormat';
  230. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  231. // Set the format description string of the number formatter. This
  232. // overrides the style settings. The format of the format string
  233. // is as defined by the ICU library, and is similar to that found
  234. // in Microsoft Excel and NSNumberFormatter.
  235. // The number formatter starts with a default format string defined
  236. // by the style argument with which it was created.
  237. function CFNumberFormatterCreateStringWithNumber( allocator: CFAllocatorRef; formatter: CFNumberFormatterRef; number: CFNumberRef ): CFStringRef; external name '_CFNumberFormatterCreateStringWithNumber';
  238. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  239. function CFNumberFormatterCreateStringWithValue( allocator: CFAllocatorRef; formatter: CFNumberFormatterRef; numberType: CFNumberType; valuePtr: {const} UnivPtr ): CFStringRef; external name '_CFNumberFormatterCreateStringWithValue';
  240. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  241. // Create a string representation of the given number or value
  242. // using the current state of the number formatter.
  243. type
  244. CFNumberFormatterOptionFlags = CFOptionFlags;
  245. const
  246. kCFNumberFormatterParseIntegersOnly = 1; { only parse integers }
  247. function CFNumberFormatterCreateNumberFromString( allocator: CFAllocatorRef; formatter: CFNumberFormatterRef; strng: CFStringRef; rangep: CFRangePtr; options: CFOptionFlags ): CFNumberRef; external name '_CFNumberFormatterCreateNumberFromString';
  248. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  249. function CFNumberFormatterGetValueFromString( formatter: CFNumberFormatterRef; strng: CFStringRef; rangep: CFRangePtr; numberType: CFNumberType; valuePtr: UnivPtr ): Boolean; external name '_CFNumberFormatterGetValueFromString';
  250. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  251. // Parse a string representation of a number using the current state
  252. // of the number formatter. The range parameter specifies the range
  253. // of the string in which the parsing should occur in input, and on
  254. // output indicates the extent that was used; this parameter can
  255. // be NULL, in which case the whole string may be used. The
  256. // return value indicates whether some number was computed and
  257. // (if valuePtr is not NULL) stored at the location specified by
  258. // valuePtr. The numberType indicates the type of value pointed
  259. // to by valuePtr.
  260. procedure CFNumberFormatterSetProperty( formatter: CFNumberFormatterRef; key: CFStringRef; value: CFTypeRef ); external name '_CFNumberFormatterSetProperty';
  261. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  262. function CFNumberFormatterCopyProperty( formatter: CFNumberFormatterRef; key: CFStringRef ): CFTypeRef; external name '_CFNumberFormatterCopyProperty';
  263. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  264. // Set and get various properties of the number formatter, the set of
  265. // which may be expanded in the future.
  266. var kCFNumberFormatterCurrencyCode: CFStringRef; external name '_kCFNumberFormatterCurrencyCode'; (* attribute const *)
  267. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  268. var kCFNumberFormatterDecimalSeparator: CFStringRef; external name '_kCFNumberFormatterDecimalSeparator'; (* attribute const *)
  269. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  270. var kCFNumberFormatterCurrencyDecimalSeparator: CFStringRef; external name '_kCFNumberFormatterCurrencyDecimalSeparator'; (* attribute const *)
  271. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  272. var kCFNumberFormatterAlwaysShowDecimalSeparator: CFStringRef; external name '_kCFNumberFormatterAlwaysShowDecimalSeparator'; (* attribute const *)
  273. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFBoolean
  274. var kCFNumberFormatterGroupingSeparator: CFStringRef; external name '_kCFNumberFormatterGroupingSeparator'; (* attribute const *)
  275. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  276. var kCFNumberFormatterUseGroupingSeparator: CFStringRef; external name '_kCFNumberFormatterUseGroupingSeparator'; (* attribute const *)
  277. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFBoolean
  278. var kCFNumberFormatterPercentSymbol: CFStringRef; external name '_kCFNumberFormatterPercentSymbol'; (* attribute const *)
  279. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  280. var kCFNumberFormatterZeroSymbol: CFStringRef; external name '_kCFNumberFormatterZeroSymbol'; (* attribute const *)
  281. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  282. var kCFNumberFormatterNaNSymbol: CFStringRef; external name '_kCFNumberFormatterNaNSymbol'; (* attribute const *)
  283. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  284. var kCFNumberFormatterInfinitySymbol: CFStringRef; external name '_kCFNumberFormatterInfinitySymbol'; (* attribute const *)
  285. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  286. var kCFNumberFormatterMinusSign: CFStringRef; external name '_kCFNumberFormatterMinusSign'; (* attribute const *)
  287. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  288. var kCFNumberFormatterPlusSign: CFStringRef; external name '_kCFNumberFormatterPlusSign'; (* attribute const *)
  289. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  290. var kCFNumberFormatterCurrencySymbol: CFStringRef; external name '_kCFNumberFormatterCurrencySymbol'; (* attribute const *)
  291. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  292. var kCFNumberFormatterExponentSymbol: CFStringRef; external name '_kCFNumberFormatterExponentSymbol'; (* attribute const *)
  293. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  294. var kCFNumberFormatterMinIntegerDigits: CFStringRef; external name '_kCFNumberFormatterMinIntegerDigits'; (* attribute const *)
  295. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  296. var kCFNumberFormatterMaxIntegerDigits: CFStringRef; external name '_kCFNumberFormatterMaxIntegerDigits'; (* attribute const *)
  297. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  298. var kCFNumberFormatterMinFractionDigits: CFStringRef; external name '_kCFNumberFormatterMinFractionDigits'; (* attribute const *)
  299. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  300. var kCFNumberFormatterMaxFractionDigits: CFStringRef; external name '_kCFNumberFormatterMaxFractionDigits'; (* attribute const *)
  301. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  302. var kCFNumberFormatterGroupingSize: CFStringRef; external name '_kCFNumberFormatterGroupingSize'; (* attribute const *)
  303. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  304. var kCFNumberFormatterSecondaryGroupingSize: CFStringRef; external name '_kCFNumberFormatterSecondaryGroupingSize'; (* attribute const *)
  305. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  306. var kCFNumberFormatterRoundingMode: CFStringRef; external name '_kCFNumberFormatterRoundingMode'; (* attribute const *)
  307. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  308. var kCFNumberFormatterRoundingIncrement: CFStringRef; external name '_kCFNumberFormatterRoundingIncrement'; (* attribute const *)
  309. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  310. var kCFNumberFormatterFormatWidth: CFStringRef; external name '_kCFNumberFormatterFormatWidth'; (* attribute const *)
  311. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  312. var kCFNumberFormatterPaddingPosition: CFStringRef; external name '_kCFNumberFormatterPaddingPosition'; (* attribute const *)
  313. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFNumber
  314. var kCFNumberFormatterPaddingCharacter: CFStringRef; external name '_kCFNumberFormatterPaddingCharacter'; (* attribute const *)
  315. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  316. var kCFNumberFormatterDefaultFormat: CFStringRef; external name '_kCFNumberFormatterDefaultFormat'; (* attribute const *)
  317. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *) // CFString
  318. var kCFNumberFormatterMultiplier: CFStringRef; external name '_kCFNumberFormatterMultiplier'; (* attribute const *)
  319. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFNumber
  320. var kCFNumberFormatterPositivePrefix: CFStringRef; external name '_kCFNumberFormatterPositivePrefix'; (* attribute const *)
  321. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFString
  322. var kCFNumberFormatterPositiveSuffix: CFStringRef; external name '_kCFNumberFormatterPositiveSuffix'; (* attribute const *)
  323. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFString
  324. var kCFNumberFormatterNegativePrefix: CFStringRef; external name '_kCFNumberFormatterNegativePrefix'; (* attribute const *)
  325. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFString
  326. var kCFNumberFormatterNegativeSuffix: CFStringRef; external name '_kCFNumberFormatterNegativeSuffix'; (* attribute const *)
  327. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFString
  328. var kCFNumberFormatterPerMillSymbol: CFStringRef; external name '_kCFNumberFormatterPerMillSymbol'; (* attribute const *)
  329. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFString
  330. var kCFNumberFormatterInternationalCurrencySymbol: CFStringRef; external name '_kCFNumberFormatterInternationalCurrencySymbol'; (* attribute const *)
  331. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *) // CFString
  332. var kCFNumberFormatterCurrencyGroupingSeparator: CFStringRef; external name '_kCFNumberFormatterCurrencyGroupingSeparator'; (* attribute const *)
  333. (* CF_AVAILABLE_STARTING(10_5, 2_0) *) // CFString
  334. var kCFNumberFormatterIsLenient: CFStringRef; external name '_kCFNumberFormatterIsLenient'; (* attribute const *)
  335. (* CF_AVAILABLE_STARTING(10_5, 2_0) *) // CFBoolean
  336. var kCFNumberFormatterUseSignificantDigits: CFStringRef; external name '_kCFNumberFormatterUseSignificantDigits'; (* attribute const *)
  337. (* CF_AVAILABLE_STARTING(10_5, 2_0) *) // CFBoolean
  338. var kCFNumberFormatterMinSignificantDigits: CFStringRef; external name '_kCFNumberFormatterMinSignificantDigits'; (* attribute const *)
  339. (* CF_AVAILABLE_STARTING(10_5, 2_0) *) // CFNumber
  340. var kCFNumberFormatterMaxSignificantDigits: CFStringRef; external name '_kCFNumberFormatterMaxSignificantDigits'; (* attribute const *)
  341. (* CF_AVAILABLE_STARTING(10_5, 2_0) *) // CFNumber
  342. type
  343. CFNumberFormatterRoundingMode = CFIndex;
  344. const
  345. kCFNumberFormatterRoundCeiling = 0;
  346. kCFNumberFormatterRoundFloor = 1;
  347. kCFNumberFormatterRoundDown = 2;
  348. kCFNumberFormatterRoundUp = 3;
  349. kCFNumberFormatterRoundHalfEven = 4;
  350. kCFNumberFormatterRoundHalfDown = 5;
  351. kCFNumberFormatterRoundHalfUp = 6;
  352. type
  353. CFNumberFormatterPadPosition = CFIndex;
  354. const
  355. kCFNumberFormatterPadBeforePrefix = 0;
  356. kCFNumberFormatterPadAfterPrefix = 1;
  357. kCFNumberFormatterPadBeforeSuffix = 2;
  358. kCFNumberFormatterPadAfterSuffix = 3;
  359. function CFNumberFormatterGetDecimalInfoForCurrencyCode( currencyCode: CFStringRef; defaultFractionDigits: SInt32Ptr; roundingIncrement: Float64Ptr ): Boolean; external name '_CFNumberFormatterGetDecimalInfoForCurrencyCode';
  360. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  361. // Returns the number of fraction digits that should be displayed, and
  362. // the rounding increment (or 0.0 if no rounding is done by the currency)
  363. // for the given currency. Returns false if the currency code is unknown
  364. // or the information is not available.
  365. // Not localized because these are properties of the currency.
  366. {#endif}
  367. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  368. end.
  369. {$endc} {not MACOSALLINCLUDE}