]> git.sur5r.net Git - minitube/blob - src/searchview.h
9cefc717ec05643fca2bba1646aa53bd57778383
[minitube] / src / searchview.h
1 /* $BEGIN_LICENSE
2
3 This file is part of Minitube.
4 Copyright 2009, Flavio Tordini <flavio.tordini@gmail.com>
5
6 Minitube is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 Minitube is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with Minitube.  If not, see <http://www.gnu.org/licenses/>.
18
19 $END_LICENSE */
20
21 #ifndef __SEARCHVIEW_H__
22 #define __SEARCHVIEW_H__
23
24 #include <QtGui>
25 #include "view.h"
26
27 class SearchLineEdit;
28 class SearchParams;
29 class YTSuggester;
30 class ChannelSuggest;
31
32 class SearchView : public QWidget, public View {
33
34     Q_OBJECT
35
36 public:
37     SearchView(QWidget *parent = 0);
38     void updateRecentKeywords();
39     void updateRecentChannels();
40
41 public slots:
42     void appear();
43     void disappear() { }
44     void watch(QString query);
45     void watchChannel(QString channel);
46     void watchKeywords(QString query);
47
48 signals:
49     void search(SearchParams*);
50
51 protected:
52     void paintEvent(QPaintEvent *);
53
54 private slots:
55     void watch();
56     void textChanged(const QString &text);
57     void searchTypeChanged(int index);
58
59 private:
60     YTSuggester *youtubeSuggest;
61     ChannelSuggest *channelSuggest;
62
63     QComboBox *typeCombo;
64     SearchLineEdit *queryEdit;
65     QLabel *recentKeywordsLabel;
66     QBoxLayout *recentKeywordsLayout;
67     QLabel *recentChannelsLabel;
68     QBoxLayout *recentChannelsLayout;
69     QLabel *message;
70     QPushButton *watchButton;
71
72 };
73
74 #endif // __SEARCHVIEW_H__