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
#include <QtGui>
+#include "panelbase.h"
+
class ExtendedListItemDelegate;
class GeoCoordinate;
-class LocationListView;
-class Location;
+class ImageButton;
+class Route;
+class RouteWaypointListView;
/**
- * @brief Class for sliding routing panel
+ * @brief Routing panel
*
* @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
+ * @author Sami Rämö - sami.ramo (at) ixonos.com
*/
-class RoutingPanel : public QWidget
+class RoutingPanel : public PanelBase
{
Q_OBJECT
RoutingPanel(QWidget *parent = 0);
/*******************************************************************************
+ * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
+ ******************************************************************************/
+protected:
+ /**
+ * @brief Re-implemented from QWidget::hideEvent()
+ *
+ * Calls clearListsSelections()
+ *
+ * @param event
+ */
+ void hideEvent(QHideEvent *event);
+
+/*******************************************************************************
* MEMBER FUNCTIONS AND SLOTS
******************************************************************************/
private slots:
/**
- * @brief Populates location list view.
+ * @brief Clears lists' selections.
+ */
+ void clearListsSelections();
+
+ void clearRouteButtonClicked();
+
+ /**
+ * @brief Sets route to the panel.
*
- * @param result list of Location objects
+ * Appends route waypoint list with route segments.
+ *
+ * @param route Route item containing parsed route details
*/
- void populateLocationListView(QList<Location> &locations);
+ void setRoute(Route &route);
/*******************************************************************************
* SIGNALS
******************************************************************************/
signals:
/**
- * @brief Signal for location item clicked.
+ * @brief Emitted when route is cleared
+ */
+ void clearRoute();
+
+ /**
+ * @brief Request routing to current cursor position
+ */
+ void routeToCursor();
+
+ /**
+ * @brief Signal for route waypoint item clicked.
*
- * @param swBound south-west bound GeoCoordinate
- * @param neBound north-east bound GeoCoordinate
+ * @param coordinate waypoint item's coordinate
*/
- void locationItemClicked(GeoCoordinate &swBound, GeoCoordinate &neBound);
+ void routeWaypointItemClicked(const GeoCoordinate &coordinate);
+
+ /**
+ * @brief Signal for requesting a panel to be opened
+ *
+ * @param widget Pointer to the widget that emitted the signal
+ */
+ void showPanelRequested(QWidget *widget);
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
private:
- LocationListView *m_locationListView; ///< Location list view
+ QLabel *m_resultsLabel; ///< Location list label
+
+ ImageButton *m_clearRouteButton; ///< Search location button
+ RouteWaypointListView *m_routeWaypointListView; ///< Route instructions list view
};
#endif // ROUTINGPANEL_H