pub struct SpellCheckConfiguration {
pub spell_check_service: Option<Rc<dyn SpellCheckService>>,
pub misspelled_selection_color: Option<Color>,
pub misspelled_text_style: Option<TextStyle>,
pub spell_check_suggestions_toolbar_builder: Option<Rc<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>,
/* private fields */
}Expand description
Controls how spell check is performed for text input.
This configuration determines the SpellCheckService used to fetch the
SuggestionSpan spell check results and the TextStyle used to
mark misspelled words within text input.
Fields§
§spell_check_service: Option<Rc<dyn SpellCheckService>>The service used to fetch spell check results for text input.
misspelled_selection_color: Option<Color>The color the paint the selection highlight when spell check is showing suggestions for a misspelled word.
For example, on iOS, the selection appears red while the spell check menu is showing.
misspelled_text_style: Option<TextStyle>Style used to indicate misspelled words.
This is nullable to allow style-specific wrappers of EditableText
to infer this, but this must be specified if this configuration is
provided directly to EditableText or its construction will fail with an
assertion error.
spell_check_suggestions_toolbar_builder: Option<Rc<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>Builds the toolbar used to display spell check suggestions for misspelled words.
Implementations§
Source§impl SpellCheckConfiguration
impl SpellCheckConfiguration
Sourcepub const fn new() -> SpellCheckConfiguration
pub const fn new() -> SpellCheckConfiguration
Creates a configuration that specifies the service and suggestions handler for spell check.
Sourcepub const fn disabled() -> SpellCheckConfiguration
pub const fn disabled() -> SpellCheckConfiguration
Creates a configuration that disables spell check.
Sourcepub fn spell_check_service(
self,
spell_check_service: Rc<dyn SpellCheckService>,
) -> SpellCheckConfiguration
pub fn spell_check_service( self, spell_check_service: Rc<dyn SpellCheckService>, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(spellCheckService:).
Sourcepub fn misspelled_selection_color(
self,
misspelled_selection_color: Color,
) -> SpellCheckConfiguration
pub fn misspelled_selection_color( self, misspelled_selection_color: Color, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(misspelledSelectionColor:).
Sourcepub fn misspelled_text_style(
self,
misspelled_text_style: TextStyle,
) -> SpellCheckConfiguration
pub fn misspelled_text_style( self, misspelled_text_style: TextStyle, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(misspelledTextStyle:).
Sourcepub fn spell_check_suggestions_toolbar_builder(
self,
spell_check_suggestions_toolbar_builder: Rc<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>,
) -> SpellCheckConfiguration
pub fn spell_check_suggestions_toolbar_builder( self, spell_check_suggestions_toolbar_builder: Rc<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>, ) -> SpellCheckConfiguration
Dart SpellCheckConfiguration(spellCheckSuggestionsToolbarBuilder:).
Sourcepub fn spell_check_enabled(&self) -> bool
pub fn spell_check_enabled(&self) -> bool
Whether or not the configuration should enable or disable spell check.
Sourcepub fn copy_with(&self) -> SpellCheckConfiguration
pub fn copy_with(&self) -> SpellCheckConfiguration
Returns a copy of the current SpellCheckConfiguration instance with
specified overrides.
If this configuration is disabled, returns SpellCheckConfiguration::disabled.
Chain setters: config.copy_with().misspelled_text_style(style).
Trait Implementations§
Source§impl Clone for SpellCheckConfiguration
impl Clone for SpellCheckConfiguration
Source§fn clone(&self) -> SpellCheckConfiguration
fn clone(&self) -> SpellCheckConfiguration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpellCheckConfiguration
impl Debug for SpellCheckConfiguration
Source§impl Default for SpellCheckConfiguration
impl Default for SpellCheckConfiguration
Source§fn default() -> SpellCheckConfiguration
fn default() -> SpellCheckConfiguration
Auto Trait Implementations§
impl !RefUnwindSafe for SpellCheckConfiguration
impl !Send for SpellCheckConfiguration
impl !Sync for SpellCheckConfiguration
impl !UnwindSafe for SpellCheckConfiguration
impl Forget for SpellCheckConfiguration
impl Freeze for SpellCheckConfigurationwhere
*const RcInner<dyn SpellCheckService> is !null: Freeze,
PhantomData<RcInner<dyn SpellCheckService>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
*const RcInner<Paint> is !null: Freeze,
PhantomData<RcInner<Paint>>: Freeze,
PhantomData<Shadow>: Freeze,
PhantomData<FontFeature>: Freeze,
PhantomData<FontVariation>: Freeze,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>: Freeze,
impl Move for SpellCheckConfiguration
impl Unpin for SpellCheckConfigurationwhere
Rc<dyn SpellCheckService>: Unpin,
&'static dyn ColorExtension: Unpin,
Rc<dyn ColorExtension>: Unpin,
*const u8 is !null: Unpin,
Rc<Paint>: Unpin,
Rc<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>: Unpin,
impl UnsafeUnpin for SpellCheckConfigurationwhere
*const RcInner<dyn SpellCheckService> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn SpellCheckService>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const RcInner<Paint> is !null: UnsafeUnpin,
PhantomData<RcInner<Paint>>: UnsafeUnpin,
PhantomData<Shadow>: UnsafeUnpin,
PhantomData<FontFeature>: UnsafeUnpin,
PhantomData<FontVariation>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, AnyElement, Handle<EditableTextState>) -> Rc<dyn Widget>>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.