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 ******************************************************************************/
80 * @brief Reads search history from settings.
85 * @brief Set text for header
87 * @param count Search result count
89 void setHeaderText(int count);
93 * @brief Prepends search history list view with search.
95 * If search history limit is reached, oldest search is removed from list view.
97 * @param searchString search string to add
98 * @param dateTime date and time of search (if empty, current date and time is added)
100 void prependSearchHistory(QString searchString, QDateTime dateTime = QDateTime());
103 * @brief Clears lists' selections.
105 * Does call setRouteButtonDisabled().
107 void clearListsSelections();
110 * @brief show / hide empty panel label
112 * @param show true if empty panel should be shown
114 void showEmptyPanel(bool show);
117 * @brief Shows location list view.
119 * @param locationItemsCount location items count
121 void showLocationListView(int locationItemsCount);
124 * @brief Shows search history list view.
126 void showSearchHistoryListView();
129 * @brief Populates location list view.
131 * @param locations list of Location objects
133 void populateLocationListView(const QList<Location> &locations);
136 * @brief Routes to selected location.
138 * Emits routeToLocation if location is selected from list.
140 void routeToSelectedLocation();
142 /*******************************************************************************
144 ******************************************************************************/
147 * @brief Signal for location item clicked.
149 * @param swBound south-west bound GeoCoordinate
150 * @param neBound north-east bound GeoCoordinate
152 void locationItemClicked(const GeoCoordinate &swBound, const GeoCoordinate &neBound);
155 * @brief Signal for requesting searching location.
157 void requestSearchLocation();
160 * @brief Signal for routing to location.
162 * @param coordinates location's geo coordinates
164 void routeToLocation(const GeoCoordinate &coordinates);
167 * @brief Signal for route waypoint item clicked.
169 * @param coordinate waypoint item's coordinate
171 void routeWaypointItemClicked(const GeoCoordinate &coordinate);
174 * @brief Signal is emitted when search history item is clicked.
176 * @param searchString search string used
178 void searchHistoryItemClicked(const QString &searchString);
180 /*******************************************************************************
182 ******************************************************************************/
184 QLabel *m_noSearchLabel; ///< Text label for empty panel
185 QLabel *m_resultsLabel; ///< Location list label
187 ImageButton *m_clearLocationListButton; ///< Clear location list button
188 ImageButton *m_routeButton; ///< Route to location button
189 SearchHistoryListView *m_searchHistoryListView; ///< Search history list view
190 LocationListView *m_locationListView; ///< Search results list view
193 #endif // LOCATIONSEARCHPANEL_H