1use objc::{msg_send, sel, sel_impl};
2
3use crate::{
4 object,
5 objective_c_runtime::{id, macros::interface_impl, traits::FromId},
6 utils::to_bool,
7};
8
9use super::{
10 INSFormatter, Int, NSAttributedString, NSDecimalNumberHandler, NSDictionary, NSError,
11 NSFormattingContext, NSLocale, NSNumber, NSNumberFormatterBehavior,
12 NSNumberFormatterPadPosition, NSNumberFormatterRoundingMode, NSNumberFormatterStyle, NSRange,
13 NSString, UInt,
14};
15
16object! {
17 unsafe pub struct NSNumberFormatter;
20}
21
22impl INSFormatter for NSNumberFormatter {}
23
24#[interface_impl(NSFormatter)]
25impl NSNumberFormatter {
26 #[property]
31 pub fn formatter_behavior(&self) -> NSNumberFormatterBehavior {
32 unsafe { msg_send![self.m_self(), formatterBehavior] }
33 }
34
35 #[property]
37 pub fn set_formatter_behavior(&mut self, behavior: NSNumberFormatterBehavior) {
38 unsafe { msg_send![self.m_self(), setFormatterBehavior: behavior] }
39 }
40
41 #[method]
44 pub fn set_default_formatter_behavior(behavior: NSNumberFormatterBehavior) {
45 unsafe { msg_send![Self::m_class(), setDefaultFormatterBehavior: behavior] }
46 }
47
48 #[method]
51 pub fn default_formatter_behavior() -> NSNumberFormatterBehavior {
52 unsafe { msg_send![Self::m_class(), defaultFormatterBehavior] }
53 }
54
55 #[property]
57 pub fn number_style(&self) -> NSNumberFormatterStyle {
58 unsafe { msg_send![self.m_self(), numberStyle] }
59 }
60
61 #[property]
63 pub fn set_number_style(&mut self, style: NSNumberFormatterStyle) {
64 unsafe { msg_send![self.m_self(), setNumberStyle: style] }
65 }
66
67 #[property]
70 pub fn generates_decimal_numbers(&self) {
71 unsafe { msg_send![self.m_self(), generatesDecimalNumbers] }
72 }
73
74 #[method]
80 pub fn get_object_value_for_string_range_error(
81 &self,
82 obj: id,
83 string: NSString,
84 rangep: NSRange,
85 error: NSError,
86 ) -> bool {
87 unsafe {
88 to_bool(
89 msg_send![self.m_self(), getObjectValue:obj forString:string range:rangep error: error],
90 )
91 }
92 }
93
94 #[method]
96 pub fn number_from_string(&self, string: NSString) -> NSNumber {
97 unsafe { NSNumber::from_id(msg_send![self.m_self(), numberFromString: string]) }
98 }
99
100 #[method]
103 pub fn string_from_number(&self, number: NSNumber) -> NSString {
104 unsafe { NSString::from_id(msg_send![self.m_self(), stringFromNumber: number]) }
105 }
106
107 #[method]
109 pub fn localized_string_from_number_number_style(
110 num: NSNumber,
111 nstyle: NSNumberFormatterStyle,
112 ) -> NSString {
113 unsafe {
114 NSString::from_id(
115 msg_send![Self::m_class(), localizedStringFromNumber: num numberStyle: nstyle],
116 )
117 }
118 }
119
120 #[property]
128 pub fn localizes_format(&self) -> bool {
129 unsafe { to_bool(msg_send![self.m_self(), localizesFormat]) }
130 }
131
132 #[property]
137 pub fn set_localizes_format(&mut self, localizes_format: bool) {
138 unsafe { msg_send![self.m_self(), setLocalizesFormat: localizes_format] }
139 }
140
141 #[property]
143 pub fn locale(&self) -> NSLocale {
144 unsafe { NSLocale::from_id(msg_send![self.m_self(), locale]) }
145 }
146
147 #[property]
149 pub fn set_locale(&mut self, locale: NSLocale) {
150 unsafe { msg_send![self.m_self(), setLocale: locale] }
151 }
152
153 #[property]
158 pub fn rounding_behavior(&self) -> NSDecimalNumberHandler {
159 unsafe { NSDecimalNumberHandler::from_id(msg_send![self.m_self(), roundingBehavior]) }
160 }
161
162 #[property]
164 pub fn set_rounding_behavior(&mut self, behavior: NSNumberFormatterBehavior) {
165 unsafe { msg_send![self.m_self(), setRoundingBehavior: behavior] }
166 }
167
168 #[property]
170 pub fn rounding_increment(&self) -> NSNumber {
171 unsafe { NSNumber::from_id(msg_send![self.m_self(), roundingIncrement]) }
172 }
173
174 #[property]
176 pub fn set_rounding_increment(&mut self, number: NSNumber) {
177 unsafe { msg_send![self.m_self(), setRoundingIncrement: number] }
178 }
179
180 #[property]
182 pub fn rounding_mode(&self) -> NSNumberFormatterRoundingMode {
183 unsafe { msg_send![self.m_self(), roundingMode] }
184 }
185
186 #[property]
188 pub fn set_rounding_mode(&mut self, mode: NSNumberFormatterRoundingMode) {
189 unsafe { msg_send![self.m_self(), setRoundingMode: mode] }
190 }
191
192 #[property]
197 pub fn minimum_integer_digits(&self) -> UInt {
198 unsafe { msg_send![self.m_self(), minimumIntegerDigits] }
199 }
200
201 #[property]
218 pub fn set_minimum_integer_digits(&mut self, min: UInt) {
219 unsafe { msg_send![self.m_self(), setMinimumIntegerDigits: min] }
220 }
221
222 #[property]
224 pub fn maximum_integer_digits(&self) -> UInt {
225 unsafe { msg_send![self.m_self(), maximumIntegerDigits] }
226 }
227
228 #[property]
245 pub fn set_maximum_integer_digits(&mut self, max: UInt) {
246 unsafe { msg_send![self.m_self(), setMaximumIntegerDigits: max] }
247 }
248
249 #[property]
251 pub fn minimum_fraction_digits(&self) -> UInt {
252 unsafe { msg_send![self.m_self(), minimumFractionDigits] }
253 }
254
255 #[property]
272 pub fn set_minimum_fraction_digits(&mut self, min: UInt) {
273 unsafe { msg_send![self.m_self(), setMinimumFractionDigits: min] }
274 }
275
276 #[property]
278 pub fn maximum_fraction_digits(&self) -> UInt {
279 unsafe { msg_send![self.m_self(), maximumFractionDigits] }
280 }
281
282 #[property]
299 pub fn set_maximum_fraction_digits(&mut self, max: UInt) {
300 unsafe { msg_send![self.m_self(), setMaximumFractionDigits: max] }
301 }
302
303 #[property]
306 pub fn uses_significant_digits(&self) -> bool {
307 unsafe { to_bool(msg_send![self.m_self(), setUsesSignificantDigits]) }
308 }
309
310 #[property]
338 pub fn set_uses_significant_digits(&mut self, uses: bool) {
339 unsafe { msg_send![self.m_self(), setUsesSignificantDigits: uses] }
340 }
341
342 #[property]
344 pub fn minimum_significant_digits(&self) -> UInt {
345 unsafe { msg_send![self.m_self(), minimumSignificantDigits] }
346 }
347
348 #[property]
350 pub fn set_minimum_significant_digits(&self, min: UInt) {
351 unsafe { msg_send![self.m_self(), setMinimumSignificantDigits: min] }
352 }
353
354 #[property]
356 pub fn maximum_significant_digits(&self) -> UInt {
357 unsafe { msg_send![self.m_self(), maximumSignificantDigits] }
358 }
359
360 #[property]
362 pub fn set_maximum_significant_digits(&self, max: UInt) {
363 unsafe { msg_send![self.m_self(), setMaximumSignificantDigits: max] }
364 }
365
366 #[property]
371 pub fn format(&self) -> NSString {
372 unsafe { NSString::from_id(msg_send![self.m_self(), format]) }
373 }
374
375 #[property]
377 pub fn set_format(&mut self, format: NSString) {
378 unsafe { msg_send![self.m_self(), setFormat: format] }
379 }
380
381 #[property]
383 pub fn formatting_context(&self) -> NSFormattingContext {
384 unsafe { msg_send![self.m_self(), formattingContext] }
385 }
386
387 #[property]
389 pub fn set_formatting_context(&mut self, context: NSFormattingContext) {
390 unsafe { msg_send![self.m_self(), setFormattingContext: context] }
391 }
392
393 #[property]
395 pub fn format_width(&self) -> UInt {
396 unsafe { msg_send![self.m_self(), formatWidth] }
397 }
398
399 #[property]
401 pub fn set_format_width(&mut self, width: UInt) {
402 unsafe { msg_send![self.m_self(), setFormatWidth: width] }
403 }
404
405 #[property]
407 pub fn negative_format(&self) -> NSString {
408 unsafe { NSString::from_id(msg_send![self.m_self(), negativeFormat]) }
409 }
410
411 #[property]
413 pub fn set_negative_format(&mut self) {
414 unsafe { msg_send![self.m_self(), setNegativeFormat] }
415 }
416
417 #[property]
419 pub fn positive_format(&self) -> NSString {
420 unsafe { NSString::from_id(msg_send![self.m_self(), positiveFormat]) }
421 }
422
423 #[property]
425 pub fn set_positive_format(&mut self, format: NSString) {
426 unsafe { msg_send![self.m_self(), setPositiveFormat: format] }
427 }
428
429 #[property]
431 pub fn multiplier(&self) -> NSNumber {
432 unsafe { NSNumber::from_id(msg_send![self.m_self(), multiplier]) }
433 }
434
435 #[property]
437 pub fn set_multiplier(&mut self, multiplier: NSNumber) {
438 unsafe { msg_send![self.m_self(), setMultiplier: multiplier] }
439 }
440
441 #[property]
446 pub fn percent_symbol(&self) -> NSString {
447 unsafe { NSString::from_id(msg_send![self.m_self(), percentSymbol]) }
448 }
449
450 #[property]
452 pub fn set_percent_symbol(&mut self, symbol: NSString) {
453 unsafe { msg_send![self.m_self(), setPercentSymbol: symbol] }
454 }
455
456 #[property]
458 pub fn per_mill_symbol(&self) -> NSString {
459 unsafe { NSString::from_id(msg_send![self.m_self(), perMillSymbol]) }
460 }
461
462 #[property]
464 pub fn set_per_mill_symbol(&mut self, symbol: NSString) {
465 unsafe { msg_send![self.m_self(), setPerMillSymbol: symbol] }
466 }
467
468 #[property]
470 pub fn minus_sign(&self) -> NSString {
471 unsafe { NSString::from_id(msg_send![self.m_self(), minusSign]) }
472 }
473
474 #[property]
476 pub fn set_minus_sign(&mut self, sign: NSString) {
477 unsafe { msg_send![self.m_self(), setMinusSign: sign] }
478 }
479
480 #[property]
482 pub fn plus_sign(&self) -> NSString {
483 unsafe { NSString::from_id(msg_send![self.m_self(), plusSign]) }
484 }
485
486 #[property]
488 pub fn set_plus_sign(&mut self, sign: NSString) {
489 unsafe { msg_send![self.m_self(), setPlusSign: sign] }
490 }
491
492 #[property]
494 pub fn exponent_symbol(&self) -> NSString {
495 unsafe { NSString::from_id(msg_send![self.m_self(), exponentSymbol]) }
496 }
497
498 #[property]
500 pub fn set_exponent_symbol(&mut self, sign: NSString) {
501 unsafe { msg_send![self.m_self(), setExponentSymbol: sign] }
502 }
503
504 #[property]
506 pub fn zero_symbol(&self) -> NSString {
507 unsafe { NSString::from_id(msg_send![self.m_self(), zeroSymbol]) }
508 }
509
510 #[property]
512 pub fn set_zero_symbol(&mut self, sign: NSString) {
513 unsafe { msg_send![self.m_self(), setZeroSymbol: sign] }
514 }
515
516 #[property]
518 pub fn nil_symbol(&self) -> NSString {
519 unsafe { NSString::from_id(msg_send![self.m_self(), nilSymbol]) }
520 }
521
522 #[property]
524 pub fn set_nil_symbol(&mut self, sign: NSString) {
525 unsafe { msg_send![self.m_self(), setNilSymbol: sign] }
526 }
527
528 #[property]
530 pub fn not_a_number_symbol(&self) -> NSString {
531 unsafe { NSString::from_id(msg_send![self.m_self(), notANumberSymbol]) }
532 }
533
534 #[property]
536 pub fn set_not_a_number_symbol(&mut self, symbol: NSString) {
537 unsafe { msg_send![self.m_self(), setNotANumberSymbol: symbol] }
538 }
539
540 #[property]
542 pub fn negative_infinity_symbol(&self) -> NSString {
543 unsafe { NSString::from_id(msg_send![self.m_self(), negativeInfinitySymbol]) }
544 }
545
546 #[property]
548 pub fn set_negative_infinity_symbol(&self, symbol: NSString) {
549 unsafe { msg_send![self.m_self(), setNegativeInfinitySymbol: symbol] }
550 }
551
552 #[property]
554 pub fn positive_infinity_symbol(&self) -> NSString {
555 unsafe { NSString::from_id(msg_send![self.m_self(), positiveInfinitySymbol]) }
556 }
557
558 #[property]
560 pub fn set_positive_infinity_symbol(&self, symbol: NSString) {
561 unsafe { msg_send![self.m_self(), setPositiveInfinitySymbol: symbol] }
562 }
563
564 #[property]
569 pub fn currency_symbol(&self) -> NSString {
570 unsafe { NSString::from_id(msg_send![self.m_self(), currencySymbol]) }
571 }
572
573 #[property]
575 pub fn set_currency_symbol(&mut self, symbol: NSString) {
576 unsafe { msg_send![self.m_self(), setCurrencySymbol: symbol] }
577 }
578
579 #[property]
581 pub fn currency_code(&self) -> NSString {
582 unsafe { NSString::from_id(msg_send![self.m_self(), currencyCode]) }
583 }
584
585 #[property]
587 pub fn set_currency_code(&mut self, code: NSString) {
588 unsafe { msg_send![self.m_self(), setCurrencyCode: code] }
589 }
590
591 #[property]
593 pub fn international_currency_symbol(&self) -> NSString {
594 unsafe { NSString::from_id(msg_send![self.m_self(), internationalCurrencySymbol]) }
595 }
596
597 #[property]
599 pub fn set_international_currency_symbol(&mut self, symbol: NSString) {
600 unsafe { msg_send![self.m_self(), setInternationalCurrencySymbol: symbol] }
601 }
602
603 #[property]
605 pub fn currency_grouping_separator(&self) -> NSString {
606 unsafe { NSString::from_id(msg_send![self.m_self(), currencyGroupingSepator]) }
607 }
608
609 #[property]
614 pub fn positive_prefix(&self) -> NSString {
615 unsafe { NSString::from_id(msg_send![self.m_self(), positivePrefix]) }
616 }
617
618 #[property]
620 pub fn set_positive_prefix(&mut self, prefix: NSString) {
621 unsafe { msg_send![self.m_self(), setPositivePrefix: prefix] }
622 }
623
624 #[property]
626 pub fn positive_suffix(&self) -> NSString {
627 unsafe { NSString::from_id(msg_send![self.m_self(), positiveSuffix]) }
628 }
629
630 #[property]
632 pub fn set_positive_suffix(&mut self, suffix: NSString) {
633 unsafe { msg_send![self.m_self(), setPositiveSuffix: suffix] }
634 }
635
636 #[property]
638 pub fn negative_prefix(&self) -> NSString {
639 unsafe { NSString::from_id(msg_send![self.m_self(), negativePrefix]) }
640 }
641
642 #[property]
644 pub fn set_negative_prefix(&mut self, prefix: NSString) {
645 unsafe { msg_send![self.m_self(), setNegativePrefix: prefix] }
646 }
647
648 #[property]
650 pub fn negative_suffix(&self) -> NSString {
651 unsafe { NSString::from_id(msg_send![self.m_self(), negativeSuffix]) }
652 }
653
654 #[property]
659 pub fn text_attributes_for_negative_values(&self) -> NSDictionary<NSString, id> {
660 unsafe { NSDictionary::from_id(msg_send![self.m_self(), negativeAttributes]) }
661 }
662
663 #[property]
665 pub fn set_text_attributes_for_negative_values(
666 &mut self,
667 attributes: NSDictionary<NSString, id>,
668 ) {
669 unsafe { msg_send![self.m_self(), setNegativeAttributes: attributes] }
670 }
671
672 #[property]
674 pub fn text_attributes_for_positive_values(&self) -> NSDictionary<NSString, id> {
675 unsafe { NSDictionary::from_id(msg_send![self.m_self(), positiveAttributes]) }
676 }
677
678 #[property]
680 pub fn set_text_attributes_for_positive_values(
681 &mut self,
682 attributes: NSDictionary<NSString, id>,
683 ) {
684 unsafe { msg_send![self.m_self(), setPositiveAttributes: attributes] }
685 }
686
687 #[property]
689 pub fn attributed_string_for_zero(&self) -> NSAttributedString {
690 unsafe { NSAttributedString::from_id(msg_send![self.m_self(), zeroAttributedString]) }
691 }
692
693 #[property]
695 pub fn set_attributed_string_for_zero(&mut self, string: NSAttributedString) {
696 unsafe { msg_send![self.m_self(), setZeroAttributedString: string] }
697 }
698
699 #[property]
701 pub fn text_attributes_for_zero(&self) -> NSDictionary<NSString, id> {
702 unsafe { NSDictionary::from_id(msg_send![self.m_self(), zeroAttributes]) }
703 }
704
705 #[property]
707 pub fn set_text_attributes_for_zero(&mut self, attributes: NSDictionary<NSString, id>) {
708 unsafe { msg_send![self.m_self(), setZeroAttributes: attributes] }
709 }
710
711 #[property]
713 pub fn attributed_string_for_nil(&self) -> NSAttributedString {
714 unsafe { NSAttributedString::from_id(msg_send![self.m_self(), nilAttributedString]) }
715 }
716
717 #[property]
719 pub fn set_attributed_string_for_nil(&mut self, string: NSAttributedString) {
720 unsafe { msg_send![self.m_self(), setNilAttributedString: string] }
721 }
722
723 #[property]
725 pub fn text_attributes_for_nil(&self) -> NSDictionary<NSString, id> {
726 unsafe { NSDictionary::from_id(msg_send![self.m_self(), nilAttributes]) }
727 }
728
729 #[property]
731 pub fn set_text_attributes_for_nil(&mut self, attributes: NSDictionary<NSString, id>) {
732 unsafe { msg_send![self.m_self(), setNilAttributes: attributes] }
733 }
734
735 #[property]
737 pub fn attributed_string_for_not_a_number(&self) -> NSAttributedString {
738 unsafe { NSAttributedString::from_id(msg_send![self.m_self(), notANumberAttributedString]) }
739 }
740
741 #[property]
743 pub fn set_attributed_string_for_not_a_number(&mut self, string: NSAttributedString) {
744 unsafe { msg_send![self.m_self(), setNotANumberAttributedString: string] }
745 }
746
747 #[property]
749 pub fn text_attributes_for_not_a_number(&self) -> NSDictionary<NSString, id> {
750 unsafe { NSDictionary::from_id(msg_send![self.m_self(), notANumberAttributes]) }
751 }
752
753 #[property]
755 pub fn set_text_attributes_for_not_a_number(&mut self, attributes: NSDictionary<NSString, id>) {
756 unsafe { msg_send![self.m_self(), setNotANumberAttributes: attributes] }
757 }
758
759 #[property]
761 pub fn text_attributes_for_positive_infinity(&self) -> NSDictionary<NSString, id> {
762 unsafe { NSDictionary::from_id(msg_send![self.m_self(), positiveInfinityAttributes]) }
763 }
764
765 #[property]
767 pub fn set_text_attributes_for_positive_infinity(
768 &mut self,
769 attributes: NSDictionary<NSString, id>,
770 ) {
771 unsafe { msg_send![self.m_self(), setPositiveInfinityAttributes: attributes] }
772 }
773
774 #[property]
776 pub fn text_attributes_for_negative_infinity(&self) -> NSDictionary<NSString, id> {
777 unsafe { NSDictionary::from_id(msg_send![self.m_self(), negativeInfinityAttributes]) }
778 }
779
780 #[property]
782 pub fn set_text_attributes_for_negative_infinity(
783 &mut self,
784 attributes: NSDictionary<NSString, id>,
785 ) {
786 unsafe { msg_send![self.m_self(), setNegativeInfinityAttributes: attributes] }
787 }
788
789 #[property]
794 pub fn grouping_separator(&self) -> NSString {
795 unsafe { NSString::from_id(msg_send![self.m_self(), groupingSeparator]) }
796 }
797
798 #[property]
800 pub fn set_grouping_separator(&mut self, separator: NSString) {
801 unsafe { msg_send![self.m_self(), setGroupingSeparator: separator] }
802 }
803
804 #[property]
806 pub fn uses_grouping_separator(&self) -> bool {
807 unsafe { to_bool(msg_send![self.m_self(), usesGroupingSeparator]) }
808 }
809
810 #[property]
812 pub fn set_uses_grouping_separator(&mut self, flag: bool) {
813 unsafe { msg_send![self.m_self(), setUsesGroupingSeparator: flag] }
814 }
815
816 #[property]
818 pub fn thousand_separator(&self) -> NSString {
819 unsafe { NSString::from_id(msg_send![self.m_self(), thousandSeparator]) }
820 }
821
822 #[property]
824 pub fn set_thousand_separator(&mut self, separator: NSString) {
825 unsafe { msg_send![self.m_self(), setThousandSeparator: separator] }
826 }
827
828 #[property]
830 pub fn uses_thousand_separators(&self) -> bool {
831 unsafe { to_bool(msg_send![self.m_self(), usesThousandSeparators]) }
832 }
833
834 #[property]
836 pub fn set_uses_thousand_separators(&mut self, flag: bool) {
837 unsafe { msg_send![self.m_self(), setUsesThousandSeparators: flag] }
838 }
839
840 #[property]
842 pub fn decimal_separator(&self) -> NSString {
843 unsafe { NSString::from_id(msg_send![self.m_self(), decimalSeparator]) }
844 }
845
846 #[property]
848 pub fn always_show_decimal_separator(&self) -> bool {
849 unsafe { to_bool(msg_send![self.m_self(), alwaysShowDecimalSeparator]) }
850 }
851
852 #[property]
854 pub fn set_always_show_decimal_separator(&mut self, flag: bool) {
855 unsafe { msg_send![self.m_self(), setAlwaysShowDecimalSeparator: flag] }
856 }
857
858 #[property]
860 pub fn currency_decimal_separator(&self) -> NSString {
861 unsafe { NSString::from_id(msg_send![self.m_self(), currencyDecimalSeparator]) }
862 }
863
864 #[property]
866 pub fn set_currency_decimal_separator(&mut self, separator: NSString) {
867 unsafe { msg_send![self.m_self(), setCurrencyDecimalSeparator: separator] }
868 }
869
870 #[property]
872 pub fn grouping_size(&self) -> Int {
873 unsafe { msg_send![self.m_self(), groupingSize] }
874 }
875
876 #[property]
878 pub fn set_grouping_size(&mut self, size: Int) {
879 unsafe { msg_send![self.m_self(), setGroupingSize: size] }
880 }
881
882 #[property]
884 pub fn secondary_grouping_size(&self) -> Int {
885 unsafe { msg_send![self.m_self(), secondaryGroupingSize] }
886 }
887
888 #[property]
890 pub fn set_secondary_grouping_size(&mut self, size: Int) {
891 unsafe { msg_send![self.m_self(), setSecondaryGroupingSize: size] }
892 }
893
894 #[property]
899 pub fn padding_character(&self) -> NSString {
900 unsafe { NSString::from_id(msg_send![self.m_self(), paddingCharacter]) }
901 }
902
903 #[property]
905 pub fn set_padding_character(&mut self, padding: NSString) {
906 unsafe { msg_send![self.m_self(), setPaddingCharacter: padding] }
907 }
908
909 #[property]
911 pub fn padding_position(&self) -> NSNumberFormatterPadPosition {
912 unsafe { msg_send![self.m_self(), paddingPosition] }
913 }
914
915 #[property]
917 pub fn set_padding_position(&mut self, position: NSNumberFormatterPadPosition) {
918 unsafe { msg_send![self.m_self(), setPaddingPosition: position] }
919 }
920
921 #[property]
926 pub fn allows_floats(&self) -> bool {
927 unsafe { to_bool(msg_send![self.m_self(), allowsFloats]) }
928 }
929
930 #[property]
932 pub fn set_allows_floats(&mut self, flag: bool) {
933 unsafe { msg_send![self.m_self(), setAllowsFloats: flag] }
934 }
935
936 #[property]
938 pub fn minimum(&self) -> NSNumber {
939 unsafe { NSNumber::from_id(msg_send![self.m_self(), minimum]) }
940 }
941
942 #[property]
944 pub fn set_minimum(&mut self, number: NSNumber) {
945 unsafe { msg_send![self.m_self(), setMinimum: number] }
946 }
947
948 #[property]
950 pub fn maximum(&self) -> NSNumber {
951 unsafe { NSNumber::from_id(msg_send![self.m_self(), maximum]) }
952 }
953
954 #[property]
956 pub fn set_maximum(&mut self, number: NSNumber) {
957 unsafe { msg_send![self.m_self(), setMaximum: number] }
958 }
959
960 #[property]
965 pub fn lenient(&self) -> bool {
966 unsafe { to_bool(msg_send![self.m_self(), isLenient]) }
967 }
968
969 #[property]
971 pub fn set_lenient(&mut self, flag: bool) {
972 unsafe { msg_send![self.m_self(), setLenient: flag] }
973 }
974
975 #[property]
980 pub fn partial_string_validation_enabled(&self) -> bool {
981 unsafe { to_bool(msg_send![self.m_self(), isPartialStringValidationEnabled]) }
982 }
983
984 #[property]
986 pub fn set_partial_string_validation_enabled(&mut self, flag: bool) {
987 unsafe { msg_send![self.m_self(), setPartialStringValidationEnabled: flag] }
988 }
989}