#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.ObjectModels.LayerDefinition;
using OSGeo.MapGuide.MaestroAPI.Resource;
namespace OSGeo.MapGuide.ObjectModels.SymbolDefinition
{
///
/// Defines the type of symbol instances
///
public enum SymbolInstanceType
{
///
/// A library reference to an existing symbol definition
///
Reference,
///
/// An inline simple symbol definition
///
Simple,
///
/// An inline compound symbol definition
///
Compound
}
///
/// Represents a symbol instance used for advanced cartographic stylization
///
public interface ISymbolInstance
{
///
/// Gets or sets the symbol reference
///
ISymbolInstanceReference Reference { get; set; }
///
/// Gets the parameter overrides for this symbol
///
IParameterOverrideCollection ParameterOverrides { get; }
///
/// Gets or sets the X scale
///
string ScaleX { get; set; }
///
/// Gets or sets the Y scale
///
string ScaleY { get; set; }
///
/// Gets or sets the X insertion offset
///
string InsertionOffsetX { get; set; }
///
/// Gets or sets the Y insertion offset
///
string InsertionOffsetY { get; set; }
///
/// Gets or sets the size context
///
SizeContextType SizeContext { get; set; }
///
/// Gets or sets whether to draw this instance last
///
string DrawLast { get; set; }
///
/// Gets or sets whether to check the exclusion region
///
string CheckExclusionRegion { get; set; }
///
/// Gets or sets whether to add this instance to the exclusion region
///
string AddToExclusionRegion { get; set; }
///
/// Gets or sets the position algorithm
///
string PositioningAlgorithm { get; set; }
}
///
/// Represents a symbol instance reference
///
public interface ISymbolInstanceReference
{
///
/// Gets the type
///
SymbolInstanceType Type { get; }
}
///
/// Represents a symbol instance reference by a resource id
///
public interface ISymbolLibraryReference : ISymbolInstanceReference
{
///
/// Gets or sets the resource id.
///
/// The resource id.
string ResourceId { get; set; }
}
///
/// Represents a symbol instance reference by a inline definition
///
public interface IInlineSimpleSymbolReference : ISymbolInstanceReference
{
///
/// Gets or sets the inline definition
///
ISimpleSymbolDefinition SimpleSymbolDefinition { get; set; }
}
///
/// Represents a symbol instance reference by a inline definition
///
public interface IInlineCompoundSymbolReference : ISymbolInstanceReference
{
///
/// Gets or sets the inline definition
///
ICompoundSymbolDefinition CompoundSymbolDefinition { get; set; }
}
#region Symbol Definition 1.0.0 interfaces
///
/// Base interface of all symbol definitions
///
public interface ISymbolDefinitionBase : IResource
{
///
/// Gets or sets the name.
///
/// The name.
string Name { get; set; }
///
/// Gets or sets the description.
///
/// The description.
string Description { get; set; }
}
///
/// Represents a simple symbol definition
///
public interface ISimpleSymbolDefinition : ISymbolDefinitionBase
{
///
/// Gets the graphics.
///
/// The graphics.
IEnumerable Graphics { get; }
///
/// Adds the graphics.
///
/// The graphics.
void AddGraphics(IGraphicBase graphics);
///
/// Removes the graphics.
///
/// The graphics.
void RemoveGraphics(IGraphicBase graphics);
///
/// Gets or sets the resize box.
///
/// The resize box.
IResizeBox ResizeBox { get; set; }
///
/// Gets or sets the point usage.
///
/// The point usage.
IPointUsage PointUsage { get; set; }
///
/// Gets or sets the line usage.
///
/// The line usage.
ILineUsage LineUsage { get; set; }
///
/// Gets or sets the area usage.
///
/// The area usage.
IAreaUsage AreaUsage { get; set; }
///
/// Gets the parameter definition.
///
/// The parameter definition.
IParameterDefinition ParameterDefinition { get; }
}
///
/// Represents a compound symbol definition
///
public interface ICompoundSymbolDefinition : ISymbolDefinitionBase
{
///
/// Gets the simple symbols.
///
/// The simple symbols.
IEnumerable SimpleSymbol { get; }
///
/// Adds the simple symbol.
///
/// The sym.
void AddSimpleSymbol(ISimpleSymbolReferenceBase sym);
///
/// Removes the simple symbol.
///
/// The sym.
void RemoveSimpleSymbol(ISimpleSymbolReferenceBase sym);
}
///
/// A collection of graphic elements
///
public interface IGraphics
{
///
/// Gets the elements.
///
/// The elements.
IEnumerable Elements { get; }
///
/// Adds the graphic element.
///
/// The graphics.
void AddGraphicElement(IGraphicBase graphics);
///
/// Removes the graphic element.
///
/// The graphics.
void RemoveGraphicElement(IGraphicBase graphics);
}
///
/// Defines a resize box used with SimpleSymbolDefinitions
///
public interface IResizeBox
{
///
/// Gets or sets initial width of the resize box, in mm. This must be greater than or equal to zero
///
double? SizeX { get; set; }
///
/// Gets or sets initial height of the resize box, in mm. This must be greater than or equal to zero
///
double? SizeY { get; set; }
///
/// Gets or sets initial x-coordinate of the resize box center, in mm
///
double? PositionX { get; set; }
///
/// Gets or sets initial y-coordinate of the resize box center, in mm
///
double? PositionY { get; set; }
///
/// Gets or sets how the resize box grows in size. This must evaluate to one of: GrowInX, GrowInY, GrowInXY, or GrowInXYMaintainAspect (default).
///
string GrowControl { get; set; }
}
///
/// Base usage interface
///
public interface IUsageBase
{
///
/// Specifies how the symbol angle is defined. This must evaluate to one of: FromAngle (default) or FromGeometry
///
string AngleControl { get; set; }
///
/// Specifies the symbol angle, in degrees. Only applies if AngleControl evaluates to FromAngle. Defaults to 0
///
double? Angle { get; set; }
}
///
/// Specifies how a symbol is used in the context of point features
///
public interface IPointUsage : IUsageBase
{
///
/// Specifies the horizontal offset to apply to the symbol origin, in mm. This offset is applied before the symbol is scaled and rotated. Defaults to 0
///
double? OriginOffsetX { get; set; }
///
/// Specifies the vertical offset to apply to the symbol origin, in mm. This offset is applied before the symbol is scaled and rotated. Defaults to 0
///
double? OriginOffsetY { get; set; }
}
///
/// Represents line usage
///
public interface ILineUsage : IUsageBase
{
///
/// Gets or sets the units control.
///
/// The units control.
string UnitsControl { get; set; }
///
/// Gets or sets the vertex control.
///
/// The vertex control.
string VertexControl { get; set; }
///
/// Gets or sets the start offset.
///
/// The start offset.
double? StartOffset { get; set; }
///
/// Gets or sets the end offset.
///
/// The end offset.
double? EndOffset { get; set; }
///
/// Gets or sets the repeat value
///
/// The repeat value.
double? Repeat { get; set; }
///
/// Gets or sets the vertex angle limit.
///
/// The vertex angle limit.
double? VertexAngleLimit { get; set; }
///
/// Gets or sets the vertex join.
///
/// The vertex join.
string VertexJoin { get; set; }
///
/// Gets or sets the vertex miter limit.
///
/// The vertex miter limit.
string VertexMiterLimit { get; set; }
///
/// Gets or sets the default path.
///
/// The default path.
IPath DefaultPath { get; set; }
}
///
/// Defines area usage
///
public interface IAreaUsage : IUsageBase
{
///
/// Gets or sets the origin control.
///
/// The origin control.
string OriginControl { get; set; }
///
/// Gets or sets the clipping control.
///
/// The clipping control.
string ClippingControl { get; set; }
///
/// Gets or sets the X origin.
///
/// The X origin.
double? OriginX { get; set; }
///
/// Gets or sets the Y origin.
///
/// The Y origin.
double? OriginY { get; set; }
///
/// Gets or sets the X repeat value.
///
/// The X repeat value.
double? RepeatX { get; set; }
///
/// Gets or sets the Y repeat value
///
/// The Y repeat value.
double? RepeatY { get; set; }
///
/// Gets or sets the width of the buffer.
///
/// The width of the buffer.
double? BufferWidth { get; set; }
}
///
///
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xsd2Code", "3.3.0.33572")]
[System.SerializableAttribute()]
public enum DataType
{
///
String,
///
Boolean,
///
Integer,
///
Real,
///
Color,
}
///
///
///
[System.SerializableAttribute()]
public enum DataType2
{
///
String,
///
Boolean,
///
Integer,
///
Real,
///
Color,
///
Angle,
///
FillColor,
///
LineColor,
///
LineWeight,
///
Content,
///
Markup,
///
FontName,
///
Bold,
///
Italic,
///
Underlined,
///
Overlined,
///
ObliqueAngle,
///
TrackSpacing,
///
FontHeight,
///
HorizontalAlignment,
///
VerticalAlignment,
///
Justification,
///
LineSpacing,
///
TextColor,
///
GhostColor,
///
FrameLineColor,
///
FrameFillColor,
///
StartOffset,
///
EndOffset,
///
RepeatX,
///
RepeatY,
}
///
/// Defines a parameter
///
public interface IParameter
{
///
/// Gets or sets the identifier.
///
/// The identifier.
string Identifier { get; set; }
///
/// Gets or sets the default value.
///
/// The default value.
string DefaultValue { get; set; }
///
/// Gets or sets the display name.
///
/// The display name.
string DisplayName { get; set; }
///
/// Gets or sets the description.
///
/// The description.
string Description { get; set; }
///
/// Gets or sets the type of the data.
///
/// The type of the data.
string DataType { get; set; }
}
///
/// A parameter definition
///
public interface IParameterDefinition
{
///
/// Gets the parameters.
///
/// The parameters.
IEnumerable Parameter { get; }
///
/// Adds the parameter.
///
/// The param.
void AddParameter(IParameter param);
///
/// Removes the parameter.
///
/// The param.
void RemoveParameter(IParameter param);
}
///
/// Represents a simple symbol reference
///
public interface ISimpleSymbolReferenceBase
{
///
/// Gets the type.
///
/// The type.
SimpleSymbolReferenceType Type { get; }
///
/// Gets or sets the rendering pass.
///
/// The rendering pass.
string RenderingPass { get; set; }
}
///
/// Represents a simple symbol reference by resource id
///
public interface ISimpleSymbolLibraryReference : ISimpleSymbolReferenceBase
{
///
/// Gets or sets the resource id.
///
/// The resource id.
string ResourceId { get; set; }
}
///
/// Represents a simple symbol reference by inline definition
///
public interface ISimpleSymbolInlineReference : ISimpleSymbolReferenceBase
{
///
/// Gets or sets the simple symbol definition.
///
/// The simple symbol definition.
ISimpleSymbolDefinition SimpleSymbolDefinition { get; set; }
}
///
/// The type of simple symbol reference
///
public enum SimpleSymbolReferenceType
{
///
/// External resource id reference
///
Library,
///
/// Inlined definition
///
Inline,
///
/// Undefined
///
Undefined
}
///
/// Represents the base interface of all graphics
///
public interface IGraphicBase
{
///
/// Gets or sets the resize control.
///
/// The resize control.
string ResizeControl { get; set; }
}
///
/// A path
///
public interface IPath : IGraphicBase
{
///
/// Gets or sets the geometry.
///
/// The geometry.
string Geometry { get; set; }
///
/// Gets or sets the color of the fill.
///
/// The color of the fill.
string FillColor { get; set; }
///
/// Gets or sets the color of the line.
///
/// The color of the line.
string LineColor { get; set; }
///
/// Gets or sets the line weight.
///
/// The line weight.
double? LineWeight { get; set; }
///
/// Gets or sets the line weight scalable.
///
/// The line weight scalable.
bool? LineWeightScalable { get; set; }
///
/// Gets or sets the line cap.
///
/// The line cap.
string LineCap { get; set; }
///
/// Gets or sets the line join.
///
/// The line join.
string LineJoin { get; set; }
///
/// Gets or sets the line miter limit.
///
/// The line miter limit.
double? LineMiterLimit { get; set; }
}
///
/// An image reference
///
public interface IImageReference
{
///
/// Gets or sets the resource id.
///
/// The resource id.
string ResourceId { get; set; }
///
/// Gets or sets the name of the library item.
///
/// The name of the library item.
string LibraryItemName { get; set; }
}
///
/// The type of image
///
public enum ImageType
{
///
///
///
Reference,
///
///
///
Inline
}
///
/// An image graphic
///
public interface IImageBase : IGraphicBase
{
///
/// Gets the type.
///
/// The type.
ImageType Type { get; }
///
/// Gets or sets the size X.
///
/// The size X.
double? SizeX { get; set; }
///
/// Gets or sets the size Y.
///
/// The size Y.
double? SizeY { get; set; }
///
/// Gets or sets the size scalable.
///
/// The size scalable.
bool? SizeScalable { get; set; }
///
/// Gets or sets the angle.
///
/// The angle.
double? Angle { get; set; }
///
/// Gets or sets the position X.
///
/// The position X.
double? PositionX { get; set; }
///
/// Gets or sets the position Y.
///
/// The position Y.
double? PositionY { get; set; }
}
///
/// Represents an inline image
///
public interface IInlineImage : IImageBase
{
///
/// Gets or sets the content.
///
/// The content.
byte[] Content { get; set; }
}
///
/// Represents an image refrence
///
public interface IImageReferenceImage : IImageBase
{
///
/// Gets or sets the reference.
///
/// The reference.
IImageReference Reference { get; set; }
}
///
/// A text frame
///
public interface ITextFrame
{
///
/// Gets or sets the color of the line.
///
/// The color of the line.
string LineColor { get; set; }
///
/// Gets or sets the color of the fill.
///
/// The color of the fill.
string FillColor { get; set; }
///
/// Gets or sets the offset X.
///
/// The offset X.
double? OffsetX { get; set; }
///
/// Gets or sets the offset Y.
///
/// The offset Y.
double? OffsetY { get; set; }
}
///
/// Text graphics
///
public interface IText : IGraphicBase
{
///
/// Gets or sets the content.
///
/// The content.
string Content { get; set; }
///
/// Gets or sets the name of the font.
///
/// The name of the font.
string FontName { get; set; }
///
/// Gets or sets the bold.
///
/// The bold.
bool? Bold { get; set; }
///
/// Gets or sets the italic.
///
/// The italic.
bool? Italic { get; set; }
///
/// Gets or sets the underlined.
///
/// The underlined.
bool? Underlined { get; set; }
///
/// Gets or sets the height.
///
/// The height.
double? Height { get; set; }
///
/// Gets or sets the height scalable.
///
/// The height scalable.
bool? HeightScalable { get; set; }
///
/// Gets or sets the angle.
///
/// The angle.
double? Angle { get; set; }
///
/// Gets or sets the position X.
///
/// The position X.
double? PositionX { get; set; }
///
/// Gets or sets the position Y.
///
/// The position Y.
double? PositionY { get; set; }
///
/// Gets or sets the horizontal alignment.
///
/// The horizontal alignment.
string HorizontalAlignment { get; set; }
///
/// Gets or sets the vertical alignment.
///
/// The vertical alignment.
string VerticalAlignment { get; set; }
///
/// Gets or sets the justification.
///
/// The justification.
string Justification { get; set; }
///
/// Gets or sets the line spacing.
///
/// The line spacing.
double? LineSpacing { get; set; }
///
/// Gets or sets the color of the text.
///
/// The color of the text.
string TextColor { get; set; }
///
/// Gets or sets the color of the ghost.
///
/// The color of the ghost.
string GhostColor { get; set; }
///
/// Gets or sets the frame.
///
/// The frame.
ITextFrame Frame { get; set; }
}
///
/// The possible values for grow control
///
public enum GrowControl
{
///
///
///
GrowInX,
///
///
///
GrowInY,
///
///
///
GrowInXY,
///
///
///
GrowInXYMaintainAspect,
}
///
/// The types of angle control
///
public enum AngleControl
{
///
///
///
FromAngle,
///
///
///
FromGeometry,
}
///
/// The types of units control
///
public enum UnitsControl
{
///
///
///
Absolute,
///
///
///
Parametric,
}
///
/// The types of vertex control
///
public enum VertexControl
{
///
///
///
OverlapNone,
///
///
///
OverlapDirect,
///
///
///
OverlapNoWrap,
///
///
///
OverlapWrap,
}
///
/// The types of vertex join
///
public enum VertexJoin
{
///
///
///
None,
///
///
///
Bevel,
///
///
///
Round,
///
///
///
Miter,
}
///
/// The types of origin control
///
public enum OriginControl
{
///
///
///
Global,
///
///
///
Local,
///
///
///
Centroid,
}
///
/// The types of clipping control
///
public enum ClippingControl
{
///
///
///
Clip,
///
///
///
Inside,
///
///
///
Overlap
}
///
/// The types of resize control
///
public enum ResizeControl
{
///
///
///
ResizeNone,
///
///
///
AddToResizeBox,
///
///
///
AdjustToResizeBox,
}
///
/// The types of line cap
///
public enum LineCap
{
///
///
///
None,
///
///
///
Round,
///
///
///
Triangle,
///
///
///
Square,
}
///
/// The types of line join
///
public enum LineJoin
{
///
///
///
None,
///
///
///
Bevel,
///
///
///
Round,
///
///
///
Miter,
}
///
/// The types of horizontal alignment
///
public enum HorizontalAlignment
{
///
///
///
Left,
///
///
///
Center,
///
///
///
Right,
}
///
/// The types of vertical alignment
///
public enum VerticalAlignment
{
///
///
///
Bottom,
///
///
///
Baseline,
///
///
///
Halfline,
///
///
///
Capline,
///
///
///
Top,
}
///
/// The types of justification
///
public enum Justification
{
///
///
///
Left,
///
///
///
Center,
///
///
///
Right,
///
///
///
Justified,
///
///
///
FromAlignment,
}
#endregion
#region Symbol Definition 1.1.0 interfaces
///
/// An extension of the text element to support rich text
///
public interface IText2 : IText
{
///
/// Gets or sets the type of rich text markup used to render the contents
///
string Markup { get; set; }
///
/// Gets or sets the text style attribute to create a line that runs on top of the text
///
string Overlined { get; set; }
///
/// Gets or sets the skew of shear angle to be applied to the text
///
string ObliqueAngle { get; set; }
///
/// Gets or sets the width scale applied to inter character spacing independent of the font character spacing
///
string TrackSpacing { get; set; }
}
#endregion
}