objc2_browser_engine_kit/generated/BETextInputDelegate.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::*;
7
8use crate::*;
9
10extern_protocol!(
11 /// [Apple's documentation](https://developer.apple.com/documentation/browserenginekit/betextinputdelegate?language=objc)
12 pub unsafe trait BETextInputDelegate {
13 #[cfg(all(feature = "BEKeyEntryContext", feature = "BETextInput"))]
14 /// Defers the key event to the system and returns whether the key event was handled.
15 ///
16 /// For example, the system will handle key events for character insertions, deletions, key commands, and more.
17 #[unsafe(method(shouldDeferEventHandlingToSystemForTextInput:context:))]
18 #[unsafe(method_family = none)]
19 unsafe fn shouldDeferEventHandlingToSystemForTextInput_context(
20 &self,
21 text_input: &ProtocolObject<dyn BETextInput>,
22 key_event_context: &BEKeyEntryContext,
23 ) -> bool;
24
25 #[cfg(all(feature = "BETextInput", feature = "BETextSuggestion"))]
26 /// Provides text suggestions to the system.
27 ///
28 /// For example, suggestions could include data list elements or AutoFill candidates.
29 #[unsafe(method(textInput:setCandidateSuggestions:))]
30 #[unsafe(method_family = none)]
31 unsafe fn textInput_setCandidateSuggestions(
32 &self,
33 text_input: &ProtocolObject<dyn BETextInput>,
34 suggestions: Option<&NSArray<BETextSuggestion>>,
35 );
36
37 #[cfg(feature = "BETextInput")]
38 /// Tells the system when the selection is about to change in the document.
39 #[unsafe(method(selectionWillChangeForTextInput:))]
40 #[unsafe(method_family = none)]
41 unsafe fn selectionWillChangeForTextInput(
42 &self,
43 text_input: &ProtocolObject<dyn BETextInput>,
44 );
45
46 #[cfg(feature = "BETextInput")]
47 /// Tells the system when the selection has changed in the document.
48 ///
49 /// This method results in an document state refresh with an invocation to:
50 /// -[BETextInput requestTextContextForAutocorrectionWithCompletionHandler:]
51 #[unsafe(method(selectionDidChangeForTextInput:))]
52 #[unsafe(method_family = none)]
53 unsafe fn selectionDidChangeForTextInput(
54 &self,
55 text_input: &ProtocolObject<dyn BETextInput>,
56 );
57
58 #[cfg(feature = "BETextInput")]
59 /// Defers a replace text action to the ssytem.
60 ///
61 /// When handling the replace: action, use this method to defer the replacement to the system.
62 ///
63 /// For example, a replacement could be deferred after it is selected from the autocorrect replacements list.
64 ///
65 /// # Safety
66 ///
67 /// `sender` should be of the correct type.
68 #[unsafe(method(textInput:deferReplaceTextActionToSystem:))]
69 #[unsafe(method_family = none)]
70 unsafe fn textInput_deferReplaceTextActionToSystem(
71 &self,
72 text_input: &ProtocolObject<dyn BETextInput>,
73 sender: &AnyObject,
74 );
75
76 #[cfg(feature = "BETextInput")]
77 /// Tells the system the text entry context has changed and that text entry UI's need to be refreshed.
78 ///
79 /// This is a costly operation and should only used with intention. For example, when switching focus
80 /// between different elements.
81 #[unsafe(method(invalidateTextEntryContextForTextInput:))]
82 #[unsafe(method_family = none)]
83 unsafe fn invalidateTextEntryContextForTextInput(
84 &self,
85 text_input: &ProtocolObject<dyn BETextInput>,
86 );
87 }
88);