00001 /* 00002 Situare - A location system for Facebook 00003 Copyright (C) 2010 Ixonos Plc. Authors: 00004 00005 Jussi Laitinen - jussi.laitinen@ixonos.com 00006 Sami Rämö - sami.ramo@ixonos.com 00007 00008 Situare is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 version 2 as published by the Free Software Foundation. 00011 00012 Situare is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with Situare; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 00020 USA. 00021 */ 00022 00023 #ifndef LOCATIONSEARCHPANEL_H 00024 #define LOCATIONSEARCHPANEL_H 00025 00026 #include <QtGui> 00027 00028 #include "panelbase.h" 00029 00030 class ExtendedListItemDelegate; 00031 class GeoCoordinate; 00032 class ImageButton; 00033 class Location; 00034 class LocationListView; 00035 class SearchHistoryListView; 00036 00043 class LocationSearchPanel : public PanelBase 00044 { 00045 Q_OBJECT 00046 00047 public: 00053 LocationSearchPanel(QWidget *parent = 0); 00054 00060 ~LocationSearchPanel(); 00061 00062 /******************************************************************************* 00063 * BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS 00064 ******************************************************************************/ 00065 protected: 00073 void hideEvent(QHideEvent *event); 00074 00075 /******************************************************************************* 00076 * MEMBER FUNCTIONS AND SLOTS 00077 ******************************************************************************/ 00078 private: 00082 void readSettings(); 00083 00089 void setHeaderText(int count); 00090 00091 private slots: 00100 void prependSearchHistory(QString searchString, QDateTime dateTime = QDateTime()); 00101 00107 void clearListsSelections(); 00108 00114 void showLocationListView(int locationItemsCount); 00115 00119 void showSearchHistoryListView(); 00120 00126 void populateLocationListView(const QList<Location> &locations); 00127 00133 void routeToSelectedLocation(); 00134 00140 void setRouteButtonDisabled(); 00141 00142 /******************************************************************************* 00143 * SIGNALS 00144 ******************************************************************************/ 00145 signals: 00152 void locationItemClicked(const GeoCoordinate &swBound, const GeoCoordinate &neBound); 00153 00157 void requestSearchLocation(); 00158 00164 void routeToLocation(const GeoCoordinate &coordinates); 00165 00171 void routeWaypointItemClicked(const GeoCoordinate &coordinate); 00172 00178 void searchHistoryItemClicked(const QString &searchString); 00179 00180 /******************************************************************************* 00181 * DATA MEMBERS 00182 ******************************************************************************/ 00183 private: 00184 QLabel *m_resultsLabel; 00185 00186 ImageButton *m_clearLocationListButton; 00187 ImageButton *m_routeButton; 00188 SearchHistoryListView *m_searchHistoryListView; 00189 LocationListView *m_locationListView; 00190 }; 00191 00192 #endif // LOCATIONSEARCHPANEL_H