Merge branch 'crosshair2'
[situare] / src / map / mapview.h
index fdac835..8f86892 100644 (file)
@@ -3,6 +3,7 @@
    Copyright (C) 2010  Ixonos Plc. Authors:
 
        Sami Rämö - sami.ramo@ixonos.com
+       Pekka Nissinen - pekka.nissinen@ixonos.com
 
    Situare is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -29,6 +30,7 @@
 * @brief Map view widget
 *
 * @author Sami Rämö - sami.ramo (at) ixonos.com
+* @author Pekka Nissinen - pekka.nissinen (at) ixonos.com
 */
 class MapView : public QGraphicsView
 {
@@ -79,13 +81,6 @@ private:
     */
     void mousePressEvent(QMouseEvent *event);
 
-    /**
-    * @brief Event handler for timer events, used for smooth zoom effect
-    *
-    * @param event
-    */
-    void timerEvent(QTimerEvent *event);
-
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
@@ -104,15 +99,19 @@ public slots:
     */
     void setZoomLevel(int zoomLevel);
 
-private:
     /**
-    * @brief get current horizontal scale (vertical should be same)
-    *
-    * @return qreal Current horizontal scale value
+    * @brief updates view ports content
     */
-    qreal currentScale();
+    void updateViewPortContent();
 
     /**
+    * @brief Slot for catching request to get view port contents.
+    * implementation of this slot sends signal that includes visble area of view port.
+    */
+    QRect viewportContent();
+
+private:
+    /**
     * @brief Set new view scale
     *
     * @param viewScale New scaling factor
@@ -148,7 +147,6 @@ signals:
 
     /**
     * @brief Signal for informing that zooming animation is finished
-    *
     */
     void viewZoomFinished();
 
@@ -160,16 +158,29 @@ signals:
     */
     void viewContentChanged(QPoint viewTopLeft);
 
+    /**
+    * @brief Signal that sends visible area of map scene
+    *
+    * @param viewArea visible area of map scene
+    */
+    void updateViewContent(QRect viewArea);
+
+    /**
+    * @brief Signal for drawing OSM license
+    *
+    * Signal is emitted when view is resized.
+    * @param width Viewport width
+    * @param height Viewport height
+    */
+    void viewResizedNewSize(int width, int height);
+
 /*******************************************************************************
  * DATA MEMBERS
  ******************************************************************************/
-private:           
+private:
     QPoint m_mousePosition; ///< Previous mouse event position
     QPoint m_scenePosition; ///< New center position
-    int m_timerID; ///< ID number of the timer used for smooth zoom effect
     QPropertyAnimation *m_zoomAnimation; ///< Zoom animation
-    qreal m_zoomScaleDelta; ///< Scaling factor delta for smooth zoom transition effect
-    qreal m_zoomTargetScale; ///< Scaling factor of the target zoom level
 };
 
 #endif // MAPVIEW_H