src/3rdparty/phonon/mmf/videooutput.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    22 #include <QtGui/QWidget>
    22 #include <QtGui/QWidget>
    23 #include <QVector>
    23 #include <QVector>
    24 #include <QRect>
    24 #include <QRect>
    25 #include "defs.h"
    25 #include "defs.h"
    26 
    26 
       
    27 #include <Phonon/VideoWidget>
       
    28 
       
    29 #include <e32std.h>
       
    30 class RWindowBase;
       
    31 
    27 QT_BEGIN_NAMESPACE
    32 QT_BEGIN_NAMESPACE
    28 
    33 
    29 namespace Phonon
    34 namespace Phonon
    30 {
    35 {
    31 namespace MMF
    36 namespace MMF
    32 {
    37 {
    33 class VideoOutputObserver;
    38 class AncestorMoveMonitor;
    34 
    39 
    35 class VideoOutput       :   public QWidget
    40 class VideoOutput       :   public QWidget
    36 {
    41 {
    37     Q_OBJECT
    42     Q_OBJECT
    38 
    43 
    39 public:
    44 public:
    40     explicit VideoOutput(QWidget* parent);
    45     VideoOutput(AncestorMoveMonitor* ancestorMoveMonitor, QWidget* parent);
    41     ~VideoOutput();
    46     ~VideoOutput();
    42 
    47 
    43     void setFrameSize(const QSize& size);
    48     // Set size of video frame.  Called by VideoPlayer.
    44     void setObserver(VideoOutputObserver* observer);
    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();
    45 
    76 
    46 protected:
    77 protected:
    47     // Override QWidget functions
    78     // Override QWidget functions
    48     QSize sizeHint() const;
    79     QSize sizeHint() const;
    49     void paintEvent(QPaintEvent* event);
    80     void paintEvent(QPaintEvent* event);
    50     void resizeEvent(QResizeEvent* event);
    81     void resizeEvent(QResizeEvent* event);
    51     void moveEvent(QMoveEvent* event);
    82     void moveEvent(QMoveEvent* event);
    52     bool event(QEvent* event);
    83     bool event(QEvent* event);
    53 
    84 
    54 private:
    85 private:
    55     void dump() const;
    86     void getVideoWindowRect();
    56     void videoOutputRegionChanged();
    87     void registerForAncestorMoved();
    57 
    88 
    58 private:
    89 private:
    59     QSize m_frameSize;
    90     // Not owned
       
    91     AncestorMoveMonitor*    m_ancestorMoveMonitor;
    60 
    92 
    61     // Not owned
    93     QSize                   m_videoFrameSize;
    62     VideoOutputObserver* m_observer;
    94     QRect                   m_videoWindowRect;
       
    95 
       
    96     Phonon::VideoWidget::AspectRatio        m_aspectRatio;
       
    97     Phonon::VideoWidget::ScaleMode          m_scaleMode;
       
    98 
    63 };
    99 };
    64 }
   100 }
    65 }
   101 }
    66 
   102 
    67 QT_END_NAMESPACE
   103 QT_END_NAMESPACE