using System.Collections.ObjectModel;
namespace Terminal.Gui;
///
/// Renders an overlay on another view at a given point that allows selecting from a range of 'autocomplete'
/// options.
///
public interface IAutocomplete
{
// TODO: Update to use Key instead of KeyCode
/// The key that the user can press to close the currently popped autocomplete menu
KeyCode CloseKey { get; set; }
///
/// The colors to use to render the overlay. Accessing this property before the Application has been initialized
/// will cause an error
///
ColorScheme ColorScheme { get; set; }
/// The context used by the autocomplete menu.
AutocompleteContext Context { get; set; }
/// The host control that will use autocomplete.
View HostControl { get; set; }
/// The maximum number of visible rows in the autocomplete dropdown to render
int MaxHeight { get; set; }
/// The maximum width of the autocomplete dropdown
int MaxWidth { get; set; }
/// Gets or sets where the popup will be displayed.
bool PopupInsideContainer { get; set; }
// TODO: Update to use Key instead of KeyCode
/// The key that the user can press to reopen the currently popped autocomplete menu
KeyCode Reopen { get; set; }
/// The currently selected index into that the user has highlighted
int SelectedIdx { get; set; }
// TODO: Update to use Key instead of KeyCode
/// The key that the user must press to accept the currently selected autocomplete suggestion
KeyCode SelectionKey { get; set; }
///
/// Gets or Sets the class responsible for generating based on a given
/// of the .
///
ISuggestionGenerator SuggestionGenerator { get; set; }
/// The strings that form the current list of suggestions to render based on what the user has typed so far.
ReadOnlyCollection Suggestions { get; set; }
/// True if the autocomplete should be considered open and visible
bool Visible { get; set; }
/// Clears
void ClearSuggestions ();
///
/// Populates with all proposed by
/// at the given (cursor position)
///
void GenerateSuggestions (AutocompleteContext context);
///
/// Handle mouse events before e.g. to make mouse events like report/click apply to the
/// autocomplete control instead of changing the cursor position in the underlying text view.
///
/// The mouse event.
/// If was called from the popup or from the host.
/// trueif the mouse can be handled falseotherwise.
bool OnMouseEvent (MouseEvent me, bool fromHost = false);
///
/// Handle key events before e.g. to make key events like up/down apply to the
/// autocomplete control instead of changing the cursor position in the underlying text view.
///
/// The key event.
/// trueif the key can be handled falseotherwise.
bool ProcessKey (Key a);
/// Renders the autocomplete dialog inside the given at the given point.
///
void RenderOverlay (Point renderAt);
}