]> git.sur5r.net Git - minitube/blob - src/videoareawidget.h
Update watch file to use releases instead of tags
[minitube] / src / videoareawidget.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 VIDEOAREAWIDGET_H
22 #define VIDEOAREAWIDGET_H
23
24 #include <QtWidgets>
25
26 class Video;
27 class LoadingWidget;
28 class PlaylistModel;
29 class SnapshotPreview;
30
31 class VideoAreaWidget : public QWidget {
32
33     Q_OBJECT
34
35 public:
36     VideoAreaWidget(QWidget *parent = 0);
37     void setVideoWidget(QWidget *videoWidget);
38     void setLoadingWidget(LoadingWidget *loadingWidget);
39     void showLoading(Video* video);
40     void showVideo();
41     void showError(const QString &message);
42     void showPickMessage();
43     void clear();
44     void setListModel(PlaylistModel *listModel) {
45         this->listModel = listModel;
46     }
47 #ifdef APP_SNAPSHOT
48     void showSnapshotPreview(const QPixmap &pixmap);
49 #endif
50     bool isVideoShown() { return stackedLayout->currentWidget() == videoWidget; }
51
52 signals:
53     void doubleClicked();
54     void rightClicked();
55
56 protected:
57     void mouseDoubleClickEvent(QMouseEvent *event);
58     void dragEnterEvent(QDragEnterEvent *event);
59     void dropEvent(QDropEvent *event);
60
61 private slots:
62     void showContextMenu(const QPoint &point);
63 #ifdef APP_SNAPSHOT
64     void hideSnapshotPreview();
65 #endif
66
67 private:
68     QStackedLayout *stackedLayout;
69     QWidget *videoWidget;
70     LoadingWidget *loadingWidget;
71
72 #ifdef APP_SNAPSHOT
73     SnapshotPreview *snapshotPreview;
74 #endif
75
76     PlaylistModel *listModel;
77     QLabel *messageLabel;
78
79     QWidget *messageWidget;
80
81     QPoint dragPosition;
82 };
83
84 #endif // VIDEOAREAWIDGET_H