// -------------------------------------------------------------------------------------------------------------------- // Deltares. All rights reserved. // // Provides graphical user interface logic required to work with an application. // // -------------------------------------------------------------------------------------------------------------------- using System; using System.Collections.Generic; using Core.Common.Base; using Core.Common.Gui.Forms.MainWindow; namespace Core.Common.Gui { /// /// Provides graphical user interface logic required to work with an application. /// public interface IGui { #region Public Properties /// /// Gets or sets Application wrapped by the current Gui. /// IApplication Application { get; set; } /// /// Gets or sets CommandHandler. /// IGuiCommandHandler CommandHandler { get; set; } /// /// Gets commands. /// IList Commands { get; } /// /// Gets all document views currently opened in the gui. /// IViewList DocumentViews { get; } /// /// Resolves document views /// IViewResolver DocumentViewsResolver { get; } /// /// Gets main window of the graphical user interface. /// IMainWindow MainWindow { get; } /// /// Gets view manager used to handle tool windows. /// IViewList ToolWindowViews { get; } /// /// List of plugins. /// IList Plugins { get; } /// /// Suspends view removal on project item delete. Useful to avoid unnecessary checks (faster item removal). /// bool IsViewRemoveOnItemDeleteSuspended { get; set; } /// /// Gets or sets current selected object(s). /// Visibility of the menus, toolbars and other controls should be updated when selected object is changed. /// Default implementation will also show it in the PropertyGrid. /// object Selection { get; set; } /// /// Selected project item. /// If non-IProjectItem is selected in project tree view then this item must be set from outside /// (by a project tree view or any other IProjectItem navigation control). /// IProjectItem SelectedProjectItem { get; set; } #endregion #region Public Methods /// /// Exits gui by user request. /// void Exit(); /// /// Returns GuiPlugin for a given type. /// TODO: a bit too implicit method, to be removed. /// /// Any type loaded from plugin. /// Plugin gui associated with a given type GuiPlugin GetPluginGuiForType(Type type); /// /// Runs gui. Internally it runs , initializes all user interface components, including /// those loaded from plugins. After that it creates and shows main window. /// void Run(); /// /// Runs gui and opens a given project in gui.Application. /// /// Path to the project to be opened. void Run(string projectPath); #endregion #region Events /// /// Fired when user changes selection by clicking on it or by setting it using Selection property. /// event EventHandler SelectionChanged; #endregion } }