2011-04-06 Alexis Menard <alexis.menard@openbossa.org>
[WebKit-https.git] / Source / WebKit / qt / WebCoreSupport / FullScreenVideoQt.h
index 637da70a27c98ee6a9c714f48a57e436b45d20a9..fda153d07e25939cea9d8c8a0df2b4ee298318e3 100644 (file)
 #ifndef FullScreenVideoQt_h
 #define FullScreenVideoQt_h
 
+#include "qwebkitplatformplugin.h"
 #include <QObject>
+#include <wtf/Platform.h>
 
 QT_BEGIN_NAMESPACE
 class QGraphicsVideoItem;
+class QMediaPlayer;
 QT_END_NAMESPACE
 
-class QWebFullScreenVideoHandler;
-
 namespace WebCore {
 
 class ChromeClientQt;
+class FullScreenVideoWidget;
 class HTMLVideoElement;
 class Node;
+#if USE(QT_MULTIMEDIA)
 class MediaPlayerPrivateQt;
+#endif
+
+// We do not use ENABLE or USE because moc does not expand these macros.
+#if defined(WTF_USE_GSTREAMER) && WTF_USE_GSTREAMER
+class FullScreenVideoWindow;
+
+class GStreamerFullScreenVideoHandler : public QObject {
+    Q_OBJECT
+public:
+    GStreamerFullScreenVideoHandler();
+    ~GStreamerFullScreenVideoHandler() { }
+    void setVideoElement(HTMLVideoElement*);
+
+    void enterFullScreen();
+    void exitFullScreen();
+
+public Q_SLOTS:
+    void windowClosed();
+
+private:
+    HTMLVideoElement* m_videoElement;
+    FullScreenVideoWindow* m_fullScreenWidget;
+};
+#endif
+
+// We do not use ENABLE or USE because moc does not expand these macros.
+#if defined(WTF_USE_QT_MULTIMEDIA) && WTF_USE_QT_MULTIMEDIA
+class DefaultFullScreenVideoHandler : public QWebFullScreenVideoHandler {
+    Q_OBJECT
+public:
+    DefaultFullScreenVideoHandler();
+    virtual ~DefaultFullScreenVideoHandler();
+    bool requiresFullScreenForVideoPlayback() const;
+
+public Q_SLOTS:
+    void enterFullScreen(QMediaPlayer*);
+    void exitFullScreen();
+
+private:
+    static bool s_shouldForceFullScreenVideoPlayback;
+    FullScreenVideoWidget *m_fullScreenWidget;
+};
+#endif
 
 class FullScreenVideoQt : public QObject {
     Q_OBJECT
@@ -44,11 +90,12 @@ public:
     virtual void enterFullScreenForNode(Node*);
     virtual void exitFullScreenForNode(Node*);
     bool requiresFullScreenForVideoPlayback();
-    bool isValid() const {  return m_FullScreenVideoHandler; }
+    bool isValid() const;
 
 private:
+#if USE(QT_MULTIMEDIA)
     MediaPlayerPrivateQt* mediaPlayer();
-    MediaPlayerPrivateQt* mediaPlayerForNode(Node* = 0);
+#endif
 
 private slots:
     void aboutToClose();
@@ -56,9 +103,14 @@ private slots:
 private:
     ChromeClientQt* m_chromeClient;
     HTMLVideoElement* m_videoElement;
+#if USE(QT_MULTIMEDIA)
     QWebFullScreenVideoHandler* m_FullScreenVideoHandler;
+#endif
+#if USE(GSTREAMER)
+    GStreamerFullScreenVideoHandler* m_FullScreenVideoHandlerGStreamer;
+#endif
 };
 
 }
 
-#endif // PopupMenuQt_h
+#endif // FullScreenVideoQt_h