#include "user/user.h"
class FriendItemsHandler;
+class GPSLocationItem;
/**
* @brief Map engine
QGraphicsScene* scene();
/**
- * @brief Set auto centering.
- *
- * @param enabled true if enabled, false otherwise
- */
- void setAutoCentering(bool enabled);
-
- /**
* @brief Return tile path created from tile values.
*
* @param zoomLevel tile's zoom level
public slots:
/**
- * @brief Slot for immovable scene items position correction
- *
- * @param viewTopLeft Scene coordinate of the viewport top left corner
- */
- void alignImmovableItems(QPoint viewTopLeft);
-
- /**
* @brief Slot for setting current view location
*
* Emits locationChanged signal.
private slots:
/**
+ * @brief Slot for enabling / disabling GPS
+ *
+ * GPS location item is disabled or enabled based on GPS state
+ *
+ * @param enabled True is GPS is enabled, otherwise false
+ */
+ void gpsEnabled(bool enabled);
+
+ /**
+ * @brief Slot for GPS position updates
+ *
+ * GPS location item is updated and map centered to new location (if automatic
+ * centering is enabled).
+ *
+ * @param position New coordinates from GPS
+ * @param accuracy Accuracy of the GPS fix
+ */
+ void gpsPositionUpdate(QPointF position, qreal accuracy);
+
+ /**
* @brief Slot for received map tile images
*
* Does add MapTile objects to MapScene.
void mapImageReceived(int zoomLevel, int x, int y, const QPixmap &image);
/**
+ * @brief Set auto centering.
+ *
+ * @param enabled true if enabled, false otherwise
+ */
+ void setAutoCentering(bool enabled);
+
+ /**
* @brief Slot for actions after view zoom is finished
*
* Does run removeOutOfViewTiles
/**
* @brief Signal to notify map scrolling.
*/
- void mapScrolled();
+ void mapScrolledManually();
+
+ /**
+ * @brief Signal to notify when map is zoomed in to the maxmimum.
+ */
+ void maxZoomLevelReached();
+
+ /**
+ * @brief Signal to notify when map is zoomed out to the minimum.
+ */
+ void minZoomLevelReached();
/**
* @brief Signal request mapView to update view port contents
* DATA MEMBERS
******************************************************************************/
private:
- bool m_autoCenteringEnabled; ///< Auto centering enabled
+ bool m_autoCenteringEnabled; ///< Auto centering enabled
QPoint m_centerTile; ///< Current center tile
FriendItemsHandler *m_friendItemsHandler; ///< Handler for friend and group items
+ GPSLocationItem *m_gpsLocationItem; ///< Item pointing current location from GPS
QPoint m_lastManualPosition; ///< Last manually set position in scene coordinate
MapFetcher *m_mapFetcher; ///< Fetcher for map tiles
MapScene *m_mapScene; ///< Scene for map tiles