objc2_tv_ui_kit/generated/
TVDigitEntryViewController.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::*;
6use objc2_foundation::*;
7use objc2_ui_kit::*;
8
9use crate::*;
10
11extern_class!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/tvuikit/tvdigitentryviewcontroller?language=objc)
13    #[unsafe(super(UIViewController, UIResponder, NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct TVDigitEntryViewController;
16);
17
18extern_conformance!(
19    unsafe impl NSCoding for TVDigitEntryViewController {}
20);
21
22extern_conformance!(
23    unsafe impl NSObjectProtocol for TVDigitEntryViewController {}
24);
25
26extern_conformance!(
27    unsafe impl UIAppearanceContainer for TVDigitEntryViewController {}
28);
29
30extern_conformance!(
31    unsafe impl UIContentContainer for TVDigitEntryViewController {}
32);
33
34extern_conformance!(
35    unsafe impl UIFocusEnvironment for TVDigitEntryViewController {}
36);
37
38extern_conformance!(
39    unsafe impl UIResponderStandardEditActions for TVDigitEntryViewController {}
40);
41
42extern_conformance!(
43    unsafe impl UITraitEnvironment for TVDigitEntryViewController {}
44);
45
46impl TVDigitEntryViewController {
47    extern_methods!(
48        #[cfg(feature = "block2")]
49        /// Entry completion handler.
50        ///
51        /// This is called when the number of digits entered reaches .numberOfDigits.
52        ///
53        /// Parameter `entry`: Digits entered.
54        #[unsafe(method(entryCompletionHandler))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn entryCompletionHandler(
57            &self,
58        ) -> NonNull<block2::DynBlock<dyn Fn(NonNull<NSString>)>>;
59
60        #[cfg(feature = "block2")]
61        /// Setter for [`entryCompletionHandler`][Self::entryCompletionHandler].
62        #[unsafe(method(setEntryCompletionHandler:))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn setEntryCompletionHandler(
65            &self,
66            entry_completion_handler: &block2::DynBlock<dyn Fn(NonNull<NSString>)>,
67        );
68
69        /// The title text.
70        ///
71        /// This is presented at the top of the digit entry view.
72        #[unsafe(method(titleText))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn titleText(&self) -> Option<Retained<NSString>>;
75
76        /// Setter for [`titleText`][Self::titleText].
77        #[unsafe(method(setTitleText:))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn setTitleText(&self, title_text: Option<&NSString>);
80
81        /// The prompt text.
82        ///
83        /// This is presented immediately below titleText.
84        #[unsafe(method(promptText))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn promptText(&self) -> Option<Retained<NSString>>;
87
88        /// Setter for [`promptText`][Self::promptText].
89        #[unsafe(method(setPromptText:))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn setPromptText(&self, prompt_text: Option<&NSString>);
92
93        /// Determines whether the entered digit is immediately obsecured.
94        ///
95        /// Default is NO.
96        #[unsafe(method(isSecureDigitEntry))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn isSecureDigitEntry(&self) -> bool;
99
100        /// Setter for [`isSecureDigitEntry`][Self::isSecureDigitEntry].
101        #[unsafe(method(setSecureDigitEntry:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setSecureDigitEntry(&self, secure_digit_entry: bool);
104
105        /// Determines the number of digits asked for by the digit entry view.
106        ///
107        /// Default is 4.
108        #[unsafe(method(numberOfDigits))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn numberOfDigits(&self) -> NSUInteger;
111
112        /// Setter for [`numberOfDigits`][Self::numberOfDigits].
113        #[unsafe(method(setNumberOfDigits:))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn setNumberOfDigits(&self, number_of_digits: NSUInteger);
116
117        /// Clears all the digits from the digit entry view.
118        ///
119        /// Parameter `animated`: If YES the digit entry view will animate.
120        #[unsafe(method(clearEntryAnimated:))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn clearEntryAnimated(&self, animated: bool);
123    );
124}
125
126/// Methods declared on superclass `UIViewController`.
127impl TVDigitEntryViewController {
128    extern_methods!(
129        #[unsafe(method(initWithNibName:bundle:))]
130        #[unsafe(method_family = init)]
131        pub unsafe fn initWithNibName_bundle(
132            this: Allocated<Self>,
133            nib_name_or_nil: Option<&NSString>,
134            nib_bundle_or_nil: Option<&NSBundle>,
135        ) -> Retained<Self>;
136
137        #[unsafe(method(initWithCoder:))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn initWithCoder(
140            this: Allocated<Self>,
141            coder: &NSCoder,
142        ) -> Option<Retained<Self>>;
143    );
144}
145
146/// Methods declared on superclass `NSObject`.
147impl TVDigitEntryViewController {
148    extern_methods!(
149        #[unsafe(method(init))]
150        #[unsafe(method_family = init)]
151        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
152
153        #[unsafe(method(new))]
154        #[unsafe(method_family = new)]
155        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
156    );
157}