#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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OSGeo.MapGuide.ObjectModels.Common;
using System.Drawing;
using OSGeo.MapGuide.MaestroAPI.Mapping;
using System.ComponentModel;
using System.Collections.ObjectModel;
namespace Maestro.MapViewer
{
///
/// A map viewer component
///
public interface IMapViewer : INotifyPropertyChanged
{
///
/// Clears the current selection
///
void ClearSelection();
///
/// Starts the digitization process for a circle
///
/// The callback to be invoked when the digitization process completes
void DigitizeCircle(CircleDigitizationCallback callback);
///
/// Starts the digitization process for a line
///
/// The callback to be invoked when the digitization process completes
void DigitizeLine(LineDigitizationCallback callback);
///
/// Starts the digitization process for a point
///
/// The callback to be invoked when the digitization process completes
void DigitizePoint(PointDigitizationCallback callback);
///
/// Starts the digitization process for a polygon
///
/// The callback to be invoked when the digitization process completes
void DigitizePolygon(PolygonDigitizationCallback callback);
///
/// Starts the digitization process for a line string (polyline)
///
/// The callback to be invoked when the digitization process completes
void DigitizeLineString(LineStringDigitizationCallback callback);
///
/// Starts the digitization process for a line string (polyline)
///
/// The callback to be invoked when the digitization process completes
/// The callback to be invoked when a new segment of the current line string is digitized
void DigitizeLineString(LineStringDigitizationCallback callback, LineDigitizationCallback segmentDigitized);
///
/// Starts the digitization process for a rectangle
///
/// The callback to be invoked when the digitization process completes
void DigitizeRectangle(RectangleDigitizationCallback callback);
///
/// Starts the digitization process for a circle
///
/// The callback to be invoked when the digitization process completes
/// The custom prompt to use for the tracking tooltip
void DigitizeCircle(CircleDigitizationCallback callback, string customPrompt);
///
/// Starts the digitization process for a line
///
/// The callback to be invoked when the digitization process completes
/// The custom prompt to use for the tracking tooltip
void DigitizeLine(LineDigitizationCallback callback, string customPrompt);
///
/// Starts the digitization process for a point
///
/// The callback to be invoked when the digitization process completes
/// The custom prompt to use for the tracking tooltip
void DigitizePoint(PointDigitizationCallback callback, string customPrompt);
///
/// Starts the digitization process for a polygon
///
/// The callback to be invoked when the digitization process completes
/// The custom prompt to use for the tracking tooltip
void DigitizePolygon(PolygonDigitizationCallback callback, string customPrompt);
///
/// Starts the digitization process for a line string (polyline)
///
/// The callback to be invoked when the digitization process completes
/// The custom prompt to use for the tracking tooltip
void DigitizeLineString(LineStringDigitizationCallback callback, string customPrompt);
///
/// Starts the digitization process for a line string (polyline)
///
/// The callback to be invoked when the digitization process completes
/// The callback to be invoked when a new segment of the current line string is digitized
/// The custom prompt to use for the tracking tooltip
void DigitizeLineString(LineStringDigitizationCallback callback, LineDigitizationCallback segmentDigitized, string customPrompt);
///
/// Starts the digitization process for a rectangle
///
/// The callback to be invoked when the digitization process completes
/// The custom prompt to use for the tracking tooltip
void DigitizeRectangle(RectangleDigitizationCallback callback, string customPrompt);
///
/// Gets the current runtime map
///
///
RuntimeMap GetMap();
///
/// Gets or sets the color used to render selected features
///
Color SelectionColor { get; set; }
///
/// Gets or sets the active tool
///
MapActiveTool ActiveTool { get; set; }
///
/// Gets or sets the minimum allowed zoom scale for this viewer
///
int MinScale { get; set; }
///
/// Gets or sets the maximum allowed zoom scale for this viewer
///
int MaxScale { get; set; }
///
/// The amount of time (in ms) to wait to re-render after a mouse wheel scroll
///
int MouseWheelDelayRenderInterval { get; set; }
///
/// Gets or sets the factor by which to multiply the scale to zoom in
///
double ZoomInFactor { get; set; }
///
/// Gets or sets the factor by which to multiply the scale to zoom out
///
double ZoomOutFactor { get; set; }
///
/// Gets or sets whether feature tooltips are enabled. If set to true, tooltip queries are
/// executed at the current mouse position if the active tool is Pan or Select
///
bool FeatureTooltipsEnabled { get; set; }
///
/// Gets whether the viewer has any active rendering operations
///
bool IsBusy { get; }
///
/// Gets the type of object being currently digitized. If the digitization type is None, then
/// the viewer is not currently digitizing
///
MapDigitizationType DigitizingType { get; }
///
/// Gets the currently rendered image
///
///
System.Drawing.Image GetCurrentImage();
///
/// Copies the image of the current map to the clipboard
///
void CopyMap();
///
/// Refreshes the current map view. Any changes to the runtime map state will be saved first before rendering begins
///
void RefreshMap();
///
/// Raised when the viewer has started refreshing the map. This is to allow
/// any actions dependent on map state to update themselves asynchronously
/// without needing to wait for the updated map to be rendered.
///
event EventHandler MapRefreshing;
///
/// Raised when the map has been refreshed and the updated map image has been rendered
///
event EventHandler MapRefreshed;
///
/// Pans the view left by a pre-defined distance
///
///
void PanLeft(bool refresh);
///
/// Pans the view up by a pre-defined distance
///
///
void PanUp(bool refresh);
///
/// Pans the view right by a pre-defined distance
///
///
void PanRight(bool refresh);
///
/// Pans the view down by a pre-defined distance
///
///
void PanDown(bool refresh);
///
/// Updates the rendered selection. Call this method if you have manipulated the selection
/// set outside of the viewer
///
void UpdateSelection();
///
/// Updates the rendered selection. Call this method if you have manipulated the selection
/// set outside of the viewer
///
/// Indicates if the event should be raised as well
void UpdateSelection(bool raise);
///
/// Selects features from all selectable layers that intersects the given geometry in WKT format
///
/// The geometry wkt
/// The maximum number of features to select. Specify -1 to select all features
void SelectByWkt(string wkt, int maxFeatures);
///
/// Zooms to the initial map view
///
void InitialMapView();
///
/// Zooms to the specified map view
///
///
///
///
///
void ZoomToView(double x, double y, double scale, bool refresh);
///
/// Raised when the scale of the current runtime map has changed
///
event EventHandler MapScaleChanged;
///
/// Raised when the selection has changed. Note that programmatic selection modifications
/// will not raise this event.
///
event EventHandler SelectionChanged;
///
/// Raised when the viewer has been initialized
///
event EventHandler MapLoaded;
///
/// Raised when the map cursor position has changed
///
event EventHandler MouseMapPositionChanged;
///
/// Zooms to the view defined by the specified extent
///
///
///
///
///
void ZoomToExtents(double llx, double lly, double urx, double ury);
///
/// Gets or sets whether to show vertex coordinates when digitizing
///
bool ShowVertexCoordinatesWhenDigitizing { get; set; }
///
/// Gets or sets whether to convert tiled layers to non-tiled layers. This is a workaround
/// setting for tiled maps to be displayed as viewer support for tiled layers is still not
/// implemented
///
bool ConvertTiledGroupsToNonTiled { get; set; }
///
/// Gets whether to use the RenderMap API instead of RenderDynamicOverlay if the map has tiled
/// layers. RenderMap includes tiled layers as part of the output image, but will not take advantage
/// of any tile caching mechanisms. Setting this property to true nullifies any effect of the
/// property
///
bool UseRenderMapIfTiledLayersExist { get; set; }
///
/// Gets whether to respect the list of finite display scales in a map being viewed if there are any defined.
/// If true, all zooms will "snap" to the nearest finite display scale
///
bool RespectFiniteDisplayScales { get; set; }
///
/// Gets whether this viewer has a map loaded into it
///
bool HasLoadedMap { get; }
///
/// Gets or sets the amount of pixels to buffer out by when doing point-based selections with the Select tool
///
int PointPixelBuffer { get; set; }
///
/// Navigates to the previous view in the history stack
///
void PreviousView();
///
/// Navigates to the next view in the history stack
///
void NextView();
///
/// Gets the current index in the view history stack
///
int ViewHistoryIndex { get; }
///
/// Gets the view history stack. The first item being the earliest and the last item being the most recent.
///
ReadOnlyCollection ViewHistory { get; }
///
/// Gets the current view extent in the map's coordinates
///
///
///
///
///
void GetViewExtent(out double minX, out double minY, out double maxX, out double maxY);
}
///
/// A toolbar that contains a default set of viewer commands
///
public interface IDefaultToolbar
{
///
/// Gets or sets the viewer this toolbar is associated with
///
IMapViewer Viewer { get; set; }
}
}