]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/main_interface.hpp
Qt4: control aout through playlist
[vlc] / modules / gui / qt4 / main_interface.hpp
index 748d33ca20c3cc9dd1919f2ea3f224005850ca0f..4ea7ba3092fd2547c44017566f03e7e784bdfa70 100644 (file)
@@ -22,8 +22,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef _MAIN_INTERFACE_H_
-#define _MAIN_INTERFACE_H_
+#ifndef QVLC_MAIN_INTERFACE_H_
+#define QVLC_MAIN_INTERFACE_H_
 
 #include "qt4.hpp"
 
@@ -51,9 +51,9 @@ class QMenu;
 class QSize;
 
 enum {
-    CONTROLS_HIDDEN = 0x0,
     CONTROLS_VISIBLE = 0x1,
-    CONTROLS_ADVANCED = 0x2
+    CONTROLS_HIDDEN = 0x2,
+    CONTROLS_ADVANCED = 0x4,
 };
 
 typedef enum pl_dock_e {
@@ -67,7 +67,6 @@ class MainInterface : public QVLCMW
 {
     Q_OBJECT;
 
-    friend class InteractionDialog;
     friend class PlaylistWidget;
 
 public:
@@ -75,11 +74,11 @@ public:
     virtual ~MainInterface();
 
     /* Video requests from core */
-    void *requestVideo( vout_thread_t *p_nvout, int *pi_x,
-                        int *pi_y, unsigned int *pi_width,
-                        unsigned int *pi_height );
+    WId requestVideo( vout_thread_t *p_nvout, int *pi_x,
+                      int *pi_y, unsigned int *pi_width,
+                      unsigned int *pi_height );
     void releaseVideo( void  );
-    int controlVideo( void *p_window, int i_query, va_list args );
+    int controlVideo( int i_query, va_list args );
 
     /* Getters */
     QSystemTrayIcon *getSysTray() { return sysTray; };
@@ -90,13 +89,16 @@ public:
     virtual QSize sizeHint() const;
 
 protected:
-//    void resizeEvent( QResizeEvent * );
-    void dropEvent( QDropEvent *);
     void dropEventPlay( QDropEvent *, bool);
-    void dragEnterEvent( QDragEnterEvent * );
-    void dragMoveEvent( QDragMoveEvent * );
-    void dragLeaveEvent( QDragLeaveEvent * );
-    void closeEvent( QCloseEvent *);
+    virtual void dropEvent( QDropEvent *);
+    virtual void dragEnterEvent( QDragEnterEvent * );
+    virtual void dragMoveEvent( QDragMoveEvent * );
+    virtual void dragLeaveEvent( QDragLeaveEvent * );
+    virtual void closeEvent( QCloseEvent *);
+    virtual void customEvent( QEvent *);
+    virtual void keyPressEvent( QKeyEvent *);
+    virtual void wheelEvent( QWheelEvent * );
+    virtual void resizeEvent( QResizeEvent * event );
 
 private:
     QSettings           *settings;
@@ -108,7 +110,9 @@ private:
     InputControlsWidget *inputC;
     FullscreenControllerWidget *fullscreenControls;
 
-    void handleMainUi( QSettings* );
+    void createMainWidget( QSettings* );
+    void createStatusBar();
+
     void askForPrivacy();
     int  privacyDialog( QList<ConfigControl *> *controls );
 
@@ -117,7 +121,6 @@ private:
     void createSystray();
     void initSystray();
 
-    void createStatusBar();
 
     /* Video */
     VideoWidget         *videoWidget;
@@ -132,34 +135,37 @@ private:
     bool                 visualSelectorEnabled;
     bool                 notificationEnabled; /// Systray Notifications
     bool                 bgWasVisible;
+    bool                 b_keep_size;         ///< persistent resizeable window
+    QSize                mainBasedSize;       ///< based Wnd (normal mode only)
+    QSize                mainVideoSize;       ///< Wnd with video (all modes)
     int                  i_visualmode;        ///< Visual Mode
     pl_dock_e            i_pl_dock;
     bool                 isDocked() { return ( i_pl_dock != PL_UNDOCKED ); }
-
-    input_thread_t      *p_input;    ///< Main input associated to the playlist
+    int                  i_bg_height;         ///< Save height of bgWidget
+    bool                 b_shouldHide;
 
     /* Status Bar */
     QLabel              *nameLabel;
-
-    virtual void customEvent( QEvent *);
-    virtual void keyPressEvent( QKeyEvent *);
-    virtual void wheelEvent( QWheelEvent * );
+    QLabel              *cryptedLabel;
 
 public slots:
     void undockPlaylist();
     void dockPlaylist( pl_dock_e i_pos = PL_BOTTOM );
-    void toggleMinimalView();
+    void toggleMinimalView( bool );
     void togglePlaylist();
     void toggleUpdateSystrayMenu();
     void toggleAdvanced();
     void toggleFullScreen();
     void toggleFSC();
+    void popupMenu( const QPoint& );
 
     /* Manage the Video Functions from the vout threads */
     void releaseVideoSlot( void );
 
 private slots:
     void debug();
+    void destroyPopupMenu();
+    void recreateToolbars();
     void doComponentsUpdate();
     void setName( QString );
     void setVLCWindowsTitle( QString title = "" );
@@ -169,13 +175,16 @@ private slots:
     void handleSystrayClick( QSystemTrayIcon::ActivationReason );
     void updateSystrayTooltipName( QString );
     void updateSystrayTooltipStatus( int );
-    void updateRecentsMenu();
+
+    void showCryptedLabel( bool );
 signals:
     void askReleaseVideo( );
     void askVideoToResize( unsigned int, unsigned int );
-    void askVideoToToggle();
+    void askVideoToShow( unsigned int, unsigned int );
     void askBgWidgetToToggle();
     void askUpdate();
+    void minimalViewToggled( bool );
+    void fullscreenInterfaceToggled( bool );
 };
 
 #endif