// -------------------------------------------------------------------------------------------------------------------- // 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 event Action ProjectOpened; event Action ProjectClosing; #endregion #region Public Properties /// /// Gets or sets Application wrapped by the current Gui. /// ApplicationCore ApplicationCore { get; set; } /// /// Gets or sets the project of the . /// Project Project { 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 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; } #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.ApplicationCore. /// /// 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 } }