1//
2// Copyright 2008 Simon Edwards <simon@simonzone.com>
3//
4// This library is free software; you can redistribute it and/or
5// modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation; either
7// version 2.1 of the License, or (at your option) any later version.
8//
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12// Lesser General Public License for more details.
13//
14// You should have received a copy of the GNU Lesser General Public
15// License along with this library.  If not, see <http://www.gnu.org/licenses/>.
16//
17
18namespace Marble
19{
20
21class MarbleMap : QObject
22{
23%TypeHeaderCode
24#include <MarbleMap.h>
25%End
26
27public:
28                            MarbleMap ();
29    explicit                MarbleMap (Marble::MarbleModel* model);
30    Marble::MarbleModel*    model () const;
31    void                    setSize (int width, int height);
32    QSize                   size () const;
33    int                     width () const;
34    int                     height () const;
35    int                     radius () const;
36    void                    setRadius (int radius);
37    int                     minimumZoom () const;
38    int                     maximumZoom () const;
39    qreal                   centerLongitude () const;
40    qreal                   centerLatitude () const;
41    bool                    propertyValue (const QString& name) const;
42    bool                    showOverviewMap () const;
43    bool                    showScaleBar () const;
44    bool                    showCompass () const;
45    bool                    showClouds () const;
46    bool                    showAtmosphere () const;
47    bool                    showCrosshairs () const;
48    bool                    showGrid () const;
49    bool                    showPlaces () const;
50    bool                    showCities () const;
51    bool                    showTerrain () const;
52    bool                    showOtherPlaces () const;
53    bool                    showRelief () const;
54    bool                    showIceLayer () const;
55    bool                    showBorders () const;
56    bool                    showRivers () const;
57    bool                    showLakes () const;
58    bool                    showFrameRate () const;
59    quint64                 volatileTileCacheLimit () const;
60    QList<Marble::RenderPlugin*>  renderPlugins () const;
61    QList<Marble::AbstractFloatItem*>  floatItems () const;
62    void                    rotateBy (const qreal& deltaLon /in/, const qreal& deltaLat /in/);
63    void                    setCenterLatitude (qreal lat);
64    void                    setCenterLongitude (qreal lon);
65    Marble::Projection      projection () const;
66    void                    setProjection (Marble::Projection projection);
67    QString                 mapThemeId () const;
68    void                    setMapThemeId (const QString& maptheme);
69    void                    setPropertyValue (const QString& name, bool value);
70    void                    setShowOverviewMap (bool visible);
71    void                    setShowScaleBar (bool visible);
72    void                    setShowCompass (bool visible);
73    void                    setShowClouds (bool visible);
74    void                    setShowTileId (bool visible);
75    void                    setShowAtmosphere (bool visible);
76    void                    setShowCrosshairs (bool visible);
77    void                    setShowGrid (bool visible);
78    void                    setShowPlaces (bool visible);
79    void                    setShowCities (bool visible);
80    void                    setShowTerrain (bool visible);
81    void                    setShowOtherPlaces (bool visible);
82    void                    setShowRelief (bool visible);
83    void                    setShowIceLayer (bool visible);
84    void                    setShowBorders (bool visible);
85    void                    setShowRivers (bool visible);
86    void                    setShowLakes (bool visible);
87    void                    setShowFrameRate (bool visible);
88    void                    notifyMouseClick (int x, int y);
89    void                    clearVolatileTileCache ();
90    void                    setVolatileTileCacheLimit (quint64 kiloBytes);
91    Marble::AngleUnit       defaultAngleUnit () const;
92    void                    setDefaultAngleUnit (Marble::AngleUnit angleUnit);
93    QFont                   defaultFont () const;
94    void                    setDefaultFont (const QFont& font);
95
96signals:
97    void                    projectionChanged (Marble::Projection);
98    void                    mouseClickGeoPosition (qreal lon, qreal lat, Marble::GeoDataCoordinates::Unit);
99    void                    framesPerSecond (qreal fps);
100
101protected:
102    virtual void            customPaint (Marble::GeoPainter* painter);
103
104public:
105    virtual ~MarbleMap ();
106    void                    reload ();
107    Marble::ViewportParams*  viewport ();
108    Marble::MapQuality      mapQuality () const;
109    void                    setSize (const QSize& size);
110    bool                    screenCoordinates (qreal lon, qreal lat, qreal& x, qreal& y) const;
111    bool                    geoCoordinates (int x, int y, qreal& lon, qreal& lat, Marble::GeoDataCoordinates::Unit = Marble::GeoDataCoordinates::Degree) const;
112    Marble::AbstractFloatItem*  floatItem (const QString& nameId) const;
113    void                    centerOn (const qreal lon, const qreal lat);
114signals:
115    void                    themeChanged (const QString& theme);
116    void                    mouseMoveGeoPosition (const QString&);
117    void                    visibleLatLonAltBoxChanged (const Marble::GeoDataLatLonAltBox& visibleLatLonAltBox);
118public:
119    int                     tileZoomLevel () const;
120    bool                    showBackground () const;
121    QList<Marble::AbstractDataPlugin*>  dataPlugins () const;
122    QList<Marble::AbstractDataPluginItem*>  whichItemAt (const QPoint& curpos) const;
123    void                    addLayer (Marble::LayerInterface* layer);
124    void                    removeLayer (Marble::LayerInterface* layer);
125    void                    setShowBackground (bool visible);
126signals:
127    void                    tileLevelChanged (int level);
128    void                    repaintNeeded (const QRegion& dirtyRegion = QRegion());
129    void                    pluginSettingsChanged ();
130    void                    renderPluginInitialized (Marble::RenderPlugin* renderPlugin);
131public:
132    void                    setMapQualityForViewContext (Marble::MapQuality qualityForViewContext, Marble::ViewContext viewContext);
133    Marble::MapQuality      mapQuality (Marble::ViewContext viewContext) const;
134    void                    setViewContext (Marble::ViewContext viewContext);
135    Marble::ViewContext     viewContext () const;
136    int                     preferredRadiusCeil (int radius);
137    int                     preferredRadiusFloor (int radius);
138//FIXME
139//ig    QVector<const Marble::GeoDataPlacemark*>  whichFeatureAt (const QPoint&) const;
140//ig    const Marble::ViewportParams*  viewport () const;
141    bool                    showSunShading () const;
142    bool                    showCityLights () const;
143    void                    paint (Marble::GeoPainter& painter, const QRect& dirtyRect);
144    void                    setShowSunShading (bool visible);
145    void                    setShowCityLights (bool visible);
146signals:
147    void                    radiusChanged (int radius);
148public:
149//ig    const TextureLayer*     textureLayer () const;
150    void                    setShowRuntimeTrace (bool visible);
151    void                    downloadRegion (const QVector<Marble::TileCoordsPyramid>&);
152    bool                    isLockedToSubSolarPoint () const;
153    bool                    isSubSolarPointIconVisible () const;
154    void                    setLockToSubSolarPoint (bool visible);
155    void                    setSubSolarPointIconVisible (bool visible);
156};
157// MarbleMap
158
159};
160// Marble
161
162
163