// --------------------------------------------------------------------------------------------------------------------
// Deltares. All rights reserved.
//
// Provides graphical user interface logic required to work with an application.
//
// --------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using Core.Common.Base.Data;
using Core.Common.Base.Plugin;
using Core.Common.Controls.Views;
using Core.Common.Gui.Forms.MainWindow;
using Core.Common.Gui.Forms.PropertyGridView;
using Core.Common.Utils.PropertyBag;
namespace Core.Common.Gui
{
///
/// Provides graphical user interface logic required to work with an application.
///
public interface IGui : IDisposable
{
#region Public properties
event Action ProjectOpened;
event Action ProjectClosing;
#endregion
#region Public Properties
///
/// Gets the of the .
///
ApplicationCore ApplicationCore { get; }
///
/// Gets or sets the project of the .
///
Project Project { get; set; }
///
/// Gets or sets the project path of the .
///
string ProjectFilePath { 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; }
///
/// Object responsible for retrieving the instance
/// for a given data object and wrapping that in a
/// for the application to be used.
///
IPropertyResolver PropertyResolver { 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; }
///
/// Gets the fixed settings of the .
///
GuiCoreSettings FixedSettings { get; }
///
/// Gets the user specific settings of the .
///
ApplicationSettingsBase UserSettings { 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; }
///
/// Gets the of the
///
IContextMenuBuilderProvider ContextMenuProvider { get; }
///
/// Gets the currently active document .
///
IView ActiveView { get; }
#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);
///
/// Queries the plugins to get all data with view definitions recursively given a
/// piece of hierarchical data.
///
/// The root data object.
/// An enumeration of all (child)data that have view definitions declared.
IEnumerable GetAllDataWithViewDefinitionsRecursively(object rootDataObject);
///
/// 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);
///
/// Updates the title of the main window.
///
void UpdateTitle();
///
/// Update the tool tip for every view currently open. Reasons for doing so
/// include the modification of the tree structure which is reflected in a tool tip.
///
void UpdateToolTips();
///
/// Open the tool view and make it visible in the interface.
///
/// The tool view to open.
void OpenToolView(IView toolView);
///
/// Close the tool view removing it from the interface.
///
/// The tool view to close.
void CloseToolView(IView toolView);
#endregion
#region Events
///
/// Fired when user changes selection by clicking on it or by setting it using Selection property.
///
event EventHandler SelectionChanged;
///
/// Fired when the active view in the document pane changes.
///
event EventHandler ActiveViewChanged;
#endregion
}
}