#define __SEARCHVIEW_H__
#include <QtGui>
+#if QT_VERSION >= 0x050000
+#include <QtWidgets>
+#endif
#include "view.h"
-class SearchLineEdit;
+class SearchWidget;
class SearchParams;
class YTSuggester;
class ChannelSuggest;
+class Suggestion;
-class SearchView : public QWidget, public View {
+class SearchView : public View {
Q_OBJECT
public slots:
void appear();
- void disappear() { }
- void watch(QString query);
- void watchChannel(QString channel);
- void watchKeywords(QString query);
+ void disappear();
+ void watch(const QString &query);
+ void watchChannel(const QString &channelId);
+ void watchKeywords(const QString &query);
signals:
void search(SearchParams*);
void watch();
void textChanged(const QString &text);
void searchTypeChanged(int index);
+ void suggestionAccepted(Suggestion *suggestion);
private:
YTSuggester *youtubeSuggest;
ChannelSuggest *channelSuggest;
QComboBox *typeCombo;
- SearchLineEdit *queryEdit;
+ SearchWidget *queryEdit;
QLabel *recentKeywordsLabel;
QBoxLayout *recentKeywordsLayout;
QLabel *recentChannelsLabel;
QLabel *message;
QPushButton *watchButton;
+ QStringList recentKeywords;
+ QStringList recentChannels;
};
#endif // __SEARCHVIEW_H__