#region Disclaimer / License // Copyright (C) 2009, Kenneth Skovhede // http://www.hexad.dk, opensource@hexad.dk // // This library 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 2.1 of the License, or (at your option) any later version. // // This library 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 library; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA // #endregion using System; namespace OSGeo.MapGuide.Maestro.ResourceEditors { /// /// The interface for the mapping mechanism between resource types and editors. /// public interface ResourceEditorMap { /// /// Gets the display name of a resourcetype /// /// The resource type to find the displayname for /// The displayname of the item or "Unknown" if no such resource is known string GetResourceDisplayNameFromResourceType(string itemType); /// /// Gets the instance type of a resourcetype /// /// The resource type to find the instance type for /// The instance type of the item or null if no such resource is known Type GetResourceEditorTypeFromResourceType(string itemType); /// /// Gets a list of known resource types. /// string[] AvalibleResourceTypes { get; } /// /// Gets the image index of a resource, given the resourceID /// /// The resourceID to find the imageindex for /// The imageindex for the resource or BlankImage, if none was found int GetImageIndexFromResourceID(string resourceID); /// /// Gets the image index of a resource, given the resource type /// /// The resource type to find the imageindex for /// The imageindex for the resource or BlankImage, if none was found int GetImageIndexFromResourceType(string resourceID); /// /// Gets the name of a resource, by removing parts from the resourceID /// /// The resourceID to find the name for /// The name of the resource, throws an exception for invalid resourceID's string GetResourceNameFromResourceID(string resourceID); /// /// Splits a resourceID into the folder/resource parts. /// /// Thr resourceID to return the parts for. /// The parts of the resourceID, throws an exception on invalid resourceID. string[] SplitResourceID(string resourceID); /// /// Returns the editor for the given resourceID. /// /// The resourceID to find the editor for. /// The type of the resource editor. Throws an exception on invalid resourceID, returns null if no editor was found. System.Type GetResourceEditorTypeFromResourceID(string resourceID); /// /// Returns the instance type for a given resourceType /// /// The resourcetype to find the instance type for /// The instance type, or null if no such type was found Type GetResourceInstanceTypeFromResourceType(string resourceType); /// /// Returns the instance type for a given resourceID /// /// The resourceID to find the instance type for /// The instance type, or null if no such type was found Type GetResourceInstanceTypeFromResourceID(string resourceID); /// /// Gets the typename from the resourceID /// /// The resourceId to examine /// The resource type name string GetResourceTypeNameFromResourceID(string resourceID); /// /// Gets the imageindex of the folder icon. /// int FolderIcon { get; } /// /// Gets the imageindex of the blank icon. /// int BlankIcon { get; } /// /// Gets the imageindex of the server icon. /// int ServerIcon { get; } /// /// Gets the imageindex of the unknown resource icon. /// int UnknownIcon { get; } /// /// Returns the small imagelist with images corresponding to the image indexes returned from the various methods. /// System.Windows.Forms.ImageList SmallImageList { get; } /// /// Returns the large imagelist with images corresponding to the image indexes returned from the various methods. /// System.Windows.Forms.ImageList LargeImageList { get; } } }