2 Situare - A location system for Facebook
3 Copyright (C) 2010 Ixonos Plc. Authors:
5 Jussi Laitinen - jussi.laitinen@ixonos.com
6 Sami Rämö - sami.ramo@ixonos.com
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.
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.
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,
23 #ifndef LOCATIONSEARCHPANEL_H
24 #define LOCATIONSEARCHPANEL_H
28 #include "panelbase.h"
30 class ExtendedListItemDelegate;
34 class LocationListView;
36 class RouteWaypointListView;
39 * @brief Location search panel
41 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
42 * @author Sami Rämö - sami.ramo (at) ixonos.com
44 class LocationSearchPanel : public PanelBase
50 * @brief Default constructor
54 LocationSearchPanel(QWidget *parent = 0);
56 /*******************************************************************************
57 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
58 ******************************************************************************/
61 * @brief Re-implemented from QWidget::hideEvent()
63 * Calls clearListsSelections()
67 void hideEvent(QHideEvent *event);
69 /*******************************************************************************
70 * MEMBER FUNCTIONS AND SLOTS
71 ******************************************************************************/
74 * @brief Switch to search results view mode
76 void showResultsView();
79 * @brief Switch to routing instructions view mode
81 void showRoutingView();
85 * @brief Clears lists' selections.
87 * Does call setRouteButtonDisabled().
89 void clearListsSelections();
92 * @brief Populates location list view.
94 * @param locations list of Location objects
96 void populateLocationListView(const QList<Location> &locations);
99 * @brief Handler for route button toggling actions
101 void routeButtonToggled(bool checked);
104 * @brief Routes to selected location.
106 * Emits routeToLocation if location is selected from list.
108 void routeToSelectedLocation();
111 * @brief Handler for search button toggling actions
113 void searchLocationButtonToggled(bool checked);
116 * @brief Sets route to the panel.
118 * Appends route waypoint list with route segments.
119 * @param route Route item containing parsed route details
121 void setRoute(Route &route);
124 * @brief Sets route button disabled.
126 * Disabled if there isn't any list item selected.
128 void setRouteButtonDisabled();
130 /*******************************************************************************
132 ******************************************************************************/
135 * @brief Emitted when route is cleared
140 * @brief Signal for location item clicked.
142 * @param swBound south-west bound GeoCoordinate
143 * @param neBound north-east bound GeoCoordinate
145 void locationItemClicked(const GeoCoordinate &swBound, const GeoCoordinate &neBound);
148 * @brief Signal for requesting searching location.
150 void requestSearchLocation();
153 * @brief Signal for routing to location.
155 * @param coordinates location's geo coordinates
157 void routeToLocation(const GeoCoordinate &coordinates);
160 * @brief Signal for route waypoint item clicked.
162 * @param coordinate waypoint item's coordinate
164 void routeWaypointItemClicked(const GeoCoordinate &coordinate);
167 * @brief Signal for requesting a panel to be opened
169 * @param widget Pointer to the widget that emitted the signal
171 void showPanelRequested(QWidget *widget);
173 /*******************************************************************************
175 ******************************************************************************/
177 QLabel *m_resultsLabel; ///< Location list label
179 QStackedLayout *m_views; ///< Views
181 QWidget *m_resultsView; ///< Search results view widget
182 QWidget *m_routingView; ///< Routing instructions view widget
184 ImageButton *m_routeButton; ///< Route to location button
185 ImageButton *m_searchLocationButton; ///< Search location button
186 LocationListView *m_locationListView; ///< Search results list view
187 RouteWaypointListView *m_routeWaypointListView; ///< Route instructions list view
190 #endif // LOCATIONSEARCHPANEL_H