]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs_provider.hpp
Qt: cosmetics
[vlc] / modules / gui / qt4 / dialogs_provider.hpp
index 3c90b8b436dc580eb8e88b4d2aafac8315184af4..279f83bdcdebd0db7282ec79f0eaa86c40a7e204 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * dialogs_provider.hpp : Dialogs provider
  ****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
+ * Copyright (C) 2006-2008 the VideoLAN team
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef _DIALOGS_PROVIDER_H_
-#define _DIALOGS_PROVIDER_H_
+#ifndef QVLC_DIALOGS_PROVIDER_H_
+#define QVLC_DIALOGS_PROVIDER_H_
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
 #include <assert.h>
-#include <vlc/vlc.h>
-#include <vlc_interface.h>
 
-#include "dialogs/interaction.hpp"
+#include "qt4.hpp"
 
+#include "dialogs/open.hpp"
 #include <QObject>
-#include <QTimer>
-#include <QApplication>
+#include <QStringList>
 
 #define ADD_FILTER_MEDIA( string )     \
     string += qtr( "Media Files" );    \
@@ -62,7 +64,7 @@
     string += ");;";
 #define ADD_FILTER_ALL( string )       \
     string += qtr( "All Files" );      \
-    string += " (*.*)";
+    string += " (*)";
 
 enum {
     EXT_FILTER_MEDIA     =  0x01,
@@ -73,19 +75,10 @@ enum {
 };
 
 enum {
-    OPEN_FILE_TAB,
-    OPEN_DISC_TAB,
-    OPEN_NETWORK_TAB,
-    OPEN_CAPTURE_TAB,
-    OPEN_TAB_MAX
-};
-
-enum {
-    OPEN_AND_PLAY,
-    OPEN_AND_STREAM,
-    OPEN_AND_SAVE,
-    OPEN_AND_ENQUEUE,
-    SELECT
+    DialogEvent_Type = QEvent::User + DialogEventType + 1,
+    //PLUndockEvent_Type = QEvent::User + DialogEventType + 2;
+    //PLDockEvent_Type = QEvent::User + DialogEventType + 3;
+    SetVideoOnTopEvent_Type = QEvent::User + DialogEventType + 4,
 };
 
 class QEvent;
@@ -94,7 +87,7 @@ class QVLCMenu;
 
 class DialogsProvider : public QObject
 {
-    Q_OBJECT;
+    Q_OBJECT
     friend class QVLCMenu;
 
 public:
@@ -111,17 +104,20 @@ public:
     }
     static void killInstance()
     {
-        if( instance ) delete instance;
+        delete instance;
         instance = NULL;
     }
-    virtual ~DialogsProvider();
-    QTimer *fixed_timer;
+    static bool isAlive()
+    {
+        return ( instance != NULL );
+    }
 
-    QStringList showSimpleOpen( QString help = QString(),
+    QStringList showSimpleOpen( const QString& help = QString(),
                                 int filters = EXT_FILTER_MEDIA |
                                 EXT_FILTER_VIDEO | EXT_FILTER_AUDIO |
                                 EXT_FILTER_PLAYLIST,
-                                QString path = QString() );
+                                const QString& path = QString() );
+    bool isDying() { return b_isDying; }
 protected:
     QSignalMapper *menusMapper;
     QSignalMapper *menusUpdateMapper;
@@ -130,15 +126,18 @@ protected:
 
 private:
     DialogsProvider( intf_thread_t *);
-    intf_thread_t *p_intf;
+    virtual ~DialogsProvider();
     static DialogsProvider *instance;
+
+    intf_thread_t *p_intf;
+    QWidget* root;
+    bool b_isDying;
+
+    void openDialog( int );
     void addFromSimple( bool, bool );
 
 public slots:
-    void doInteraction( intf_dialog_args_t * );
-    void menuAction( QObject *);
-    void menuUpdateAction( QObject * );
-    void SDMenuAction( QString );
+    void playMRL( const QString & );
 
     void playlistDialog();
     void bookmarksDialog();
@@ -146,6 +145,7 @@ public slots:
     void mediaCodecDialog();
     void prefsDialog();
     void extendedDialog();
+    void synchroDialog();
     void messagesDialog();
 #ifdef ENABLE_VLM
     void vlmDialog();
@@ -157,34 +157,64 @@ public slots:
     void aboutDialog();
     void gotoTimeDialog();
     void podcastConfigureDialog();
+    void toolbarDialog();
+    void pluginDialog();
+    void epgDialog();
+
+    void openFileGenericDialog( intf_dialog_args_t * );
 
     void simpleOpenDialog();
     void simplePLAppendDialog();
     void simpleMLAppendDialog();
 
     void openDialog();
-    void openDialog( int );
     void openDiscDialog();
     void openFileDialog();
+    void openUrlDialog();
     void openNetDialog();
     void openCaptureDialog();
 
-    void PLAppendDialog();
-    void MLAppendDialog();
+    void PLAppendDialog( int tab = OPEN_FILE_TAB );
+    void MLAppendDialog( int tab = OPEN_FILE_TAB );
+
+    void PLOpenDir();
     void PLAppendDir();
     void MLAppendDir();
 
-    void streamingDialog( QWidget *parent, QString mrl = "",
-            bool b_stream = true );
-    void openThenStreamingDialogs();
-    void openThenTranscodingDialogs();
+    void streamingDialog( QWidget *parent, const QString& mrl, bool b_stream = true,
+                          QStringList options = QStringList("") );
+    void openAndStreamingDialogs();
+    void openAndTranscodingDialogs();
 
     void openAPlaylist();
     void saveAPlaylist();
 
-    void switchToSkins();
-    void switchToWx();
+    void loadSubtitlesFile();
+
     void quit();
+private slots:
+    void menuAction( QObject *);
+    void menuUpdateAction( QObject * );
+    void SDMenuAction( const QString& );
+signals:
+    void  toolBarConfUpdated();
 };
 
+class DialogEvent : public QEvent
+{
+public:
+    DialogEvent( int _i_dialog, int _i_arg, intf_dialog_args_t *_p_arg ) :
+                 QEvent( (QEvent::Type)(DialogEvent_Type) )
+    {
+        i_dialog = _i_dialog;
+        i_arg = _i_arg;
+        p_arg = _p_arg;
+    }
+    virtual ~DialogEvent() { }
+
+    int i_arg, i_dialog;
+    intf_dialog_args_t *p_arg;
+};
+
+
 #endif