Added LocationSearchPanel (which is currently a copy of RoutingPanel)
[situare] / src / ui / routingpanel.h
index 55fe2a4..9bd7b99 100644 (file)
@@ -3,6 +3,7 @@
     Copyright (C) 2010  Ixonos Plc. Authors:
 
         Jussi Laitinen - jussi.laitinen@ixonos.com
+        Sami Rämö - sami.ramo@ixonos.com
 
     Situare is free software; you can redistribute it and/or
     modify it under the terms of the GNU General Public License
@@ -28,8 +29,9 @@
 
 class ExtendedListItemDelegate;
 class GeoCoordinate;
-class LocationListView;
+class ImageButton;
 class Location;
+class LocationListView;
 class Route;
 class RouteWaypointListView;
 
@@ -37,6 +39,7 @@ class RouteWaypointListView;
  * @brief Class for sliding routing panel
  *
  * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
+ * @author Sami Rämö - sami.ramo (at) ixonos.com
  */
 class RoutingPanel : public PanelBase
 {
@@ -66,6 +69,17 @@ protected:
 /*******************************************************************************
  * MEMBER FUNCTIONS AND SLOTS
  ******************************************************************************/
+private:
+    /**
+    * @brief Switch to search results view mode
+    */
+    void showResultsView();
+
+    /**
+    * @brief Switch to routing instructions view mode
+    */
+    void showRoutingView();
+
 private slots:
     /**
     * @brief Clears lists' selections.
@@ -82,6 +96,11 @@ private slots:
     void populateLocationListView(const QList<Location> &locations);
 
     /**
+    * @brief Handler for route button toggling actions
+    */
+    void routeButtonToggled(bool checked);
+
+    /**
     * @brief Routes to selected location.
     *
     * Emits routeToLocation if location is selected from list.
@@ -89,6 +108,11 @@ private slots:
     void routeToSelectedLocation();
 
     /**
+    * @brief Handler for search button toggling actions
+    */
+    void searchLocationButtonToggled(bool checked);
+
+    /**
     * @brief Sets route to the panel.
     *
     * Appends route waypoint list with route segments.
@@ -108,6 +132,11 @@ private slots:
  ******************************************************************************/
 signals:
     /**
+    * @brief Emitted when route is cleared
+    */
+    void clearRoute();
+
+    /**
     * @brief Signal for location item clicked.
     *
     * @param swBound south-west bound GeoCoordinate
@@ -145,15 +174,17 @@ signals:
  * DATA MEMBERS
  ******************************************************************************/
 private:
-    QLabel *m_locationListLabel;            ///< Location list label
+    QLabel *m_resultsLabel;                 ///< Location list label
 
-    QPushButton *m_routeButton;             ///< Route to location button
-    QPushButton *m_searchLocationButton;    ///< Search location button
+    QStackedLayout *m_views;                ///< Views
 
-    QWidget *m_locationListHeaderWidget;    ///< Location list header widget
+    QWidget *m_resultsView;                 ///< Search results view widget
+    QWidget *m_routingView;                 ///< Routing instructions view widget
 
-    LocationListView *m_locationListView;   ///< Location list view
-    RouteWaypointListView *m_routeWaypointListView; ///< Route waypoint list view
+    ImageButton *m_routeButton;             ///< Route to location button
+    ImageButton *m_searchLocationButton;    ///< Search location button
+    LocationListView *m_locationListView;   ///< Search results list view
+    RouteWaypointListView *m_routeWaypointListView;     ///< Route instructions list view
 };
 
 #endif // ROUTINGPANEL_H