2418f4c257b526a1953387f002757cd0d5a22b0a
[situare] / src / ui / routingpanel.h
1 /*
2     Situare - A location system for Facebook
3     Copyright (C) 2010  Ixonos Plc. Authors:
4
5         Jussi Laitinen - jussi.laitinen@ixonos.com
6         Sami Rämö - sami.ramo@ixonos.com
7
8     Situare is free software; you can redistribute it and/or
9     modify it under the terms of the GNU General Public License
10     version 2 as published by the Free Software Foundation.
11
12     Situare is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15     GNU General Public License for more details.
16
17     You should have received a copy of the GNU General Public License
18     along with Situare; if not, write to the Free Software
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
20     USA.
21 */
22
23 #ifndef ROUTINGPANEL_H
24 #define ROUTINGPANEL_H
25
26 #include <QtGui>
27
28 #include "panelbase.h"
29
30 class ExtendedListItemDelegate;
31 class GeoCoordinate;
32 class ImageButton;
33 class Route;
34 class RouteWaypointListView;
35
36 /**
37  * @brief Routing panel
38  *
39  * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
40  * @author Sami Rämö - sami.ramo (at) ixonos.com
41  */
42 class RoutingPanel : public PanelBase
43 {
44     Q_OBJECT
45
46 public:
47     /**
48      * @brief Default constructor
49      *
50      * @param parent
51      */
52     RoutingPanel(QWidget *parent = 0);
53
54 /*******************************************************************************
55  * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
56  ******************************************************************************/
57 protected:
58     /**
59     * @brief Re-implemented from QWidget::hideEvent()
60     *
61     * Calls clearListsSelections()
62     *
63     * @param event
64     */
65     void hideEvent(QHideEvent *event);
66
67 /*******************************************************************************
68  * MEMBER FUNCTIONS AND SLOTS
69  ******************************************************************************/
70 private slots:
71     /**
72     * @brief Clears lists' selections.
73     */
74     void clearListsSelections();
75
76     /**
77     * @brief Handler for clear route button clicks
78     */
79     void clearRouteButtonClicked();
80
81     /**
82     * @brief Sets route to the panel.
83     *
84     * Appends route waypoint list with route segments.
85     *
86     * @param route Route item containing parsed route details
87     */
88     void setRoute(Route &route);
89
90 /*******************************************************************************
91  * SIGNALS
92  ******************************************************************************/
93 signals:
94     /**
95     * @brief Emitted when route is cleared
96     */
97     void clearRoute();
98
99     /**
100     * @brief Request routing to current cursor position
101     */
102     void routeToCursor();
103
104     /**
105     * @brief Signal for route waypoint item clicked.
106     *
107     * @param coordinate waypoint item's coordinate
108     */
109     void routeWaypointItemClicked(const GeoCoordinate &coordinate);
110
111     /**
112      * @brief Signal for requesting a panel to be opened
113      *
114      * @param widget Pointer to the widget that emitted the signal
115      */
116     void showPanelRequested(QWidget *widget);
117
118 /*******************************************************************************
119  * DATA MEMBERS
120  ******************************************************************************/
121 private:
122     QLabel *m_resultsLabel;                             ///< Location list label
123
124     ImageButton *m_clearRouteButton;                    ///< Search location button
125     RouteWaypointListView *m_routeWaypointListView;     ///< Route instructions list view
126 };
127
128 #endif // ROUTINGPANEL_H