]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/external.hpp
Qt: includes barrier fix.
[vlc] / modules / gui / qt4 / dialogs / external.hpp
index 0ff46e11086a714812842231a0ee202d59d1bf7e..d2894ef883f0981a89f1596763fd570da6b65fe1 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef VLC_QT4_DIALOGS_EXTERNAL_H_
-# define VLC_QT4_DIALOGS_EXTERNAL_H 1
+#ifndef QVLC_DIALOGS_EXTERNAL_H_
+#define QVLC_DIALOGS_EXTERNAL_H_ 1
 
 #include <QObject>
 #include <vlc_common.h>
 
+class QVLCVariable : public QObject
+{
+    Q_OBJECT
+private:
+    static int callback (vlc_object_t *, const char *,
+                         vlc_value_t, vlc_value_t, void *);
+    vlc_object_t *object;
+    QString name;
+
+public:
+    QVLCVariable (vlc_object_t *, const char *, int);
+    virtual ~QVLCVariable (void);
+
+signals:
+    void pointerChanged (vlc_object_t *, void *);
+};
+
 struct intf_thread_t;
+class QProgressDialog;
 
 class DialogHandler : public QObject
 {
     Q_OBJECT
+
+    friend class QVLCProgressDialog;
+
 public:
     DialogHandler (intf_thread_t *);
     ~DialogHandler (void);
 
 private:
     intf_thread_t *intf;
-    static int MessageCallback (vlc_object_t *, const char *,
-                                vlc_value_t, vlc_value_t, void *);
-    static int LoginCallback (vlc_object_t *obj, const char *,
-                              vlc_value_t, vlc_value_t, void *);
-    static int QuestionCallback (vlc_object_t *obj, const char *,
-                                 vlc_value_t, vlc_value_t, void *);
+    QVLCVariable message;
+    QVLCVariable login;
+    QVLCVariable question;
+    QVLCVariable progressBar;
+signals:
+    void progressBarDestroyed (QWidget *);
+
+private slots:
+    void displayMessage (vlc_object_t *, void *);
+    void requestLogin (vlc_object_t *, void *);
+    void requestAnswer (vlc_object_t *, void *);
+    void startProgressBar (vlc_object_t *, void *);
+    void stopProgressBar (QWidget *);
+};
+
+/* Put here instead of .cpp because of MOC */
+#include <QProgressDialog>
+
+class QVLCProgressDialog : public QProgressDialog
+{
+    Q_OBJECT
+public:
+    QVLCProgressDialog (DialogHandler *parent,
+                        struct dialog_progress_bar_t *);
+    virtual ~QVLCProgressDialog (void);
+
+private:
+    DialogHandler *handler;
+    bool cancelled;
 
+    static void update (void *, const char *, float);
+    static bool check (void *);
+    static void destroy (void *);
 private slots:
-    void displayMessage (const struct dialog_fatal_t *);
-    void requestLogin (struct dialog_login_t *);
-    void requestAnswer (struct dialog_question_t *);
+    void saveCancel (void);
 
 signals:
-    void message (const struct dialog_fatal_t *);
-    void authentication (struct dialog_login_t *);
-    void question (struct dialog_question_t *);
+    void progressed (int);
+    void described (const QString&);
+    void destroyed (void);
 };
 
 #endif