#nullable enable
using System.Collections;
using System.Collections.Specialized;
namespace Terminal.Gui;
/// Implement to provide custom rendering for a .
public interface IListDataSource : IDisposable
{
///
/// Event to raise when an item is added, removed, or moved, or the entire list is refreshed.
///
event NotifyCollectionChangedEventHandler CollectionChanged;
/// Returns the number of elements to display
int Count { get; }
/// Returns the maximum length of elements to display
int Length { get; }
///
/// Allow suspending the event from being invoked,
/// if , otherwise is .
///
bool SuspendCollectionChangedEvent { get; set; }
/// Should return whether the specified item is currently marked.
/// , if marked, otherwise.
/// Item index.
bool IsMarked (int item);
/// This method is invoked to render a specified item, the method should cover the entire provided width.
/// The render.
/// The list view to render.
/// Describes whether the item being rendered is currently selected by the user.
/// The index of the item to render, zero for the first item and so on.
/// The column where the rendering will start
/// The line where the rendering will be done.
/// The width that must be filled out.
/// The index of the string to be displayed.
///
/// The default color will be set before this method is invoked, and will be based on whether the item is selected
/// or not.
///
void Render (
ListView listView,
bool selected,
int item,
int col,
int line,
int width,
int start = 0
);
/// Flags the item as marked.
/// Item index.
/// If set to value.
void SetMark (int item, bool value);
/// Return the source as IList.
///
IList ToList ();
}