| 1 | /* This file is part of the KDE project.
|
|---|
| 2 |
|
|---|
| 3 | Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 |
|
|---|
| 5 | This library is free software: you can redistribute it and/or modify
|
|---|
| 6 | it under the terms of the GNU Lesser General Public License as published by
|
|---|
| 7 | the Free Software Foundation, either version 2.1 or 3 of the License.
|
|---|
| 8 |
|
|---|
| 9 | This library is distributed in the hope that it will be useful,
|
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | GNU Lesser General Public License for more details.
|
|---|
| 13 |
|
|---|
| 14 | You should have received a copy of the GNU Lesser General Public License
|
|---|
| 15 | along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 16 |
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | #ifndef PHONON_MMF_VIDEOOUTPUT_H
|
|---|
| 20 | #define PHONON_MMF_VIDEOOUTPUT_H
|
|---|
| 21 |
|
|---|
| 22 | #include <QtGui/QWidget>
|
|---|
| 23 | #include <QVector>
|
|---|
| 24 | #include <QRect>
|
|---|
| 25 | #include "defs.h"
|
|---|
| 26 |
|
|---|
| 27 | #include <phonon/videowidget.h>
|
|---|
| 28 |
|
|---|
| 29 | #include <e32std.h>
|
|---|
| 30 | class RWindowBase;
|
|---|
| 31 |
|
|---|
| 32 | QT_BEGIN_NAMESPACE
|
|---|
| 33 |
|
|---|
| 34 | namespace Phonon
|
|---|
| 35 | {
|
|---|
| 36 | namespace MMF
|
|---|
| 37 | {
|
|---|
| 38 | class AncestorMoveMonitor;
|
|---|
| 39 |
|
|---|
| 40 | class VideoOutput : public QWidget
|
|---|
| 41 | {
|
|---|
| 42 | Q_OBJECT
|
|---|
| 43 |
|
|---|
| 44 | public:
|
|---|
| 45 | VideoOutput(AncestorMoveMonitor* ancestorMoveMonitor, QWidget* parent);
|
|---|
| 46 | ~VideoOutput();
|
|---|
| 47 |
|
|---|
| 48 | // Set size of video frame. Called by VideoPlayer.
|
|---|
| 49 | void setVideoSize(const QSize& size);
|
|---|
| 50 |
|
|---|
| 51 | RWindowBase* videoWindow();
|
|---|
| 52 | const QRect& videoWindowRect() const;
|
|---|
| 53 |
|
|---|
| 54 | Phonon::VideoWidget::AspectRatio aspectRatio() const;
|
|---|
| 55 | void setAspectRatio(Phonon::VideoWidget::AspectRatio aspectRatio);
|
|---|
| 56 |
|
|---|
| 57 | Phonon::VideoWidget::ScaleMode scaleMode() const;
|
|---|
| 58 | void setScaleMode(Phonon::VideoWidget::ScaleMode scaleMode);
|
|---|
| 59 |
|
|---|
| 60 | // Called by AncestorMoveMonitor
|
|---|
| 61 | void ancestorMoved();
|
|---|
| 62 |
|
|---|
| 63 | // Debugging output
|
|---|
| 64 | void dump() const;
|
|---|
| 65 |
|
|---|
| 66 | public Q_SLOTS:
|
|---|
| 67 | void beginNativePaintEvent(const QRect& /*controlRect*/);
|
|---|
| 68 | void endNativePaintEvent(const QRect& /*controlRect*/);
|
|---|
| 69 |
|
|---|
| 70 | Q_SIGNALS:
|
|---|
| 71 | void videoWindowChanged();
|
|---|
| 72 | void aspectRatioChanged();
|
|---|
| 73 | void scaleModeChanged();
|
|---|
| 74 | void beginVideoWindowNativePaint();
|
|---|
| 75 | void endVideoWindowNativePaint();
|
|---|
| 76 |
|
|---|
| 77 | protected:
|
|---|
| 78 | // Override QWidget functions
|
|---|
| 79 | QSize sizeHint() const;
|
|---|
| 80 | void paintEvent(QPaintEvent* event);
|
|---|
| 81 | void resizeEvent(QResizeEvent* event);
|
|---|
| 82 | void moveEvent(QMoveEvent* event);
|
|---|
| 83 | bool event(QEvent* event);
|
|---|
| 84 |
|
|---|
| 85 | private:
|
|---|
| 86 | void getVideoWindowRect();
|
|---|
| 87 | void registerForAncestorMoved();
|
|---|
| 88 |
|
|---|
| 89 | private:
|
|---|
| 90 | // Not owned
|
|---|
| 91 | AncestorMoveMonitor* m_ancestorMoveMonitor;
|
|---|
| 92 |
|
|---|
| 93 | QSize m_videoFrameSize;
|
|---|
| 94 | QRect m_videoWindowRect;
|
|---|
| 95 |
|
|---|
| 96 | Phonon::VideoWidget::AspectRatio m_aspectRatio;
|
|---|
| 97 | Phonon::VideoWidget::ScaleMode m_scaleMode;
|
|---|
| 98 |
|
|---|
| 99 | };
|
|---|
| 100 | }
|
|---|
| 101 | }
|
|---|
| 102 |
|
|---|
| 103 | QT_END_NAMESPACE
|
|---|
| 104 |
|
|---|
| 105 | #endif
|
|---|