2011-01-17 Yi Shen <yi.4.shen@nokia.com>
[WebKit-https.git] / Source / WebKit / qt / examples / platformplugin / WebPlugin.h
index 0243f57..4994669 100644 (file)
@@ -24,6 +24,9 @@
 #include "WebNotificationPresenter.h"
 
 #include <QDialog>
+#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
+#include <QVideoWidget>
+#endif
 
 class QListWidgetItem;
 class QListWidget;
@@ -94,6 +97,40 @@ public:
     }
 };
 
+#if defined(ENABLE_QT_MULTIMEDIA) && ENABLE_QT_MULTIMEDIA
+class FullScreenVideoWidget : public QVideoWidget {
+    Q_OBJECT
+public:
+    FullScreenVideoWidget(QMediaPlayer*);
+    virtual ~FullScreenVideoWidget() {}
+
+Q_SIGNALS:
+    void fullScreenClosed();
+
+protected:
+    bool event(QEvent*);
+    void keyPressEvent(QKeyEvent*);
+
+private:
+    QMediaPlayer* m_mediaPlayer; // not owned
+};
+
+class FullScreenVideoHandler : public QWebFullScreenVideoHandler {
+    Q_OBJECT
+public:
+    FullScreenVideoHandler();
+    virtual ~FullScreenVideoHandler();
+    bool requiresFullScreenForVideoPlayback() const;
+
+public Q_SLOTS:
+    void enterFullScreen(QMediaPlayer*);
+    void exitFullScreen();
+
+private:
+    FullScreenVideoWidget* m_mediaWidget; // owned
+};
+#endif
+
 class WebPlugin : public QObject, public QWebKitPlatformPlugin
 {
     Q_OBJECT