#region Disclaimer / License // Copyright (C) 2011, 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.Resource; using System.ComponentModel; using OSGeo.MapGuide.ObjectModels.SymbolDefinition; using OSGeo.MapGuide.ObjectModels.Common; namespace OSGeo.MapGuide.ObjectModels.WatermarkDefinition { /// /// The allowed length units for a watermark position /// [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.38968")] //NOXLATE [System.SerializableAttribute()] public enum UnitType { /// Inches, /// Centimeters, /// Millimeters, /// Pixels, /// Points, } /// /// The allowed horizontal alignment values for a watermark position /// [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.38968")] //NOXLATE [System.SerializableAttribute()] public enum HorizontalAlignmentType { /// Left, /// Center, /// Right, } /// /// The context in which the watermark is displayed /// [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.38968")] //NOXLATE [System.SerializableAttribute()] public enum UsageType { /// WMS, /// Viewer, /// All, } /// /// The allowed vertical alignments for a watermark position /// [System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.4.0.38968")] //NOXLATE [System.SerializableAttribute()] public enum VerticalAlignmentType { /// Top, /// Center, /// Bottom, } /// /// A watermark definition containing content, appearance and position information /// public interface IWatermarkDefinition : IResource, INotifyPropertyChanged { /// /// Gets or sets a symbol definition defining the content of the watermark /// ISymbolDefinitionBase Content { get; set; } /// /// Gets or sets the appearance of the watermark /// IWatermarkAppearance Appearance { get; set; } /// /// Gets or sets the position of the watermark /// IPosition Position { get; set; } /// /// Creates the XY position. /// /// IXYPosition CreateXYPosition(); /// /// Creates the tile position. /// /// ITilePosition CreateTilePosition(); /// /// Gets the version of the Map Definition that can take this watermark /// Version SupportedMapDefinitionVersion { get; } /// /// Gets the version of the Layer Definition that can take this watermark /// Version SupportedLayerDefinitionVersion { get; } } /// /// Defines the appearance of a watermark. /// public interface IWatermarkAppearance : INotifyPropertyChanged { /// /// Gets or sets the transparency of the watermark in the range 0-100. The default value is 0 (opaque) /// double Transparency { get; set; } /// /// Gets or sets the rotation of the watermark, in degrees, in the range 0-360. The default value is 0 /// double Rotation { get; set; } } /// /// Defines the type of watermark position /// public enum PositionType { /// /// X/Y based position /// XY, /// /// Tile-based position /// Tile } /// /// Abstract base type used with all watermark positions /// public interface IPosition : INotifyPropertyChanged { /// /// Gets the type of watermark position /// PositionType Type { get; } } /// /// Positions a watermark at a single X/Y location /// public interface IXYPosition : IPosition { /// /// Gets or sets the position along the X-axis /// IHorizontalPosition XPosition { get; set; } /// /// Gets or sets the position along the Y-axis /// IVerticalPosition YPosition { get; set; } } /// /// Positions a watermark according to a regular grid /// public interface ITilePosition : IPosition { /// /// Gets or sets the width of each tile in the grid /// double TileWidth { get; set; } /// /// Gets or sets the height of each tile in the grid /// double TileHeight { get; set; } /// /// Gets or sets the horizontal position of the watermark within a tile /// IHorizontalPosition HorizontalPosition { get; set; } /// /// Gets or sets the vertical position of the watermark within a tile /// IVerticalPosition VerticalPosition { get; set; } } /// /// Represents the horizontal position of a watermark /// public interface IHorizontalPosition : INotifyPropertyChanged { /// /// Gets or sets the horizontal offset for the position /// double Offset { get; set; } /// /// Gets or sets the unit of the offset /// UnitType Unit { get; set; } /// /// Gets or sets the horizontal alignment for the position /// HorizontalAlignmentType Alignment { get; set; } } /// /// Defines the vertical position of a watermark /// public interface IVerticalPosition : INotifyPropertyChanged { /// /// Gets or sets the vertical offset for the position /// double Offset { get; set; } /// /// Gets or sets the unit of the offset /// UnitType Unit { get; set; } /// /// Gets or sets the vertical alignment for the position /// VerticalAlignmentType Alignment { get; set; } } /// /// Defines a collection of instances /// public interface IWatermarkCollection { /// /// Gets the watermarks used by this map definition /// IEnumerable Watermarks { get; } /// /// Adds a watermark /// /// The watermark definition to add /// The added watermark instance. IWatermark AddWatermark(IWatermarkDefinition watermarkDef); /// /// Removes the specified watermark /// /// void RemoveWatermark(IWatermark watermark); /// /// Gets the number of watermarks used by this map definition /// int WatermarkCount { get; } } /// /// A watermark instance used in a map definition or layer definition /// public interface IWatermark { /// /// Gets or sets the name of the watermark /// string Name { get; set; } /// /// Gets or sets a library reference to an existing WatermarkDefinition /// string ResourceId { get; set; } /// /// Gets or sets the context in which the watermark is displayed. /// UsageType Usage { get; set; } /// /// If specified, overrides the appearance of the watermark definition /// IWatermarkAppearance AppearanceOverride { get; set; } /// /// If specified, overrides the position of the watermark definition /// IPosition PositionOverride { get; set; } /// /// Creates the default appearance. /// /// IWatermarkAppearance CreateDefaultAppearance(); /// /// Creates the default XY position. /// /// IXYPosition CreateDefaultXYPosition(); /// /// Creates the default tile position. /// /// ITilePosition CreateDefaultTilePosition(); } }