// Copyright (C) Stichting Deltares 2016. All rights reserved. // // This file is part of Ringtoets. // // Ringtoets is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program. If not, see . // // All names, logos, and references to "Deltares" are registered trademarks of // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. using System; using System.Collections.Generic; using Core.Common.Controls.Views; using Core.Common.Gui.Plugin; namespace Core.Common.Gui { public interface IViewResolver { /// /// Default view types registered for data object types. /// /// The keys in this dictionary are the object types and the values the /// corresponding view object types. IDictionary DefaultViewTypes { get; } /// /// List of view info objects used for resolving views /// IList ViewInfos { get; } /// /// Opens a view for specified data. Using viewprovider to resolve the correct view. /// /// Data to open a view for /// Always present the user with a dialog to choose from bool OpenViewForData(object data, bool alwaysShowDialog = false); /// /// Creates a view for the /// /// The data to create a view for /// Function to filter the view infos to use /// A view for data IView CreateViewForData(object data, Func selectViewInfo = null); /// /// Check if a view can be created for the . /// /// The data to check for /// bool CanOpenViewFor(object data); /// /// Returns all currently opened views for the same data. /// /// /// IList GetViewsForData(object data); /// /// Closes all views for . /// /// /// void CloseAllViewsFor(object data); /// /// Gives the default viewtype for the given data object. /// /// /// Type GetDefaultViewType(object dataObject); /// /// Gets the view info objects for the /// /// Data used for searching the view infos /// The viewType of the view info /// The matching view infos for data and view type IEnumerable GetViewInfosFor(object data, Type viewType = null); string GetViewName(IView view); } }