class ImageButton;
class Location;
class LocationListView;
+class SearchHistoryListView;
/**
* @brief Location search panel
*/
LocationSearchPanel(QWidget *parent = 0);
+ /**
+ * @brief Destructor
+ *
+ * Writes search history to settings.
+ */
+ ~LocationSearchPanel();
+
/*******************************************************************************
* BASE CLASS INHERITED AND REIMPLEMENTED MEMBER FUNCTIONS
******************************************************************************/
******************************************************************************/
private:
/**
+ * @brief Reads search history from settings.
+ */
+ void readSettings();
+
+ /**
* @brief Set text for header
*
* @param count Search result count
private slots:
/**
+ * @brief Prepends search history list view with search.
+ *
+ * If search history limit is reached, oldest search is removed from list view.
+ *
+ * @param searchString search string to add
+ * @param dateTime date and time of search (if empty, current date and time is added)
+ */
+ void prependSearchHistory(QString searchString, QDateTime dateTime = QDateTime());
+
+ /**
* @brief Clears lists' selections.
*
* Does call setRouteButtonDisabled().
void clearListsSelections();
/**
+ * @brief Shows location list view.
+ *
+ * @param locationItemsCount location items count
+ */
+ void showLocationListView(int locationItemsCount);
+
+ /**
+ * @brief Shows search history list view.
+ */
+ void showSearchHistoryListView();
+
+ /**
* @brief Populates location list view.
*
* @param locations list of Location objects
*/
void routeWaypointItemClicked(const GeoCoordinate &coordinate);
+ /**
+ * @brief Signal is emitted when search history item is clicked.
+ *
+ * @param searchString search string used
+ */
+ void searchHistoryItemClicked(const QString &searchString);
+
/*******************************************************************************
* DATA MEMBERS
******************************************************************************/
private:
- QLabel *m_resultsLabel; ///< Location list label
+ QLabel *m_resultsLabel; ///< Location list label
- ImageButton *m_routeButton; ///< Route to location button
- LocationListView *m_locationListView; ///< Search results list view
+ ImageButton *m_clearLocationListButton; ///< Clear location list button
+ ImageButton *m_routeButton; ///< Route to location button
+ SearchHistoryListView *m_searchHistoryListView; ///< Search history list view
+ LocationListView *m_locationListView; ///< Search results list view
};
#endif // LOCATIONSEARCHPANEL_H