Edric Milaret | 029b95a | 2015-06-09 09:51:44 -0400 | [diff] [blame] | 1 | /*************************************************************************** |
Edric Milaret | 5f316da | 2015-09-28 11:57:42 -0400 | [diff] [blame] | 2 | * Copyright (C) 2015 by Savoir-faire Linux * |
Edric Milaret | 029b95a | 2015-06-09 09:51:44 -0400 | [diff] [blame] | 3 | * 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 Milaret | 5f316da | 2015-09-28 11:57:42 -0400 | [diff] [blame] | 19 | #pragma once |
Edric Milaret | 029b95a | 2015-06-09 09:51:44 -0400 | [diff] [blame] | 20 | |
| 21 | #include <QWidget> |
| 22 | #include <QTimer> |
| 23 | #include <QMouseEvent> |
| 24 | #include <QPropertyAnimation> |
| 25 | |
| 26 | #include "videooverlay.h" |
| 27 | |
| 28 | namespace Ui { |
| 29 | class VideoView; |
| 30 | } |
| 31 | |
| 32 | class VideoView : public QWidget |
| 33 | { |
| 34 | Q_OBJECT |
| 35 | |
| 36 | public: |
| 37 | explicit VideoView(QWidget *parent = 0); |
| 38 | ~VideoView(); |
| 39 | |
| 40 | protected: |
| 41 | void resizeEvent(QResizeEvent* event); |
| 42 | void enterEvent(QEvent* event); |
| 43 | void leaveEvent(QEvent* event); |
| 44 | void mouseDoubleClickEvent(QMouseEvent *e); |
Edric Milaret | 303bbf1 | 2015-06-22 14:24:13 -0400 | [diff] [blame] | 45 | void dragEnterEvent(QDragEnterEvent *event); |
| 46 | void dropEvent(QDropEvent *event); |
Edric Milaret | 029b95a | 2015-06-09 09:51:44 -0400 | [diff] [blame] | 47 | |
| 48 | private slots: |
| 49 | void callStateChanged(Call *call, Call::State previousState); |
| 50 | void updateTimer(); |
| 51 | void showContextMenu(const QPoint &pos); |
| 52 | |
| 53 | private: |
| 54 | Ui::VideoView *ui; |
| 55 | QTimer* timerLength_; |
| 56 | VideoOverlay* overlay_; |
| 57 | constexpr static int fadeOverlayTime_ = 2000; //msec |
| 58 | QPropertyAnimation* fadeAnim_; |
| 59 | QWidget *oldParent_; |
| 60 | QSize oldSize_; |
| 61 | private: |
| 62 | void toggleFullScreen(); |
Edric Milaret | 3aca8e3 | 2015-06-12 10:01:40 -0400 | [diff] [blame] | 63 | signals: |
| 64 | void setChatVisibility(bool visible); |
Edric Milaret | 029b95a | 2015-06-09 09:51:44 -0400 | [diff] [blame] | 65 | }; |
| 66 | |