using System; using System.Collections.Generic; using DelftTools.Shell.Core; namespace DelftTools.Shell.Gui { /// /// Handles all common high-level commands in the graphical user interface invoked via menu / toolbar. /// public interface IGuiCommandHandler : IDisposable { /// /// Tries to create a new WTI project. /// /// /// The creation action might be cancelled (due to user interaction). /// void TryCreateNewWTIProject(); /// /// Tries to open an existing WTI project. /// /// /// The opening action might be cancelled (due to user interaction). /// /// Whether or not an existing WTI project was correctly opened. bool TryOpenExistingWTIProject(); /// /// Tries to open an existing WTI project from file. /// /// The path to the existing WTI project file. /// /// The opening action might be cancelled (due to user interaction). /// /// Whether or not an existing WTI project was correctly opened. bool TryOpenExistingWTIProject(string filePath); /// /// Tries to close a WTI project. /// /// /// The closing action might be cancelled (due to user interaction). /// /// Whether or not the WTI project was correctly closed. bool TryCloseWTIProject(); /// /// Presents the user with a dialog to choose an editor for the selected dataitem /// void OpenSelectViewDialog(); /// /// Opens the default view for the current selection /// void OpenDefaultViewForSelection(); void OpenViewForSelection(Type viewType = null); void OpenView(object dataObject, Type viewType = null); void RemoveAllViewsForItem(object dataObject); /// /// Presents the user with a dialog from which items can be selected and then created. The items are retrieved /// using the DataItemInfo objects of plugins. The item is NOT added to the project or wrapped in a DataItem. /// /// /// The predicate which must evaluate to true for an item type to be included in the list object AddNewChildItem(object parent, IEnumerable childItemTypes); object AddNewProjectItem(object parent); /// /// ///true if there is a default vioew for the current selection bool CanOpenDefaultViewForSelection(); /// /// ///true if there are more supported views for the current selection bool CanOpenSelectViewDialog(); void AddItemToProject(object item); void ExportSelectedItem(); /// /// Activates the propertyGrid toolbox /// void ShowProperties(); // TODO: move to import plugin void ImportToGuiSelection(); /// /// Indicates if there are importers for the current Gui.Selection /// bool CanImportToGuiSelection(); IProjectItem GetProjectItemForActiveView(); void OpenLogFileExternal(); void ExportFrom(object data, IFileExporter exporter = null); void ImportOn(object target, IFileImporter importer = null); } }