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        ///
55        /// # Safety
56        ///
57        /// The returned block's argument must be a valid pointer.
58        #[unsafe(method(entryCompletionHandler))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn entryCompletionHandler(
61            &self,
62        ) -> NonNull<block2::DynBlock<dyn Fn(NonNull<NSString>)>>;
63
64        #[cfg(feature = "block2")]
65        /// Setter for [`entryCompletionHandler`][Self::entryCompletionHandler].
66        ///
67        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
68        #[unsafe(method(setEntryCompletionHandler:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn setEntryCompletionHandler(
71            &self,
72            entry_completion_handler: &block2::DynBlock<dyn Fn(NonNull<NSString>)>,
73        );
74
75        /// The title text.
76        ///
77        /// This is presented at the top of the digit entry view.
78        #[unsafe(method(titleText))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn titleText(&self) -> Option<Retained<NSString>>;
81
82        /// Setter for [`titleText`][Self::titleText].
83        ///
84        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
85        #[unsafe(method(setTitleText:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn setTitleText(&self, title_text: Option<&NSString>);
88
89        /// The prompt text.
90        ///
91        /// This is presented immediately below titleText.
92        #[unsafe(method(promptText))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn promptText(&self) -> Option<Retained<NSString>>;
95
96        /// Setter for [`promptText`][Self::promptText].
97        ///
98        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
99        #[unsafe(method(setPromptText:))]
100        #[unsafe(method_family = none)]
101        pub unsafe fn setPromptText(&self, prompt_text: Option<&NSString>);
102
103        /// Determines whether the entered digit is immediately obsecured.
104        ///
105        /// Default is NO.
106        #[unsafe(method(isSecureDigitEntry))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn isSecureDigitEntry(&self) -> bool;
109
110        /// Setter for [`isSecureDigitEntry`][Self::isSecureDigitEntry].
111        #[unsafe(method(setSecureDigitEntry:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn setSecureDigitEntry(&self, secure_digit_entry: bool);
114
115        /// Determines the number of digits asked for by the digit entry view.
116        ///
117        /// Default is 4.
118        #[unsafe(method(numberOfDigits))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn numberOfDigits(&self) -> NSUInteger;
121
122        /// Setter for [`numberOfDigits`][Self::numberOfDigits].
123        #[unsafe(method(setNumberOfDigits:))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn setNumberOfDigits(&self, number_of_digits: NSUInteger);
126
127        /// Clears all the digits from the digit entry view.
128        ///
129        /// Parameter `animated`: If YES the digit entry view will animate.
130        #[unsafe(method(clearEntryAnimated:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn clearEntryAnimated(&self, animated: bool);
133    );
134}
135
136/// Methods declared on superclass `UIViewController`.
137impl TVDigitEntryViewController {
138    extern_methods!(
139        #[unsafe(method(initWithNibName:bundle:))]
140        #[unsafe(method_family = init)]
141        pub unsafe fn initWithNibName_bundle(
142            this: Allocated<Self>,
143            nib_name_or_nil: Option<&NSString>,
144            nib_bundle_or_nil: Option<&NSBundle>,
145        ) -> Retained<Self>;
146
147        /// # Safety
148        ///
149        /// `coder` possibly has further requirements.
150        #[unsafe(method(initWithCoder:))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn initWithCoder(
153            this: Allocated<Self>,
154            coder: &NSCoder,
155        ) -> Option<Retained<Self>>;
156    );
157}
158
159/// Methods declared on superclass `NSObject`.
160impl TVDigitEntryViewController {
161    extern_methods!(
162        #[unsafe(method(init))]
163        #[unsafe(method_family = init)]
164        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
165
166        #[unsafe(method(new))]
167        #[unsafe(method_family = new)]
168        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
169    );
170}