#nullable enable
namespace Terminal.Gui.Views;
/// TextValidateField Providers Interface. All TextValidateField are created with a ITextValidateProvider.
public interface ITextValidateProvider
{
/// Gets the formatted string for display.
string DisplayText { get; }
/// Set that this provider uses a fixed width. e.g. Masked ones are fixed.
bool Fixed { get; }
/// True if the input is valid, otherwise false.
bool IsValid { get; }
/// Set the input text and get the current value.
string Text { get; set; }
/// Set Cursor position to .
///
/// Return first valid position.
int Cursor (int pos);
/// Find the last valid character position.
/// New cursor position.
int CursorEnd ();
/// First valid position before .
///
/// New cursor position if any, otherwise returns
int CursorLeft (int pos);
/// First valid position after .
/// Current position.
/// New cursor position if any, otherwise returns
int CursorRight (int pos);
/// Find the first valid character position.
/// New cursor position.
int CursorStart ();
/// Deletes the current character in .
///
/// true if the character was successfully removed, otherwise false.
bool Delete (int pos);
/// Insert character in position .
///
///
/// true if the character was successfully inserted, otherwise false.
bool InsertAt (char ch, int pos);
/// Method that invoke the event if it's defined.
/// The previous text before replaced.
/// Returns the
void OnTextChanged (EventArgs oldValue);
///
/// Changed event, raised when the text has changed.
///
/// This event is raised when the changes. The passed is a
/// containing the old value.
///
///
event EventHandler> TextChanged;
}