objc2_foundation/generated/
NSNumberFormatter.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsnumberformatterbehavior?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct NSNumberFormatterBehavior(pub NSUInteger);
14impl NSNumberFormatterBehavior {
15    #[doc(alias = "NSNumberFormatterBehaviorDefault")]
16    pub const BehaviorDefault: Self = Self(0);
17    #[doc(alias = "NSNumberFormatterBehavior10_0")]
18    pub const Behavior10_0: Self = Self(1000);
19    #[doc(alias = "NSNumberFormatterBehavior10_4")]
20    pub const Behavior10_4: Self = Self(1040);
21}
22
23unsafe impl Encode for NSNumberFormatterBehavior {
24    const ENCODING: Encoding = NSUInteger::ENCODING;
25}
26
27unsafe impl RefEncode for NSNumberFormatterBehavior {
28    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
29}
30
31/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsnumberformatterstyle?language=objc)
32// NS_ENUM
33#[repr(transparent)]
34#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
35pub struct NSNumberFormatterStyle(pub NSUInteger);
36impl NSNumberFormatterStyle {
37    #[doc(alias = "NSNumberFormatterNoStyle")]
38    pub const NoStyle: Self = Self(0);
39    #[doc(alias = "NSNumberFormatterDecimalStyle")]
40    pub const DecimalStyle: Self = Self(1);
41    #[doc(alias = "NSNumberFormatterCurrencyStyle")]
42    pub const CurrencyStyle: Self = Self(2);
43    #[doc(alias = "NSNumberFormatterPercentStyle")]
44    pub const PercentStyle: Self = Self(3);
45    #[doc(alias = "NSNumberFormatterScientificStyle")]
46    pub const ScientificStyle: Self = Self(4);
47    #[doc(alias = "NSNumberFormatterSpellOutStyle")]
48    pub const SpellOutStyle: Self = Self(5);
49    #[doc(alias = "NSNumberFormatterOrdinalStyle")]
50    pub const OrdinalStyle: Self = Self(6);
51    #[doc(alias = "NSNumberFormatterCurrencyISOCodeStyle")]
52    pub const CurrencyISOCodeStyle: Self = Self(8);
53    #[doc(alias = "NSNumberFormatterCurrencyPluralStyle")]
54    pub const CurrencyPluralStyle: Self = Self(9);
55    #[doc(alias = "NSNumberFormatterCurrencyAccountingStyle")]
56    pub const CurrencyAccountingStyle: Self = Self(10);
57}
58
59unsafe impl Encode for NSNumberFormatterStyle {
60    const ENCODING: Encoding = NSUInteger::ENCODING;
61}
62
63unsafe impl RefEncode for NSNumberFormatterStyle {
64    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
65}
66
67/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsnumberformatterpadposition?language=objc)
68// NS_ENUM
69#[repr(transparent)]
70#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
71pub struct NSNumberFormatterPadPosition(pub NSUInteger);
72impl NSNumberFormatterPadPosition {
73    #[doc(alias = "NSNumberFormatterPadBeforePrefix")]
74    pub const BeforePrefix: Self = Self(0);
75    #[doc(alias = "NSNumberFormatterPadAfterPrefix")]
76    pub const AfterPrefix: Self = Self(1);
77    #[doc(alias = "NSNumberFormatterPadBeforeSuffix")]
78    pub const BeforeSuffix: Self = Self(2);
79    #[doc(alias = "NSNumberFormatterPadAfterSuffix")]
80    pub const AfterSuffix: Self = Self(3);
81}
82
83unsafe impl Encode for NSNumberFormatterPadPosition {
84    const ENCODING: Encoding = NSUInteger::ENCODING;
85}
86
87unsafe impl RefEncode for NSNumberFormatterPadPosition {
88    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
89}
90
91/// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsnumberformatterroundingmode?language=objc)
92// NS_ENUM
93#[repr(transparent)]
94#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
95pub struct NSNumberFormatterRoundingMode(pub NSUInteger);
96impl NSNumberFormatterRoundingMode {
97    #[doc(alias = "NSNumberFormatterRoundCeiling")]
98    pub const RoundCeiling: Self = Self(0);
99    #[doc(alias = "NSNumberFormatterRoundFloor")]
100    pub const RoundFloor: Self = Self(1);
101    #[doc(alias = "NSNumberFormatterRoundDown")]
102    pub const RoundDown: Self = Self(2);
103    #[doc(alias = "NSNumberFormatterRoundUp")]
104    pub const RoundUp: Self = Self(3);
105    #[doc(alias = "NSNumberFormatterRoundHalfEven")]
106    pub const RoundHalfEven: Self = Self(4);
107    #[doc(alias = "NSNumberFormatterRoundHalfDown")]
108    pub const RoundHalfDown: Self = Self(5);
109    #[doc(alias = "NSNumberFormatterRoundHalfUp")]
110    pub const RoundHalfUp: Self = Self(6);
111}
112
113unsafe impl Encode for NSNumberFormatterRoundingMode {
114    const ENCODING: Encoding = NSUInteger::ENCODING;
115}
116
117unsafe impl RefEncode for NSNumberFormatterRoundingMode {
118    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
119}
120
121extern_class!(
122    /// [Apple's documentation](https://developer.apple.com/documentation/foundation/nsnumberformatter?language=objc)
123    #[unsafe(super(NSFormatter, NSObject))]
124    #[derive(Debug, PartialEq, Eq, Hash)]
125    #[cfg(feature = "NSFormatter")]
126    pub struct NSNumberFormatter;
127);
128
129#[cfg(feature = "NSFormatter")]
130unsafe impl Send for NSNumberFormatter {}
131
132#[cfg(feature = "NSFormatter")]
133unsafe impl Sync for NSNumberFormatter {}
134
135#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
136extern_conformance!(
137    unsafe impl NSCoding for NSNumberFormatter {}
138);
139
140#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
141extern_conformance!(
142    unsafe impl NSCopying for NSNumberFormatter {}
143);
144
145#[cfg(all(feature = "NSFormatter", feature = "NSObject"))]
146unsafe impl CopyingHelper for NSNumberFormatter {
147    type Result = Self;
148}
149
150#[cfg(feature = "NSFormatter")]
151extern_conformance!(
152    unsafe impl NSObjectProtocol for NSNumberFormatter {}
153);
154
155#[cfg(feature = "NSFormatter")]
156impl NSNumberFormatter {
157    extern_methods!(
158        #[unsafe(method(formattingContext))]
159        #[unsafe(method_family = none)]
160        pub fn formattingContext(&self) -> NSFormattingContext;
161
162        /// Setter for [`formattingContext`][Self::formattingContext].
163        #[unsafe(method(setFormattingContext:))]
164        #[unsafe(method_family = none)]
165        pub fn setFormattingContext(&self, formatting_context: NSFormattingContext);
166
167        #[cfg(all(feature = "NSError", feature = "NSRange", feature = "NSString"))]
168        /// # Safety
169        ///
170        /// - `obj` should be of the correct type.
171        /// - `rangep` must be a valid pointer or null.
172        #[unsafe(method(getObjectValue:forString:range:error:_))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn getObjectValue_forString_range_error(
175            &self,
176            obj: Option<&mut Option<Retained<AnyObject>>>,
177            string: &NSString,
178            rangep: *mut NSRange,
179        ) -> Result<(), Retained<NSError>>;
180
181        #[cfg(all(feature = "NSString", feature = "NSValue"))]
182        #[unsafe(method(stringFromNumber:))]
183        #[unsafe(method_family = none)]
184        pub fn stringFromNumber(&self, number: &NSNumber) -> Option<Retained<NSString>>;
185
186        #[cfg(all(feature = "NSString", feature = "NSValue"))]
187        #[unsafe(method(numberFromString:))]
188        #[unsafe(method_family = none)]
189        pub fn numberFromString(&self, string: &NSString) -> Option<Retained<NSNumber>>;
190
191        #[cfg(all(feature = "NSString", feature = "NSValue"))]
192        #[unsafe(method(localizedStringFromNumber:numberStyle:))]
193        #[unsafe(method_family = none)]
194        pub fn localizedStringFromNumber_numberStyle(
195            num: &NSNumber,
196            nstyle: NSNumberFormatterStyle,
197        ) -> Retained<NSString>;
198
199        #[unsafe(method(defaultFormatterBehavior))]
200        #[unsafe(method_family = none)]
201        pub fn defaultFormatterBehavior() -> NSNumberFormatterBehavior;
202
203        #[unsafe(method(setDefaultFormatterBehavior:))]
204        #[unsafe(method_family = none)]
205        pub fn setDefaultFormatterBehavior(behavior: NSNumberFormatterBehavior);
206
207        #[unsafe(method(minimumGroupingDigits))]
208        #[unsafe(method_family = none)]
209        pub fn minimumGroupingDigits(&self) -> NSInteger;
210
211        /// Setter for [`minimumGroupingDigits`][Self::minimumGroupingDigits].
212        #[unsafe(method(setMinimumGroupingDigits:))]
213        #[unsafe(method_family = none)]
214        pub fn setMinimumGroupingDigits(&self, minimum_grouping_digits: NSInteger);
215
216        #[unsafe(method(numberStyle))]
217        #[unsafe(method_family = none)]
218        pub fn numberStyle(&self) -> NSNumberFormatterStyle;
219
220        /// Setter for [`numberStyle`][Self::numberStyle].
221        #[unsafe(method(setNumberStyle:))]
222        #[unsafe(method_family = none)]
223        pub fn setNumberStyle(&self, number_style: NSNumberFormatterStyle);
224
225        #[cfg(feature = "NSLocale")]
226        #[unsafe(method(locale))]
227        #[unsafe(method_family = none)]
228        pub fn locale(&self) -> Retained<NSLocale>;
229
230        #[cfg(feature = "NSLocale")]
231        /// Setter for [`locale`][Self::locale].
232        ///
233        /// This is [copied][crate::NSCopying::copy] when set.
234        #[unsafe(method(setLocale:))]
235        #[unsafe(method_family = none)]
236        pub fn setLocale(&self, locale: Option<&NSLocale>);
237
238        #[unsafe(method(generatesDecimalNumbers))]
239        #[unsafe(method_family = none)]
240        pub fn generatesDecimalNumbers(&self) -> bool;
241
242        /// Setter for [`generatesDecimalNumbers`][Self::generatesDecimalNumbers].
243        #[unsafe(method(setGeneratesDecimalNumbers:))]
244        #[unsafe(method_family = none)]
245        pub fn setGeneratesDecimalNumbers(&self, generates_decimal_numbers: bool);
246
247        #[unsafe(method(formatterBehavior))]
248        #[unsafe(method_family = none)]
249        pub fn formatterBehavior(&self) -> NSNumberFormatterBehavior;
250
251        /// Setter for [`formatterBehavior`][Self::formatterBehavior].
252        #[unsafe(method(setFormatterBehavior:))]
253        #[unsafe(method_family = none)]
254        pub fn setFormatterBehavior(&self, formatter_behavior: NSNumberFormatterBehavior);
255
256        #[cfg(feature = "NSString")]
257        #[unsafe(method(negativeFormat))]
258        #[unsafe(method_family = none)]
259        pub fn negativeFormat(&self) -> Retained<NSString>;
260
261        #[cfg(feature = "NSString")]
262        /// Setter for [`negativeFormat`][Self::negativeFormat].
263        ///
264        /// This is [copied][crate::NSCopying::copy] when set.
265        #[unsafe(method(setNegativeFormat:))]
266        #[unsafe(method_family = none)]
267        pub fn setNegativeFormat(&self, negative_format: Option<&NSString>);
268
269        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
270        #[unsafe(method(textAttributesForNegativeValues))]
271        #[unsafe(method_family = none)]
272        pub fn textAttributesForNegativeValues(
273            &self,
274        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
275
276        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
277        /// Setter for [`textAttributesForNegativeValues`][Self::textAttributesForNegativeValues].
278        ///
279        /// This is [copied][crate::NSCopying::copy] when set.
280        ///
281        /// # Safety
282        ///
283        /// `text_attributes_for_negative_values` generic should be of the correct type.
284        #[unsafe(method(setTextAttributesForNegativeValues:))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn setTextAttributesForNegativeValues(
287            &self,
288            text_attributes_for_negative_values: Option<&NSDictionary<NSString, AnyObject>>,
289        );
290
291        #[cfg(feature = "NSString")]
292        #[unsafe(method(positiveFormat))]
293        #[unsafe(method_family = none)]
294        pub fn positiveFormat(&self) -> Retained<NSString>;
295
296        #[cfg(feature = "NSString")]
297        /// Setter for [`positiveFormat`][Self::positiveFormat].
298        ///
299        /// This is [copied][crate::NSCopying::copy] when set.
300        #[unsafe(method(setPositiveFormat:))]
301        #[unsafe(method_family = none)]
302        pub fn setPositiveFormat(&self, positive_format: Option<&NSString>);
303
304        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
305        #[unsafe(method(textAttributesForPositiveValues))]
306        #[unsafe(method_family = none)]
307        pub fn textAttributesForPositiveValues(
308            &self,
309        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
310
311        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
312        /// Setter for [`textAttributesForPositiveValues`][Self::textAttributesForPositiveValues].
313        ///
314        /// This is [copied][crate::NSCopying::copy] when set.
315        ///
316        /// # Safety
317        ///
318        /// `text_attributes_for_positive_values` generic should be of the correct type.
319        #[unsafe(method(setTextAttributesForPositiveValues:))]
320        #[unsafe(method_family = none)]
321        pub unsafe fn setTextAttributesForPositiveValues(
322            &self,
323            text_attributes_for_positive_values: Option<&NSDictionary<NSString, AnyObject>>,
324        );
325
326        #[unsafe(method(allowsFloats))]
327        #[unsafe(method_family = none)]
328        pub fn allowsFloats(&self) -> bool;
329
330        /// Setter for [`allowsFloats`][Self::allowsFloats].
331        #[unsafe(method(setAllowsFloats:))]
332        #[unsafe(method_family = none)]
333        pub fn setAllowsFloats(&self, allows_floats: bool);
334
335        #[cfg(feature = "NSString")]
336        #[unsafe(method(decimalSeparator))]
337        #[unsafe(method_family = none)]
338        pub fn decimalSeparator(&self) -> Retained<NSString>;
339
340        #[cfg(feature = "NSString")]
341        /// Setter for [`decimalSeparator`][Self::decimalSeparator].
342        ///
343        /// This is [copied][crate::NSCopying::copy] when set.
344        #[unsafe(method(setDecimalSeparator:))]
345        #[unsafe(method_family = none)]
346        pub fn setDecimalSeparator(&self, decimal_separator: Option<&NSString>);
347
348        #[unsafe(method(alwaysShowsDecimalSeparator))]
349        #[unsafe(method_family = none)]
350        pub fn alwaysShowsDecimalSeparator(&self) -> bool;
351
352        /// Setter for [`alwaysShowsDecimalSeparator`][Self::alwaysShowsDecimalSeparator].
353        #[unsafe(method(setAlwaysShowsDecimalSeparator:))]
354        #[unsafe(method_family = none)]
355        pub fn setAlwaysShowsDecimalSeparator(&self, always_shows_decimal_separator: bool);
356
357        #[cfg(feature = "NSString")]
358        #[unsafe(method(currencyDecimalSeparator))]
359        #[unsafe(method_family = none)]
360        pub fn currencyDecimalSeparator(&self) -> Retained<NSString>;
361
362        #[cfg(feature = "NSString")]
363        /// Setter for [`currencyDecimalSeparator`][Self::currencyDecimalSeparator].
364        ///
365        /// This is [copied][crate::NSCopying::copy] when set.
366        #[unsafe(method(setCurrencyDecimalSeparator:))]
367        #[unsafe(method_family = none)]
368        pub fn setCurrencyDecimalSeparator(&self, currency_decimal_separator: Option<&NSString>);
369
370        #[unsafe(method(usesGroupingSeparator))]
371        #[unsafe(method_family = none)]
372        pub fn usesGroupingSeparator(&self) -> bool;
373
374        /// Setter for [`usesGroupingSeparator`][Self::usesGroupingSeparator].
375        #[unsafe(method(setUsesGroupingSeparator:))]
376        #[unsafe(method_family = none)]
377        pub fn setUsesGroupingSeparator(&self, uses_grouping_separator: bool);
378
379        #[cfg(feature = "NSString")]
380        #[unsafe(method(groupingSeparator))]
381        #[unsafe(method_family = none)]
382        pub fn groupingSeparator(&self) -> Retained<NSString>;
383
384        #[cfg(feature = "NSString")]
385        /// Setter for [`groupingSeparator`][Self::groupingSeparator].
386        ///
387        /// This is [copied][crate::NSCopying::copy] when set.
388        #[unsafe(method(setGroupingSeparator:))]
389        #[unsafe(method_family = none)]
390        pub fn setGroupingSeparator(&self, grouping_separator: Option<&NSString>);
391
392        #[cfg(feature = "NSString")]
393        #[unsafe(method(zeroSymbol))]
394        #[unsafe(method_family = none)]
395        pub fn zeroSymbol(&self) -> Option<Retained<NSString>>;
396
397        #[cfg(feature = "NSString")]
398        /// Setter for [`zeroSymbol`][Self::zeroSymbol].
399        ///
400        /// This is [copied][crate::NSCopying::copy] when set.
401        #[unsafe(method(setZeroSymbol:))]
402        #[unsafe(method_family = none)]
403        pub fn setZeroSymbol(&self, zero_symbol: Option<&NSString>);
404
405        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
406        #[unsafe(method(textAttributesForZero))]
407        #[unsafe(method_family = none)]
408        pub fn textAttributesForZero(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
409
410        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
411        /// Setter for [`textAttributesForZero`][Self::textAttributesForZero].
412        ///
413        /// This is [copied][crate::NSCopying::copy] when set.
414        ///
415        /// # Safety
416        ///
417        /// `text_attributes_for_zero` generic should be of the correct type.
418        #[unsafe(method(setTextAttributesForZero:))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn setTextAttributesForZero(
421            &self,
422            text_attributes_for_zero: Option<&NSDictionary<NSString, AnyObject>>,
423        );
424
425        #[cfg(feature = "NSString")]
426        #[unsafe(method(nilSymbol))]
427        #[unsafe(method_family = none)]
428        pub fn nilSymbol(&self) -> Retained<NSString>;
429
430        #[cfg(feature = "NSString")]
431        /// Setter for [`nilSymbol`][Self::nilSymbol].
432        ///
433        /// This is [copied][crate::NSCopying::copy] when set.
434        #[unsafe(method(setNilSymbol:))]
435        #[unsafe(method_family = none)]
436        pub fn setNilSymbol(&self, nil_symbol: &NSString);
437
438        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
439        #[unsafe(method(textAttributesForNil))]
440        #[unsafe(method_family = none)]
441        pub fn textAttributesForNil(&self) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
442
443        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
444        /// Setter for [`textAttributesForNil`][Self::textAttributesForNil].
445        ///
446        /// This is [copied][crate::NSCopying::copy] when set.
447        ///
448        /// # Safety
449        ///
450        /// `text_attributes_for_nil` generic should be of the correct type.
451        #[unsafe(method(setTextAttributesForNil:))]
452        #[unsafe(method_family = none)]
453        pub unsafe fn setTextAttributesForNil(
454            &self,
455            text_attributes_for_nil: Option<&NSDictionary<NSString, AnyObject>>,
456        );
457
458        #[cfg(feature = "NSString")]
459        #[unsafe(method(notANumberSymbol))]
460        #[unsafe(method_family = none)]
461        pub fn notANumberSymbol(&self) -> Retained<NSString>;
462
463        #[cfg(feature = "NSString")]
464        /// Setter for [`notANumberSymbol`][Self::notANumberSymbol].
465        ///
466        /// This is [copied][crate::NSCopying::copy] when set.
467        #[unsafe(method(setNotANumberSymbol:))]
468        #[unsafe(method_family = none)]
469        pub fn setNotANumberSymbol(&self, not_a_number_symbol: Option<&NSString>);
470
471        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
472        #[unsafe(method(textAttributesForNotANumber))]
473        #[unsafe(method_family = none)]
474        pub fn textAttributesForNotANumber(
475            &self,
476        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
477
478        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
479        /// Setter for [`textAttributesForNotANumber`][Self::textAttributesForNotANumber].
480        ///
481        /// This is [copied][crate::NSCopying::copy] when set.
482        ///
483        /// # Safety
484        ///
485        /// `text_attributes_for_not_a_number` generic should be of the correct type.
486        #[unsafe(method(setTextAttributesForNotANumber:))]
487        #[unsafe(method_family = none)]
488        pub unsafe fn setTextAttributesForNotANumber(
489            &self,
490            text_attributes_for_not_a_number: Option<&NSDictionary<NSString, AnyObject>>,
491        );
492
493        #[cfg(feature = "NSString")]
494        #[unsafe(method(positiveInfinitySymbol))]
495        #[unsafe(method_family = none)]
496        pub fn positiveInfinitySymbol(&self) -> Retained<NSString>;
497
498        #[cfg(feature = "NSString")]
499        /// Setter for [`positiveInfinitySymbol`][Self::positiveInfinitySymbol].
500        ///
501        /// This is [copied][crate::NSCopying::copy] when set.
502        #[unsafe(method(setPositiveInfinitySymbol:))]
503        #[unsafe(method_family = none)]
504        pub fn setPositiveInfinitySymbol(&self, positive_infinity_symbol: &NSString);
505
506        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
507        #[unsafe(method(textAttributesForPositiveInfinity))]
508        #[unsafe(method_family = none)]
509        pub fn textAttributesForPositiveInfinity(
510            &self,
511        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
512
513        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
514        /// Setter for [`textAttributesForPositiveInfinity`][Self::textAttributesForPositiveInfinity].
515        ///
516        /// This is [copied][crate::NSCopying::copy] when set.
517        ///
518        /// # Safety
519        ///
520        /// `text_attributes_for_positive_infinity` generic should be of the correct type.
521        #[unsafe(method(setTextAttributesForPositiveInfinity:))]
522        #[unsafe(method_family = none)]
523        pub unsafe fn setTextAttributesForPositiveInfinity(
524            &self,
525            text_attributes_for_positive_infinity: Option<&NSDictionary<NSString, AnyObject>>,
526        );
527
528        #[cfg(feature = "NSString")]
529        #[unsafe(method(negativeInfinitySymbol))]
530        #[unsafe(method_family = none)]
531        pub fn negativeInfinitySymbol(&self) -> Retained<NSString>;
532
533        #[cfg(feature = "NSString")]
534        /// Setter for [`negativeInfinitySymbol`][Self::negativeInfinitySymbol].
535        ///
536        /// This is [copied][crate::NSCopying::copy] when set.
537        #[unsafe(method(setNegativeInfinitySymbol:))]
538        #[unsafe(method_family = none)]
539        pub fn setNegativeInfinitySymbol(&self, negative_infinity_symbol: &NSString);
540
541        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
542        #[unsafe(method(textAttributesForNegativeInfinity))]
543        #[unsafe(method_family = none)]
544        pub fn textAttributesForNegativeInfinity(
545            &self,
546        ) -> Option<Retained<NSDictionary<NSString, AnyObject>>>;
547
548        #[cfg(all(feature = "NSDictionary", feature = "NSString"))]
549        /// Setter for [`textAttributesForNegativeInfinity`][Self::textAttributesForNegativeInfinity].
550        ///
551        /// This is [copied][crate::NSCopying::copy] when set.
552        ///
553        /// # Safety
554        ///
555        /// `text_attributes_for_negative_infinity` generic should be of the correct type.
556        #[unsafe(method(setTextAttributesForNegativeInfinity:))]
557        #[unsafe(method_family = none)]
558        pub unsafe fn setTextAttributesForNegativeInfinity(
559            &self,
560            text_attributes_for_negative_infinity: Option<&NSDictionary<NSString, AnyObject>>,
561        );
562
563        #[cfg(feature = "NSString")]
564        #[unsafe(method(positivePrefix))]
565        #[unsafe(method_family = none)]
566        pub fn positivePrefix(&self) -> Retained<NSString>;
567
568        #[cfg(feature = "NSString")]
569        /// Setter for [`positivePrefix`][Self::positivePrefix].
570        ///
571        /// This is [copied][crate::NSCopying::copy] when set.
572        #[unsafe(method(setPositivePrefix:))]
573        #[unsafe(method_family = none)]
574        pub fn setPositivePrefix(&self, positive_prefix: Option<&NSString>);
575
576        #[cfg(feature = "NSString")]
577        #[unsafe(method(positiveSuffix))]
578        #[unsafe(method_family = none)]
579        pub fn positiveSuffix(&self) -> Retained<NSString>;
580
581        #[cfg(feature = "NSString")]
582        /// Setter for [`positiveSuffix`][Self::positiveSuffix].
583        ///
584        /// This is [copied][crate::NSCopying::copy] when set.
585        #[unsafe(method(setPositiveSuffix:))]
586        #[unsafe(method_family = none)]
587        pub fn setPositiveSuffix(&self, positive_suffix: Option<&NSString>);
588
589        #[cfg(feature = "NSString")]
590        #[unsafe(method(negativePrefix))]
591        #[unsafe(method_family = none)]
592        pub fn negativePrefix(&self) -> Retained<NSString>;
593
594        #[cfg(feature = "NSString")]
595        /// Setter for [`negativePrefix`][Self::negativePrefix].
596        ///
597        /// This is [copied][crate::NSCopying::copy] when set.
598        #[unsafe(method(setNegativePrefix:))]
599        #[unsafe(method_family = none)]
600        pub fn setNegativePrefix(&self, negative_prefix: Option<&NSString>);
601
602        #[cfg(feature = "NSString")]
603        #[unsafe(method(negativeSuffix))]
604        #[unsafe(method_family = none)]
605        pub fn negativeSuffix(&self) -> Retained<NSString>;
606
607        #[cfg(feature = "NSString")]
608        /// Setter for [`negativeSuffix`][Self::negativeSuffix].
609        ///
610        /// This is [copied][crate::NSCopying::copy] when set.
611        #[unsafe(method(setNegativeSuffix:))]
612        #[unsafe(method_family = none)]
613        pub fn setNegativeSuffix(&self, negative_suffix: Option<&NSString>);
614
615        #[cfg(feature = "NSString")]
616        #[unsafe(method(currencyCode))]
617        #[unsafe(method_family = none)]
618        pub fn currencyCode(&self) -> Retained<NSString>;
619
620        #[cfg(feature = "NSString")]
621        /// Setter for [`currencyCode`][Self::currencyCode].
622        ///
623        /// This is [copied][crate::NSCopying::copy] when set.
624        #[unsafe(method(setCurrencyCode:))]
625        #[unsafe(method_family = none)]
626        pub fn setCurrencyCode(&self, currency_code: Option<&NSString>);
627
628        #[cfg(feature = "NSString")]
629        #[unsafe(method(currencySymbol))]
630        #[unsafe(method_family = none)]
631        pub fn currencySymbol(&self) -> Retained<NSString>;
632
633        #[cfg(feature = "NSString")]
634        /// Setter for [`currencySymbol`][Self::currencySymbol].
635        ///
636        /// This is [copied][crate::NSCopying::copy] when set.
637        #[unsafe(method(setCurrencySymbol:))]
638        #[unsafe(method_family = none)]
639        pub fn setCurrencySymbol(&self, currency_symbol: Option<&NSString>);
640
641        #[cfg(feature = "NSString")]
642        #[unsafe(method(internationalCurrencySymbol))]
643        #[unsafe(method_family = none)]
644        pub fn internationalCurrencySymbol(&self) -> Retained<NSString>;
645
646        #[cfg(feature = "NSString")]
647        /// Setter for [`internationalCurrencySymbol`][Self::internationalCurrencySymbol].
648        ///
649        /// This is [copied][crate::NSCopying::copy] when set.
650        #[unsafe(method(setInternationalCurrencySymbol:))]
651        #[unsafe(method_family = none)]
652        pub fn setInternationalCurrencySymbol(
653            &self,
654            international_currency_symbol: Option<&NSString>,
655        );
656
657        #[cfg(feature = "NSString")]
658        #[unsafe(method(percentSymbol))]
659        #[unsafe(method_family = none)]
660        pub fn percentSymbol(&self) -> Retained<NSString>;
661
662        #[cfg(feature = "NSString")]
663        /// Setter for [`percentSymbol`][Self::percentSymbol].
664        ///
665        /// This is [copied][crate::NSCopying::copy] when set.
666        #[unsafe(method(setPercentSymbol:))]
667        #[unsafe(method_family = none)]
668        pub fn setPercentSymbol(&self, percent_symbol: Option<&NSString>);
669
670        #[cfg(feature = "NSString")]
671        #[unsafe(method(perMillSymbol))]
672        #[unsafe(method_family = none)]
673        pub fn perMillSymbol(&self) -> Retained<NSString>;
674
675        #[cfg(feature = "NSString")]
676        /// Setter for [`perMillSymbol`][Self::perMillSymbol].
677        ///
678        /// This is [copied][crate::NSCopying::copy] when set.
679        #[unsafe(method(setPerMillSymbol:))]
680        #[unsafe(method_family = none)]
681        pub fn setPerMillSymbol(&self, per_mill_symbol: Option<&NSString>);
682
683        #[cfg(feature = "NSString")]
684        #[unsafe(method(minusSign))]
685        #[unsafe(method_family = none)]
686        pub fn minusSign(&self) -> Retained<NSString>;
687
688        #[cfg(feature = "NSString")]
689        /// Setter for [`minusSign`][Self::minusSign].
690        ///
691        /// This is [copied][crate::NSCopying::copy] when set.
692        #[unsafe(method(setMinusSign:))]
693        #[unsafe(method_family = none)]
694        pub fn setMinusSign(&self, minus_sign: Option<&NSString>);
695
696        #[cfg(feature = "NSString")]
697        #[unsafe(method(plusSign))]
698        #[unsafe(method_family = none)]
699        pub fn plusSign(&self) -> Retained<NSString>;
700
701        #[cfg(feature = "NSString")]
702        /// Setter for [`plusSign`][Self::plusSign].
703        ///
704        /// This is [copied][crate::NSCopying::copy] when set.
705        #[unsafe(method(setPlusSign:))]
706        #[unsafe(method_family = none)]
707        pub fn setPlusSign(&self, plus_sign: Option<&NSString>);
708
709        #[cfg(feature = "NSString")]
710        #[unsafe(method(exponentSymbol))]
711        #[unsafe(method_family = none)]
712        pub fn exponentSymbol(&self) -> Retained<NSString>;
713
714        #[cfg(feature = "NSString")]
715        /// Setter for [`exponentSymbol`][Self::exponentSymbol].
716        ///
717        /// This is [copied][crate::NSCopying::copy] when set.
718        #[unsafe(method(setExponentSymbol:))]
719        #[unsafe(method_family = none)]
720        pub fn setExponentSymbol(&self, exponent_symbol: Option<&NSString>);
721
722        #[unsafe(method(groupingSize))]
723        #[unsafe(method_family = none)]
724        pub fn groupingSize(&self) -> NSUInteger;
725
726        /// Setter for [`groupingSize`][Self::groupingSize].
727        #[unsafe(method(setGroupingSize:))]
728        #[unsafe(method_family = none)]
729        pub fn setGroupingSize(&self, grouping_size: NSUInteger);
730
731        #[unsafe(method(secondaryGroupingSize))]
732        #[unsafe(method_family = none)]
733        pub fn secondaryGroupingSize(&self) -> NSUInteger;
734
735        /// Setter for [`secondaryGroupingSize`][Self::secondaryGroupingSize].
736        #[unsafe(method(setSecondaryGroupingSize:))]
737        #[unsafe(method_family = none)]
738        pub fn setSecondaryGroupingSize(&self, secondary_grouping_size: NSUInteger);
739
740        #[cfg(feature = "NSValue")]
741        #[unsafe(method(multiplier))]
742        #[unsafe(method_family = none)]
743        pub fn multiplier(&self) -> Option<Retained<NSNumber>>;
744
745        #[cfg(feature = "NSValue")]
746        /// Setter for [`multiplier`][Self::multiplier].
747        ///
748        /// This is [copied][crate::NSCopying::copy] when set.
749        #[unsafe(method(setMultiplier:))]
750        #[unsafe(method_family = none)]
751        pub fn setMultiplier(&self, multiplier: Option<&NSNumber>);
752
753        #[unsafe(method(formatWidth))]
754        #[unsafe(method_family = none)]
755        pub fn formatWidth(&self) -> NSUInteger;
756
757        /// Setter for [`formatWidth`][Self::formatWidth].
758        #[unsafe(method(setFormatWidth:))]
759        #[unsafe(method_family = none)]
760        pub fn setFormatWidth(&self, format_width: NSUInteger);
761
762        #[cfg(feature = "NSString")]
763        #[unsafe(method(paddingCharacter))]
764        #[unsafe(method_family = none)]
765        pub fn paddingCharacter(&self) -> Retained<NSString>;
766
767        #[cfg(feature = "NSString")]
768        /// Setter for [`paddingCharacter`][Self::paddingCharacter].
769        ///
770        /// This is [copied][crate::NSCopying::copy] when set.
771        #[unsafe(method(setPaddingCharacter:))]
772        #[unsafe(method_family = none)]
773        pub fn setPaddingCharacter(&self, padding_character: Option<&NSString>);
774
775        #[unsafe(method(paddingPosition))]
776        #[unsafe(method_family = none)]
777        pub fn paddingPosition(&self) -> NSNumberFormatterPadPosition;
778
779        /// Setter for [`paddingPosition`][Self::paddingPosition].
780        #[unsafe(method(setPaddingPosition:))]
781        #[unsafe(method_family = none)]
782        pub fn setPaddingPosition(&self, padding_position: NSNumberFormatterPadPosition);
783
784        #[unsafe(method(roundingMode))]
785        #[unsafe(method_family = none)]
786        pub fn roundingMode(&self) -> NSNumberFormatterRoundingMode;
787
788        /// Setter for [`roundingMode`][Self::roundingMode].
789        #[unsafe(method(setRoundingMode:))]
790        #[unsafe(method_family = none)]
791        pub fn setRoundingMode(&self, rounding_mode: NSNumberFormatterRoundingMode);
792
793        #[cfg(feature = "NSValue")]
794        #[unsafe(method(roundingIncrement))]
795        #[unsafe(method_family = none)]
796        pub fn roundingIncrement(&self) -> Retained<NSNumber>;
797
798        #[cfg(feature = "NSValue")]
799        /// Setter for [`roundingIncrement`][Self::roundingIncrement].
800        ///
801        /// This is [copied][crate::NSCopying::copy] when set.
802        #[unsafe(method(setRoundingIncrement:))]
803        #[unsafe(method_family = none)]
804        pub fn setRoundingIncrement(&self, rounding_increment: Option<&NSNumber>);
805
806        #[unsafe(method(minimumIntegerDigits))]
807        #[unsafe(method_family = none)]
808        pub fn minimumIntegerDigits(&self) -> NSUInteger;
809
810        /// Setter for [`minimumIntegerDigits`][Self::minimumIntegerDigits].
811        #[unsafe(method(setMinimumIntegerDigits:))]
812        #[unsafe(method_family = none)]
813        pub fn setMinimumIntegerDigits(&self, minimum_integer_digits: NSUInteger);
814
815        #[unsafe(method(maximumIntegerDigits))]
816        #[unsafe(method_family = none)]
817        pub fn maximumIntegerDigits(&self) -> NSUInteger;
818
819        /// Setter for [`maximumIntegerDigits`][Self::maximumIntegerDigits].
820        #[unsafe(method(setMaximumIntegerDigits:))]
821        #[unsafe(method_family = none)]
822        pub fn setMaximumIntegerDigits(&self, maximum_integer_digits: NSUInteger);
823
824        #[unsafe(method(minimumFractionDigits))]
825        #[unsafe(method_family = none)]
826        pub fn minimumFractionDigits(&self) -> NSUInteger;
827
828        /// Setter for [`minimumFractionDigits`][Self::minimumFractionDigits].
829        #[unsafe(method(setMinimumFractionDigits:))]
830        #[unsafe(method_family = none)]
831        pub fn setMinimumFractionDigits(&self, minimum_fraction_digits: NSUInteger);
832
833        #[unsafe(method(maximumFractionDigits))]
834        #[unsafe(method_family = none)]
835        pub fn maximumFractionDigits(&self) -> NSUInteger;
836
837        /// Setter for [`maximumFractionDigits`][Self::maximumFractionDigits].
838        #[unsafe(method(setMaximumFractionDigits:))]
839        #[unsafe(method_family = none)]
840        pub fn setMaximumFractionDigits(&self, maximum_fraction_digits: NSUInteger);
841
842        #[cfg(feature = "NSValue")]
843        #[unsafe(method(minimum))]
844        #[unsafe(method_family = none)]
845        pub fn minimum(&self) -> Option<Retained<NSNumber>>;
846
847        #[cfg(feature = "NSValue")]
848        /// Setter for [`minimum`][Self::minimum].
849        ///
850        /// This is [copied][crate::NSCopying::copy] when set.
851        #[unsafe(method(setMinimum:))]
852        #[unsafe(method_family = none)]
853        pub fn setMinimum(&self, minimum: Option<&NSNumber>);
854
855        #[cfg(feature = "NSValue")]
856        #[unsafe(method(maximum))]
857        #[unsafe(method_family = none)]
858        pub fn maximum(&self) -> Option<Retained<NSNumber>>;
859
860        #[cfg(feature = "NSValue")]
861        /// Setter for [`maximum`][Self::maximum].
862        ///
863        /// This is [copied][crate::NSCopying::copy] when set.
864        #[unsafe(method(setMaximum:))]
865        #[unsafe(method_family = none)]
866        pub fn setMaximum(&self, maximum: Option<&NSNumber>);
867
868        #[cfg(feature = "NSString")]
869        #[unsafe(method(currencyGroupingSeparator))]
870        #[unsafe(method_family = none)]
871        pub fn currencyGroupingSeparator(&self) -> Retained<NSString>;
872
873        #[cfg(feature = "NSString")]
874        /// Setter for [`currencyGroupingSeparator`][Self::currencyGroupingSeparator].
875        ///
876        /// This is [copied][crate::NSCopying::copy] when set.
877        #[unsafe(method(setCurrencyGroupingSeparator:))]
878        #[unsafe(method_family = none)]
879        pub fn setCurrencyGroupingSeparator(&self, currency_grouping_separator: Option<&NSString>);
880
881        #[unsafe(method(isLenient))]
882        #[unsafe(method_family = none)]
883        pub fn isLenient(&self) -> bool;
884
885        /// Setter for [`isLenient`][Self::isLenient].
886        #[unsafe(method(setLenient:))]
887        #[unsafe(method_family = none)]
888        pub fn setLenient(&self, lenient: bool);
889
890        #[unsafe(method(usesSignificantDigits))]
891        #[unsafe(method_family = none)]
892        pub fn usesSignificantDigits(&self) -> bool;
893
894        /// Setter for [`usesSignificantDigits`][Self::usesSignificantDigits].
895        #[unsafe(method(setUsesSignificantDigits:))]
896        #[unsafe(method_family = none)]
897        pub fn setUsesSignificantDigits(&self, uses_significant_digits: bool);
898
899        #[unsafe(method(minimumSignificantDigits))]
900        #[unsafe(method_family = none)]
901        pub fn minimumSignificantDigits(&self) -> NSUInteger;
902
903        /// Setter for [`minimumSignificantDigits`][Self::minimumSignificantDigits].
904        #[unsafe(method(setMinimumSignificantDigits:))]
905        #[unsafe(method_family = none)]
906        pub fn setMinimumSignificantDigits(&self, minimum_significant_digits: NSUInteger);
907
908        #[unsafe(method(maximumSignificantDigits))]
909        #[unsafe(method_family = none)]
910        pub fn maximumSignificantDigits(&self) -> NSUInteger;
911
912        /// Setter for [`maximumSignificantDigits`][Self::maximumSignificantDigits].
913        #[unsafe(method(setMaximumSignificantDigits:))]
914        #[unsafe(method_family = none)]
915        pub fn setMaximumSignificantDigits(&self, maximum_significant_digits: NSUInteger);
916
917        #[unsafe(method(isPartialStringValidationEnabled))]
918        #[unsafe(method_family = none)]
919        pub fn isPartialStringValidationEnabled(&self) -> bool;
920
921        /// Setter for [`isPartialStringValidationEnabled`][Self::isPartialStringValidationEnabled].
922        #[unsafe(method(setPartialStringValidationEnabled:))]
923        #[unsafe(method_family = none)]
924        pub fn setPartialStringValidationEnabled(&self, partial_string_validation_enabled: bool);
925    );
926}
927
928/// Methods declared on superclass `NSObject`.
929#[cfg(feature = "NSFormatter")]
930impl NSNumberFormatter {
931    extern_methods!(
932        #[unsafe(method(init))]
933        #[unsafe(method_family = init)]
934        pub fn init(this: Allocated<Self>) -> Retained<Self>;
935
936        #[unsafe(method(new))]
937        #[unsafe(method_family = new)]
938        pub fn new() -> Retained<Self>;
939    );
940}
941
942#[cfg(feature = "NSFormatter")]
943impl DefaultRetained for NSNumberFormatter {
944    #[inline]
945    fn default_retained() -> Retained<Self> {
946        Self::new()
947    }
948}
949
950/// NSNumberFormatterCompatibility.
951#[cfg(feature = "NSFormatter")]
952impl NSNumberFormatter {
953    extern_methods!(
954        #[unsafe(method(hasThousandSeparators))]
955        #[unsafe(method_family = none)]
956        pub fn hasThousandSeparators(&self) -> bool;
957
958        /// Setter for [`hasThousandSeparators`][Self::hasThousandSeparators].
959        #[unsafe(method(setHasThousandSeparators:))]
960        #[unsafe(method_family = none)]
961        pub fn setHasThousandSeparators(&self, has_thousand_separators: bool);
962
963        #[cfg(feature = "NSString")]
964        #[unsafe(method(thousandSeparator))]
965        #[unsafe(method_family = none)]
966        pub fn thousandSeparator(&self) -> Retained<NSString>;
967
968        #[cfg(feature = "NSString")]
969        /// Setter for [`thousandSeparator`][Self::thousandSeparator].
970        ///
971        /// This is [copied][crate::NSCopying::copy] when set.
972        #[unsafe(method(setThousandSeparator:))]
973        #[unsafe(method_family = none)]
974        pub fn setThousandSeparator(&self, thousand_separator: Option<&NSString>);
975
976        #[unsafe(method(localizesFormat))]
977        #[unsafe(method_family = none)]
978        pub fn localizesFormat(&self) -> bool;
979
980        /// Setter for [`localizesFormat`][Self::localizesFormat].
981        #[unsafe(method(setLocalizesFormat:))]
982        #[unsafe(method_family = none)]
983        pub fn setLocalizesFormat(&self, localizes_format: bool);
984
985        #[cfg(feature = "NSString")]
986        #[unsafe(method(format))]
987        #[unsafe(method_family = none)]
988        pub fn format(&self) -> Retained<NSString>;
989
990        #[cfg(feature = "NSString")]
991        /// Setter for [`format`][Self::format].
992        ///
993        /// This is [copied][crate::NSCopying::copy] when set.
994        #[unsafe(method(setFormat:))]
995        #[unsafe(method_family = none)]
996        pub fn setFormat(&self, format: &NSString);
997
998        #[cfg(feature = "NSAttributedString")]
999        #[unsafe(method(attributedStringForZero))]
1000        #[unsafe(method_family = none)]
1001        pub fn attributedStringForZero(&self) -> Retained<NSAttributedString>;
1002
1003        #[cfg(feature = "NSAttributedString")]
1004        /// Setter for [`attributedStringForZero`][Self::attributedStringForZero].
1005        ///
1006        /// This is [copied][crate::NSCopying::copy] when set.
1007        #[unsafe(method(setAttributedStringForZero:))]
1008        #[unsafe(method_family = none)]
1009        pub fn setAttributedStringForZero(&self, attributed_string_for_zero: &NSAttributedString);
1010
1011        #[cfg(feature = "NSAttributedString")]
1012        #[unsafe(method(attributedStringForNil))]
1013        #[unsafe(method_family = none)]
1014        pub fn attributedStringForNil(&self) -> Retained<NSAttributedString>;
1015
1016        #[cfg(feature = "NSAttributedString")]
1017        /// Setter for [`attributedStringForNil`][Self::attributedStringForNil].
1018        ///
1019        /// This is [copied][crate::NSCopying::copy] when set.
1020        #[unsafe(method(setAttributedStringForNil:))]
1021        #[unsafe(method_family = none)]
1022        pub fn setAttributedStringForNil(&self, attributed_string_for_nil: &NSAttributedString);
1023
1024        #[cfg(feature = "NSAttributedString")]
1025        #[unsafe(method(attributedStringForNotANumber))]
1026        #[unsafe(method_family = none)]
1027        pub fn attributedStringForNotANumber(&self) -> Retained<NSAttributedString>;
1028
1029        #[cfg(feature = "NSAttributedString")]
1030        /// Setter for [`attributedStringForNotANumber`][Self::attributedStringForNotANumber].
1031        ///
1032        /// This is [copied][crate::NSCopying::copy] when set.
1033        #[unsafe(method(setAttributedStringForNotANumber:))]
1034        #[unsafe(method_family = none)]
1035        pub fn setAttributedStringForNotANumber(
1036            &self,
1037            attributed_string_for_not_a_number: &NSAttributedString,
1038        );
1039
1040        #[cfg(feature = "NSDecimalNumber")]
1041        #[unsafe(method(roundingBehavior))]
1042        #[unsafe(method_family = none)]
1043        pub fn roundingBehavior(&self) -> Retained<NSDecimalNumberHandler>;
1044
1045        #[cfg(feature = "NSDecimalNumber")]
1046        /// Setter for [`roundingBehavior`][Self::roundingBehavior].
1047        ///
1048        /// This is [copied][crate::NSCopying::copy] when set.
1049        #[unsafe(method(setRoundingBehavior:))]
1050        #[unsafe(method_family = none)]
1051        pub fn setRoundingBehavior(&self, rounding_behavior: &NSDecimalNumberHandler);
1052    );
1053}