#region Disclaimer / License // Copyright (C) 2010, Jackie Ng // http://trac.osgeo.org/mapguide/wiki/maestro, jumpinjackie@gmail.com // // 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; using System.Collections.Generic; using System.Text; using OSGeo.MapGuide.MaestroAPI; using System.Collections.Specialized; using OSGeo.MapGuide.MaestroAPI.Resource; using System.IO; using OSGeo.MapGuide.ObjectModels.Common; using System.ComponentModel; using OSGeo.MapGuide.MaestroAPI.Services; using OSGeo.MapGuide.MaestroAPI.Commands; using OSGeo.MapGuide.MaestroAPI.Schema; namespace Maestro.Editors { /// /// Defines an interface that provides common services for resource editors. /// public interface IEditorService { /// /// Indicates if a specified custom command is supported and can be created /// /// /// bool SupportsCommand(CommandType cmdType); /// /// Create a custom command /// /// /// ICommand CreateCommand(CommandType cmdType); /// /// Gets the associated feature service /// IFeatureService FeatureService { get; } /// /// Gets the associated resource service /// IResourceService ResourceService { get; } /// /// Gets the associated drawing service /// IDrawingService DrawingService { get; } /// /// Gets the session id /// string SessionID { get; } /// /// Gets the suggested save folder for a "save as" operation /// string SuggestedSaveFolder { get; set; } /// /// Registers a custom notifier /// /// void RegisterCustomNotifier(INotifyResourceChanged irc); /// /// Indicates whether an upgrade for this resource is available /// bool IsUpgradeAvailable { get; } /// /// Invokes a prompt to select a resource of any type /// /// string SelectAnyResource(); /// /// Invokes a prompt to select a resource of the specified type /// /// /// string SelectResource(ResourceTypes resType); /// /// Invokes a prompt to select a folder /// /// string SelectFolder(); /// /// Updates the session copy's resource content /// /// void UpdateResourceContent(string xml); /// /// Invokes a prompt to select a file from an unmanaged alias /// /// /// /// string SelectUnmanagedData(string startPath, NameValueCollection fileTypes); /// /// Invokes the expression editor /// /// /// /// /// /// string EditExpression(string currentExpr, ClassDefinition schema, string providerName, string featureSourceId); /// /// Gets the resource ID of the resource, whose session-copy is being edited /// string ResourceID { get; } /// /// Gets the resource ID of the actively edited resource /// string EditedResourceID { get; } /// /// Initiates the editing process. The resource to be edited is copied to the session repository and /// a deserialized version is returned from this copy. Subsequent calls will return the same reference /// to this resource object. /// /// A deserialized version of a session-copy of the resource to be edited IResource GetEditedResource(); /// /// Raises the event and performs any other pre-preview /// processing tasks /// void PrePreviewProcess(); /// /// Raised before a preview occurs /// event EventHandler BeforePreview; /// /// Raised before a save operation commences /// event CancelEventHandler BeforeSave; /// /// Saves the edited resource. The session copy, which holds the current changes is copied back /// to the original resource ID. /// void Save(); /// /// Saves the edited resource under a different resource ID. The session copy, which holds the current changes is copied back /// to the specified resource ID /// void SaveAs(string resourceID); /// /// Opens the specified URL /// /// void OpenUrl(string url); /// /// Indicates whether the edited resource is a new resource /// bool IsNew { get; } /// /// Indicates whether the edited resource has unsaved changes /// bool IsDirty { get; } /// /// Forces the edited resource to be marked as dirty /// void MarkDirty(); /// /// Raised when the edited resource has changed /// event EventHandler DirtyStateChanged; /// /// Invokes a prompt to select the coordinate system /// /// string GetCoordinateSystem(); /// /// Forces the the event. Normally the databinding /// system should auto-flag dirty state, only call this if you don't utilise this /// databinding system. /// void HasChanged(); /// /// Raises a request to refresh the Site Explorer /// void RequestRefresh(); /// /// Raises a request to refresh the Site Explorer at the specified folder id /// /// void RequestRefresh(string folderId); /// /// Raised when the edited resource is saved /// event EventHandler Saved; /// /// Synchronises changes in the in-memory resource back to the session repository. This is usually called /// before validation of the edited resource begins. /// void SyncSessionCopy(); /// /// Gets the MapGuide Server version /// Version SiteVersion { get; } /// /// Opens the specified resource /// /// void OpenResource(string resourceId); /// /// Gets the supported services /// int[] SupportedServiceTypes { get; } /// /// Gets the service of the specified type /// /// /// IService GetService(int serviceType); /// /// Gets the value of a custom connection property /// /// /// object GetCustomProperty(string name); /// /// Invokes the specified process name with the specified arguments /// /// /// void RunProcess(string processName, params string[] args); } }