pub struct IBANInputState {
pub area: Rect,
pub inner: Rect,
pub widget: MaskedInputState,
pub country: String,
pub non_exhaustive: NonExhaustive,
}iban only.Expand description
Widget state.
Fields§
§area: Rectread only renewed with each render.
inner: Rectread only renewed with each render.
widget: MaskedInputStateread+write
country: Stringread only Current country mask.
non_exhaustive: NonExhaustiveImplementations§
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn line_width(&self) -> upos_type
pub fn line_width(&self) -> upos_type
Length as grapheme count.
Sourcepub fn set_invalid(&mut self, invalid: bool)
pub fn set_invalid(&mut self, invalid: bool)
Renders the widget in invalid style.
Sourcepub fn get_invalid(&self) -> bool
pub fn get_invalid(&self) -> bool
Renders the widget in invalid style.
Sourcepub fn set_overwrite(&mut self, overwrite: bool)
pub fn set_overwrite(&mut self, overwrite: bool)
The next edit operation will overwrite the current content instead of adding text. Any move operations will cancel this overwrite.
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn set_clipboard(&mut self, clip: Option<impl Clipboard + 'static>)
pub fn set_clipboard(&mut self, clip: Option<impl Clipboard + 'static>)
Clipboard used. Default is to use the global_clipboard.
Sourcepub fn clipboard(&self) -> Option<&dyn Clipboard>
pub fn clipboard(&self) -> Option<&dyn Clipboard>
Clipboard used. Default is to use the global_clipboard.
Sourcepub fn copy_to_clip(&mut self) -> bool
pub fn copy_to_clip(&mut self) -> bool
Copy to clipboard
Sourcepub fn cut_to_clip(&mut self) -> bool
pub fn cut_to_clip(&mut self) -> bool
Cut to clipboard
Sourcepub fn paste_from_clip(&mut self) -> bool
pub fn paste_from_clip(&mut self) -> bool
Paste from clipboard.
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn set_undo_buffer(&mut self, undo: Option<impl UndoBuffer + 'static>)
pub fn set_undo_buffer(&mut self, undo: Option<impl UndoBuffer + 'static>)
Set undo buffer.
Sourcepub fn undo_buffer(&self) -> Option<&dyn UndoBuffer>
pub fn undo_buffer(&self) -> Option<&dyn UndoBuffer>
Undo
Sourcepub fn undo_buffer_mut(&mut self) -> Option<&mut dyn UndoBuffer>
pub fn undo_buffer_mut(&mut self) -> Option<&mut dyn UndoBuffer>
Undo
Sourcepub fn recent_replay_log(&mut self) -> Vec<UndoEntry>
pub fn recent_replay_log(&mut self) -> Vec<UndoEntry>
Get all recent replay recordings.
Sourcepub fn replay_log(&mut self, replay: &[UndoEntry])
pub fn replay_log(&mut self, replay: &[UndoEntry])
Apply the replay recording.
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn add_range_style(
&mut self,
range: Range<upos_type>,
style: usize,
) -> Result<(), TextError>
pub fn add_range_style( &mut self, range: Range<upos_type>, style: usize, ) -> Result<(), TextError>
Add a style for a Range<upos_type> .
The style-nr refers to one of the styles set with the widget.
Sourcepub fn remove_style(&mut self, range: Range<usize>, style: usize)
pub fn remove_style(&mut self, range: Range<usize>, style: usize)
Remove the exact TextRange and style.
Sourcepub fn remove_range_style(
&mut self,
range: Range<upos_type>,
style: usize,
) -> Result<(), TextError>
pub fn remove_range_style( &mut self, range: Range<upos_type>, style: usize, ) -> Result<(), TextError>
Remove the exact Range<upos_type> and style.
Sourcepub fn styles_in(
&self,
range: Range<usize>,
buf: &mut Vec<(Range<usize>, usize)>,
)
pub fn styles_in( &self, range: Range<usize>, buf: &mut Vec<(Range<usize>, usize)>, )
Find all styles that touch the given range.
Sourcepub fn styles_at(&self, byte_pos: usize, buf: &mut Vec<(Range<usize>, usize)>)
pub fn styles_at(&self, byte_pos: usize, buf: &mut Vec<(Range<usize>, usize)>)
All styles active at the given position.
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn set_offset(&mut self, offset: upos_type)
pub fn set_offset(&mut self, offset: upos_type)
Offset shown. This is corrected if the cursor wouldn’t be visible.
Sourcepub fn set_cursor(&mut self, cursor: upos_type, extend_selection: bool) -> bool
pub fn set_cursor(&mut self, cursor: upos_type, extend_selection: bool) -> bool
Set the cursor position, reset selection.
Sourcepub fn set_default_cursor(&mut self)
pub fn set_default_cursor(&mut self)
Place cursor at some sensible position according to the mask.
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Selection
Sourcepub fn set_selection(&mut self, anchor: upos_type, cursor: upos_type) -> bool
pub fn set_selection(&mut self, anchor: upos_type, cursor: upos_type) -> bool
Selection
Sourcepub fn select_all(&mut self)
pub fn select_all(&mut self)
Select all text.
Sourcepub fn selected_text(&self) -> &str
pub fn selected_text(&self) -> &str
Selection
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn insert_char(&mut self, c: char) -> bool
pub fn insert_char(&mut self, c: char) -> bool
Insert a char at the current position.
Sourcepub fn delete_range(&mut self, range: Range<upos_type>) -> bool
pub fn delete_range(&mut self, range: Range<upos_type>) -> bool
Remove the selected range. The text will be replaced with the default value as defined by the mask.
Sourcepub fn try_delete_range(
&mut self,
range: Range<upos_type>,
) -> Result<bool, TextError>
pub fn try_delete_range( &mut self, range: Range<upos_type>, ) -> Result<bool, TextError>
Remove the selected range. The text will be replaced with the default value as defined by the mask.
pub fn delete_next_char(&mut self) -> bool
Sourcepub fn delete_prev_char(&mut self) -> bool
pub fn delete_prev_char(&mut self) -> bool
Delete the char before the cursor.
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn move_right(&mut self, extend_selection: bool) -> bool
pub fn move_right(&mut self, extend_selection: bool) -> bool
Move to the next char.
Sourcepub fn move_to_line_start(&mut self, extend_selection: bool) -> bool
pub fn move_to_line_start(&mut self, extend_selection: bool) -> bool
Start of line
Sourcepub fn move_to_line_end(&mut self, extend_selection: bool) -> bool
pub fn move_to_line_end(&mut self, extend_selection: bool) -> bool
End of line
Source§impl IBANInputState
impl IBANInputState
Sourcepub fn col_to_screen(&self, pos: upos_type) -> Option<u16>
pub fn col_to_screen(&self, pos: upos_type) -> Option<u16>
Converts a grapheme based position to a screen position relative to the widget area.
Sourcepub fn screen_to_col(&self, scx: i16) -> upos_type
pub fn screen_to_col(&self, scx: i16) -> upos_type
Converts from a widget relative screen coordinate to a grapheme index. x is the relative screen position.
Sourcepub fn set_screen_cursor(&mut self, cursor: i16, extend_selection: bool) -> bool
pub fn set_screen_cursor(&mut self, cursor: i16, extend_selection: bool) -> bool
Set the cursor position from a screen position relative to the origin of the widget. This value can be negative, which selects a currently not visible position and scrolls to it.
Source§impl IBANInputState
impl IBANInputState
pub fn named(name: &str) -> Self
Sourcepub fn validate(&mut self) -> Result<bool, TextError>
pub fn validate(&mut self) -> Result<bool, TextError>
Validate the IBAN. Sets the invalid flag. Returns true if the IBAN is valid.
Sourcepub fn set_value(&mut self, iban: impl AsRef<str>)
pub fn set_value(&mut self, iban: impl AsRef<str>)
Set the IBAN.
Invalid IBANs are acceptable, but they will be truncated to 35 characters. If an invalid IBAN is set the widget will immediately set the invalid flag too.
Sourcepub fn valid_value(&self) -> Result<String, TextError>
pub fn valid_value(&self) -> Result<String, TextError>
Get the IBAN.
This will only return valid IBANs or empty strings.
Trait Implementations§
Source§impl Clone for IBANInputState
impl Clone for IBANInputState
Source§fn clone(&self) -> IBANInputState
fn clone(&self) -> IBANInputState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IBANInputState
impl Debug for IBANInputState
Source§impl Default for IBANInputState
impl Default for IBANInputState
Source§impl HandleEvent<Event, MouseOnly, TextOutcome> for IBANInputState
impl HandleEvent<Event, MouseOnly, TextOutcome> for IBANInputState
Source§impl HandleEvent<Event, ReadOnly, TextOutcome> for IBANInputState
impl HandleEvent<Event, ReadOnly, TextOutcome> for IBANInputState
Source§impl HandleEvent<Event, Regular, TextOutcome> for IBANInputState
impl HandleEvent<Event, Regular, TextOutcome> for IBANInputState
Source§impl HasFocus for IBANInputState
impl HasFocus for IBANInputState
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Source§fn has_mouse_focus(&self) -> bool
fn has_mouse_focus(&self) -> bool
Source§impl HasScreenCursor for IBANInputState
impl HasScreenCursor for IBANInputState
Source§impl RelocatableState for IBANInputState
impl RelocatableState for IBANInputState
Source§fn relocate(&mut self, shift: (i16, i16), clip: Rect)
fn relocate(&mut self, shift: (i16, i16), clip: Rect)
Source§fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
fn relocate_popup(&mut self, shift: (i16, i16), clip: Rect)
Auto Trait Implementations§
impl !Freeze for IBANInputState
impl !RefUnwindSafe for IBANInputState
impl !Send for IBANInputState
impl !Sync for IBANInputState
impl Unpin for IBANInputState
impl UnsafeUnpin for IBANInputState
impl !UnwindSafe for IBANInputState
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
Source§impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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
Source§impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle.Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other into Self, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self into C, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self into T, while performing the appropriate scaling,
rounding and clamping.Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds error is returned which contains
the unclamped color. Read more