#region Disclaimer / License // Copyright (C) 2012, 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 Disclaimer / License using OSGeo.MapGuide.MaestroAPI; using OSGeo.MapGuide.MaestroAPI.Schema; using OSGeo.MapGuide.ObjectModels.Capabilities; namespace Maestro.Editors.Common { /// /// The mode in which the expression editor should function /// public enum ExpressionEditorMode { /// /// The editor is for editing expressions /// Expression, /// /// The editor is for editing filters /// Filter } /// /// The expression editor interface /// public interface IExpressionEditor { /// /// Initializes the expression editor /// /// /// /// /// /// /// void Initialize(IEditorService edSvc, IFdoProviderCapabilities caps, ClassDefinition cls, string featureSourceId, ExpressionEditorMode mode, bool attachStylizationFunctions); /// /// Gets or sets the FDO expression /// string Expression { get; set; } /// /// Shows the form as a modal dialog box /// /// System.Windows.Forms.DialogResult ShowDialog(); void Initialize(IServerConnection conn, ClassDefinition classDefinition, string featureSourceId, ExpressionEditorMode mode); } /// /// An interface for inserting text /// internal interface ITextInserter { /// /// Inserts the specified text. The implementation determines the position/cursor where the /// given text will be inserted at /// /// void InsertText(string text); } public static class FdoExpressionEditorFactory { public static IExpressionEditor Create() { if (Platform.IsRunningOnMono) return new MonoCompatibleExpressionEditor(); else return new ExpressionEditor(); } } }