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;
35 class SearchHistoryListView;
38 * @brief Location search panel
40 * @author Jussi Laitinen - jussi.laitinen (at) ixonos.com
41 * @author Sami Rämö - sami.ramo (at) ixonos.com
43 class LocationSearchPanel : public PanelBase
49 * @brief Default constructor
53 LocationSearchPanel(QWidget *parent = 0);
58 * Writes search history to settings.
60 ~LocationSearchPanel();
62 /*******************************************************************************
63 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
64 ******************************************************************************/
67 * @brief Re-implemented from QWidget::hideEvent()
69 * Calls clearListsSelections()
73 void hideEvent(QHideEvent *event);
75 /*******************************************************************************
76 * MEMBER FUNCTIONS AND SLOTS
77 ******************************************************************************/
82 * @brief Set text for header
84 * @param count Search result count
86 void setHeaderText(int count);
90 void appendSearchHistory(QString searchString, QDateTime currentTime = QDateTime());
93 * @brief Clears lists' selections.
95 * Does call setRouteButtonDisabled().
97 void clearListsSelections();
100 * @brief Shows search history list.
102 void showSearchHistoryList();
105 * @brief Populates location list view.
107 * @param locations list of Location objects
109 void populateLocationListView(const QList<Location> &locations);
112 * @brief Routes to selected location.
114 * Emits routeToLocation if location is selected from list.
116 void routeToSelectedLocation();
119 * @brief Sets route button disabled.
121 * Disabled if there isn't any list item selected.
123 void setRouteButtonDisabled();
125 /*******************************************************************************
127 ******************************************************************************/
130 * @brief Signal for location item clicked.
132 * @param swBound south-west bound GeoCoordinate
133 * @param neBound north-east bound GeoCoordinate
135 void locationItemClicked(const GeoCoordinate &swBound, const GeoCoordinate &neBound);
138 * @brief Signal for requesting searching location.
140 void requestSearchLocation();
143 * @brief Signal for routing to location.
145 * @param coordinates location's geo coordinates
147 void routeToLocation(const GeoCoordinate &coordinates);
150 * @brief Signal for route waypoint item clicked.
152 * @param coordinate waypoint item's coordinate
154 void routeWaypointItemClicked(const GeoCoordinate &coordinate);
156 /*******************************************************************************
158 ******************************************************************************/
160 QLabel *m_resultsLabel; ///< Location list label
162 ImageButton *m_clearLocationListButton; ///< Clear location list button
163 ImageButton *m_routeButton; ///< Route to location button
164 SearchHistoryListView *m_searchHistoryListView; ///< Search history list view
165 LocationListView *m_locationListView; ///< Search results list view
168 #endif // LOCATIONSEARCHPANEL_H