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 Shows search history list.
112 void showSearchHistoryList();
115 * @brief Populates location list view.
117 * @param locations list of Location objects
119 void populateLocationListView(const QList<Location> &locations);
122 * @brief Routes to selected location.
124 * Emits routeToLocation if location is selected from list.
126 void routeToSelectedLocation();
129 * @brief Sets route button disabled.
131 * Disabled if there isn't any list item selected.
133 void setRouteButtonDisabled();
135 /*******************************************************************************
137 ******************************************************************************/
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 is emitted when search history item is clicked.
169 * @param searchString search string used
171 void searchHistoryItemClicked(const QString &searchString);
173 /*******************************************************************************
175 ******************************************************************************/
177 QLabel *m_resultsLabel; ///< Location list label
179 ImageButton *m_clearLocationListButton; ///< Clear location list button
180 ImageButton *m_routeButton; ///< Route to location button
181 SearchHistoryListView *m_searchHistoryListView; ///< Search history list view
182 LocationListView *m_locationListView; ///< Search results list view
185 #endif // LOCATIONSEARCHPANEL_H