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 MarbleWidget : QWidget 22{ 23%TypeHeaderCode 24#include <MarbleWidget.h> 25%End 26 27public: 28 explicit MarbleWidget (QWidget* parent /TransferThis/ = 0); 29 Marble::MarbleModel* model () const; 30 int radius () const; 31 void setRadius (int radius); 32 int zoom () const; 33 qreal distance () const; 34 void setDistance (qreal distance); 35 QString distanceString () const; 36 int minimumZoom () const; 37 int maximumZoom () const; 38 qreal centerLongitude () const; 39 qreal centerLatitude () const; 40 QPixmap mapScreenShot (); 41 bool showOverviewMap () const; 42 bool showScaleBar () const; 43 bool showCompass () const; 44 bool showClouds () const; 45 bool showAtmosphere () const; 46 bool showCrosshairs () const; 47 bool showGrid () const; 48 bool showPlaces () const; 49 bool showCities () const; 50 bool showTerrain () const; 51 bool showOtherPlaces () const; 52 bool showRelief () const; 53 bool showIceLayer () const; 54 bool showBorders () const; 55 bool showRivers () const; 56 bool showLakes () const; 57 bool showFrameRate () const; 58 quint64 volatileTileCacheLimit () const; 59 QList<Marble::RenderPlugin*> renderPlugins () const; 60 QList<Marble::AbstractFloatItem*> floatItems () const; 61 Marble::Projection projection () const; 62 QString mapThemeId () const; 63 Marble::ViewContext viewContext () const; 64 bool animationsEnabled () const; 65 Marble::AngleUnit defaultAngleUnit () const; 66 void setDefaultAngleUnit (Marble::AngleUnit angleUnit); 67 QFont defaultFont () const; 68 void setDefaultFont (const QFont& font); 69 void zoomView (int zoom, Marble::FlyToMode mode = Marble::Instant); 70 void zoomViewBy (int zoomStep, Marble::FlyToMode mode = Marble::Instant); 71 void zoomIn (Marble::FlyToMode mode = Marble::Automatic); 72 void zoomOut (Marble::FlyToMode mode = Marble::Automatic); 73 void centerOn (const Marble::GeoDataCoordinates& point, bool animated = 0); 74 void setCenterLatitude (qreal lat, Marble::FlyToMode mode = Marble::Instant); 75 void setCenterLongitude (qreal lon, Marble::FlyToMode mode = Marble::Instant); 76 void setProjection (int projection); 77 void setProjection (Marble::Projection projection /Constrained/); 78 void moveLeft (Marble::FlyToMode mode = Marble::Automatic); 79 void moveRight (Marble::FlyToMode mode = Marble::Automatic); 80 void moveUp (Marble::FlyToMode mode = Marble::Automatic); 81 void moveDown (Marble::FlyToMode mode = Marble::Automatic); 82 void goHome (Marble::FlyToMode mode = Marble::Automatic); 83 void setMapThemeId (const QString& maptheme); 84 void setPropertyValue (const QString& name, bool value); 85 void setShowOverviewMap (bool visible); 86 void setShowScaleBar (bool visible); 87 void setShowCompass (bool visible); 88 void setShowClouds (bool visible); 89 void setShowAtmosphere (bool visible); 90 void setShowCrosshairs (bool visible); 91 void setShowGrid (bool visible); 92 void setShowPlaces (bool visible); 93 void setShowCities (bool visible); 94 void setShowTerrain (bool visible); 95 void setShowOtherPlaces (bool visible); 96 void setShowRelief (bool visible); 97 void setShowIceLayer (bool visible); 98 void setShowBorders (bool visible); 99 void setShowRivers (bool visible); 100 void setShowLakes (bool visible); 101 void setShowFrameRate (bool visible); 102 void setShowTileId (bool visible); 103 void notifyMouseClick (int x, int y); 104 void clearVolatileTileCache (); 105 void setVolatileTileCacheLimit (quint64 kiloBytes); 106 void creatingTilesStart (Marble::TileCreator* creator, const QString& name, const QString& description); 107 void setViewContext (Marble::ViewContext viewContext); 108 void setAnimationsEnabled (bool enabled); 109 void setSelection (const QRect& region); 110 111signals: 112 void zoomChanged (int zoom); 113 void distanceChanged (const QString& distanceString); 114 void projectionChanged (Marble::Projection); 115 void mouseClickGeoPosition (qreal lon, qreal lat, Marble::GeoDataCoordinates::Unit); 116 void framesPerSecond (qreal fps); 117 118protected: 119 void leaveEvent (QEvent* event); 120 void paintEvent (QPaintEvent* event); 121 virtual void customPaint (Marble::GeoPainter* painter); 122 void resizeEvent (QResizeEvent* event); 123 void connectNotify (const char* signal); 124 void disconnectNotify (const char* signal); 125 126public: 127 virtual ~MarbleWidget (); 128//ig MarbleWidgetInputHandler* inputHandler () const; 129//ig void setInputHandler (MarbleWidgetInputHandler* handler); 130 void readPluginSettings (QSettings& settings); 131 void writePluginSettings (QSettings& settings) const; 132//ig Marble::GeoSceneDocument* mapTheme () const; 133 void setInputEnabled (bool); 134 void centerOn (const Marble::GeoDataLatLonBox& box, bool animated = 0); 135signals: 136//ig void regionSelected (const Marble::GeoDataLatLonBox &); 137 void pluginSettingsChanged (); 138 void renderPluginInitialized (Marble::RenderPlugin* renderPlugin); 139protected: 140 void changeEvent (QEvent* event); 141public: 142//ig Marble::ViewportParams* viewport (); 143 const Marble::ViewportParams* viewport () const; 144 Marble::GeoDataLookAt lookAt () const; 145 Marble::AbstractFloatItem* floatItem (const QString& nameId) const; 146//ig RoutingLayer* routingLayer (); 147 void rotateBy (const qreal deltaLon, const qreal deltaLat, Marble::FlyToMode mode = Marble::Instant); 148 void centerOn (const qreal lon, const qreal lat, bool animated = 0); 149 void flyTo (const Marble::GeoDataLookAt& lookAt, Marble::FlyToMode mode = Marble::Automatic); 150 void reloadMap (); 151signals: 152 void themeChanged (const QString& theme); 153 void mouseMoveGeoPosition (const QString&); 154 void visibleLatLonAltBoxChanged (const Marble::GeoDataLatLonAltBox& visibleLatLonAltBox); 155public: 156 int tileZoomLevel () const; 157 QList<Marble::AbstractDataPluginItem*> whichItemAt (const QPoint& curpos) const; 158signals: 159 void tileLevelChanged (int level); 160public: 161 void addLayer (Marble::LayerInterface* layer /Transfer/); 162 void removeLayer (Marble::LayerInterface* layer /TransferBack/); 163 qreal radiusFromDistance (qreal distance) const; 164 qreal distanceFromRadius (qreal radius) const; 165 qreal zoomFromDistance (qreal distance) const; 166 qreal distanceFromZoom (qreal zoom) const; 167 bool showBackground () const; 168 void setShowBackground (bool visible); 169 void setMapQualityForViewContext (Marble::MapQuality quality, Marble::ViewContext viewContext); 170//FIXME 171//ig QVector<const Marble::GeoDataPlacemark*> whichFeatureAt (const QPoint&) const; 172//ig MarbleWidgetPopupMenu* popupMenu (); 173 bool showSunShading () const; 174 bool showCityLights () const; 175 void centerOn (const Marble::GeoDataPlacemark& placemark, bool animated = 0); 176 void setShowSunShading (bool visible); 177 void setShowCityLights (bool visible); 178 QRegion mapRegion () const; 179 bool screenCoordinates (qreal lon, qreal lat, qreal& x, qreal& y) const; 180 bool geoCoordinates (int x, int y, qreal& lon, qreal& lat, Marble::GeoDataCoordinates::Unit = Marble::GeoDataCoordinates::Degree) const; 181 qreal moveStep () const; 182 Marble::GeoDataCoordinates focusPoint () const; 183 void setFocusPoint (const Marble::GeoDataCoordinates& focusPoint); 184 void resetFocusPoint (); 185 Marble::MapQuality mapQuality (Marble::ViewContext = Marble::Still) const; 186//ig const TextureLayer* textureLayer () const; 187 void setShowRuntimeTrace (bool visible); 188 void downloadRegion (const QVector<Marble::TileCoordsPyramid>&); 189 190// FIXME 191//ig PopupLayer* popupLayer (); 192 bool isLockedToSubSolarPoint () const; 193 bool isSubSolarPointIconVisible () const; 194 void setZoom (int zoom, Marble::FlyToMode mode = Marble::Instant); 195 void setLockToSubSolarPoint (bool visible); 196 void setSubSolarPointIconVisible (bool visible); 197}; 198// MarbleWidget 199 200}; 201// Marble 202 203 204