using System; using System.Collections.Generic; using System.Drawing; using Core.Common.Utils.Collections.Generic; namespace Core.Common.Controls.Views { /// /// General interface for graphical user interface views used in applications /// public interface IView : IDisposable { /// /// Gets or sets data shown by this view. Usually it is any object in the system which can be shown by some IView derived class. /// object Data { get; set; } /// /// Gets or sets the *caption/title* for the view /// TODO: change it to Name /// /// IGui implementation sets this. /// string Text { get; set; } /// /// Sets or gets image set on the title of the view. /// Image Image { get; set; } /// /// True when view is visible. /// bool Visible { get; } ViewInfo ViewInfo { get; set; } /// /// Makes object visible in the view if possible /// /// void EnsureVisible(object item); } public interface ICompositeView : IView { IEventedList ChildViews { get; } bool HandlesChildViews { get; } void ActivateChildView(IView childView); } /// /// View that can be searched by using the SearchDialog /// TODO : change to ISearchable and move to a different place /// public interface ISearchableView : IView { /// /// Returns the objects that where found using the text. /// This will be called from a separate thread. /// IEnumerable> SearchItemsByText(string text, bool caseSensitive, Func isSearchCancelled, Action setProgressPercentage); } /// /// Marker interface to indicate this view is not a principal view of its current data object and therefore /// should not be returned when asking for existing views for a data object. It will however be closed when /// the data is removed. /// public interface IAdditionalView : IView {} }