]> git.sur5r.net Git - minitube/blob - src/SearchView.h
Imported Upstream version 1.9
[minitube] / src / SearchView.h
1 #ifndef __SEARCHVIEW_H__
2 #define __SEARCHVIEW_H__
3
4 #include <QtGui>
5 #include "View.h"
6
7 class SearchLineEdit;
8 class SearchParams;
9 class YouTubeSuggest;
10 class ChannelSuggest;
11
12 class SearchView : public QWidget, public View {
13
14     Q_OBJECT
15
16 public:
17     SearchView(QWidget *parent);
18     void updateRecentKeywords();
19     void updateRecentChannels();
20     void appear();
21     void disappear() {}
22
23     QMap<QString, QVariant> metadata() {
24         QMap<QString, QVariant> metadata;
25         metadata.insert("title", "");
26         metadata.insert("description", tr("Make yourself comfortable"));
27         return metadata;
28     }
29
30 public slots:
31     void watch(QString query);
32     void watchChannel(QString channel);
33     void watchKeywords(QString query);
34
35 signals:
36     void search(SearchParams*);
37
38 protected:
39     void paintEvent(QPaintEvent *);
40
41 private slots:
42     void watch();
43     void textChanged(const QString &text);
44     void searchTypeChanged(int index);
45
46 private:
47     YouTubeSuggest *youtubeSuggest;
48     ChannelSuggest *channelSuggest;
49
50     QComboBox *typeCombo;
51     SearchLineEdit *queryEdit;
52     QLabel *recentKeywordsLabel;
53     QBoxLayout *recentKeywordsLayout;
54     QLabel *recentChannelsLabel;
55     QBoxLayout *recentChannelsLayout;
56     QLabel *message;
57     QPushButton *watchButton;
58
59 };
60
61 #endif // __SEARCHVIEW_H__