blob: 4e535ef7904217c209ecb910457865d311c85aae [file] [log] [blame]
Edric Milaret029b95a2015-06-09 09:51:44 -04001/***************************************************************************
Edric Milaret5f316da2015-09-28 11:57:42 -04002 * Copyright (C) 2015 by Savoir-faire Linux *
Edric Milaret029b95a2015-06-09 09:51:44 -04003 * Author: Edric Ladent Milaret <edric.ladent-milaret@savoirfairelinux.com>*
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 3 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 **************************************************************************/
18
Edric Milaret5f316da2015-09-28 11:57:42 -040019#pragma once
Edric Milaret029b95a2015-06-09 09:51:44 -040020
21#include <QWidget>
22#include <QTimer>
23#include <QMouseEvent>
24#include <QPropertyAnimation>
25
26#include "videooverlay.h"
27
28namespace Ui {
29class VideoView;
30}
31
32class VideoView : public QWidget
33{
34 Q_OBJECT
35
36public:
37 explicit VideoView(QWidget *parent = 0);
38 ~VideoView();
39
40protected:
41 void resizeEvent(QResizeEvent* event);
42 void enterEvent(QEvent* event);
43 void leaveEvent(QEvent* event);
44 void mouseDoubleClickEvent(QMouseEvent *e);
Edric Milaret303bbf12015-06-22 14:24:13 -040045 void dragEnterEvent(QDragEnterEvent *event);
46 void dropEvent(QDropEvent *event);
Edric Milaret029b95a2015-06-09 09:51:44 -040047
48private slots:
49 void callStateChanged(Call *call, Call::State previousState);
Edric Milareted0b2802015-10-01 15:10:02 -040050 void updateCall();
Edric Milaret029b95a2015-06-09 09:51:44 -040051 void showContextMenu(const QPoint &pos);
52
53private:
54 Ui::VideoView *ui;
Edric Milaret029b95a2015-06-09 09:51:44 -040055 VideoOverlay* overlay_;
56 constexpr static int fadeOverlayTime_ = 2000; //msec
57 QPropertyAnimation* fadeAnim_;
58 QWidget *oldParent_;
59 QSize oldSize_;
Edric Milareted0b2802015-10-01 15:10:02 -040060 QMetaObject::Connection timerConnection_;
Edric Milaret029b95a2015-06-09 09:51:44 -040061private:
62 void toggleFullScreen();
Edric Milaret3aca8e32015-06-12 10:01:40 -040063signals:
64 void setChatVisibility(bool visible);
Edric Milaret029b95a2015-06-09 09:51:44 -040065};
66