using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TradeIdeas.MiscSupport;
namespace TradeIdeas.TIProGUI.Surfer
{
///
/// Status of surfable form. Available = displaying surfable content, Unavailable = enabled but not displaying surfable content
/// (another tab displayed perhaps), Disabled = may have surfable content but currently disabled
///
public enum SurfStatus { Available, Unavailable, Disabled };
///
/// Implements an interface that allows a surf manager to retrieve the latest items from the object and be
/// notified when this object has new items or needs to be refreshed.
///
public interface Surfable
{
///
/// Returns a list of RowData objects. The Surfable object can decide which items are to be returned,
/// but presumably this is a list of the most recently received items or top items in a list defined
/// by the current sort status.
///
/// Total number of items to retrieve
///
List Surf(int total);
///
/// Tells the surfable object to select the item represented by rowData. Most likely this is simply
/// marking the item as selected signifying to the user that the selection has occurred.
///
///
void SelectItem(RowData rowData);
///
/// Tells the surfable object that surfing has completed. The surfable object can perform post
/// surfing logc (i.e. clear row/cell selection in AI Strategy trade windows.)
///
void PostSurfingLogic();
///
/// Adds a callback that tells the surf manager that the current list of items has been updated
/// and should be retrieved again.
///
///
void AddDataRefreshedCallback(Action callback);
///
/// Adds a callback that tells the surf manager that a new event has occurred.
///
///
void AddNewEventCallback(Action callback);
SurfStatus SurfStatus();
///
/// Gets the window title for this window.
///
///
string WindowTitle();
///
/// Retrieve the DataGridView object for the surfable object. Return null if there is no DataGridView.
///
///
DataGridView GetDataGridView();
Control GetOwner();
}
}