]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.hpp
qt4 - Include cleanup.
[vlc] / modules / gui / qt4 / components / preferences_widgets.hpp
index eb2a75ca3d257eef018086860fa1d77887621f6d..4bb91ec6f60e3866ccab44130d1a38c89247b66d 100644 (file)
@@ -1,11 +1,12 @@
 /*****************************************************************************
  * preferences_widgets.hpp : Widgets for preferences panels
  ****************************************************************************
- * Copyright (C) 2006 the VideoLAN team
+ * Copyright (C) 2006-2007 the VideoLAN team
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
  *          Antoine Cellerier <dionoea@videolan.org>
+ *          Jean-Baptiste Kempf <jb@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #ifndef _INFOPANELS_H_
 #define _INFOPANELS_H_
+
 #include <vlc/vlc.h>
+
+#include "qt4.hpp"
+#include <assert.h>
+
 #include <QWidget>
-#include <QTreeWidget>
+
+#include <QCheckBox>
+#include <QComboBox>
 #include <QLineEdit>
+#include <QTreeWidget>
 #include <QSpinBox>
+#include <QLabel>
 #include <QDoubleSpinBox>
-#include <QComboBox>
-#include <QCheckBox>
+#include <QPushButton>
 #include <QVector>
 #include <QDialog>
-#include <QLabel>
 
-#include "qt4.hpp"
-#include <assert.h>
 
+class QFile;
+class QTreeWidget;
+class QTreeWidgetItem;
+class QGroupBox;
 class QGridLayout;
 
 class ConfigControl : public QObject
 {
-    Q_OBJECT;
+    Q_OBJECT
 public:
     ConfigControl( vlc_object_t *_p_this, module_config_t *_p_conf,
                    QWidget *p ) : p_this( _p_this ), p_item( _p_conf )
@@ -84,6 +94,7 @@ signals:
  *******************************************************/
 class VIntConfigControl : public ConfigControl
 {
+Q_OBJECT
 public:
     VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
             ConfigControl(a,b,c) {};
@@ -96,6 +107,7 @@ public:
 
 class IntegerConfigControl : public VIntConfigControl
 {
+Q_OBJECT
 public:
     IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                           QGridLayout *, int& );
@@ -178,6 +190,7 @@ private:
  *******************************************************/
 class VFloatConfigControl : public ConfigControl
 {
+    Q_OBJECT
 public:
     VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
                 ConfigControl(a,b,c) {};
@@ -190,6 +203,7 @@ public:
 
 class FloatConfigControl : public VFloatConfigControl
 {
+    Q_OBJECT
 public:
     FloatConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                         QGridLayout *, int& );
@@ -210,6 +224,7 @@ private:
 
 class FloatRangeConfigControl : public FloatConfigControl
 {
+    Q_OBJECT
 public:
     FloatRangeConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                              QGridLayout *, int& );
@@ -224,6 +239,7 @@ private:
  *******************************************************/
 class VStringConfigControl : public ConfigControl
 {
+    Q_OBJECT
 public:
     VStringConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
                 ConfigControl(a,b,c) {};
@@ -236,6 +252,7 @@ public:
 
 class StringConfigControl : public VStringConfigControl
 {
+    Q_OBJECT
 public:
     StringConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                          QGridLayout *, int&,  bool pwd );
@@ -251,6 +268,53 @@ private:
     QLabel *label;
 };
 
+class FileConfigControl : public VStringConfigControl
+{
+    Q_OBJECT;
+public:
+    FileConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+                       QGridLayout *, int&, bool pwd );
+    FileConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+                       QLineEdit *, QPushButton *, bool pwd );
+    virtual ~FileConfigControl() {};
+    virtual QString getValue() { return text->text(); };
+    virtual void show() { text->show(); label->show(); browse->show(); }
+    virtual void hide() { text->hide(); label->hide(); browse->hide(); }
+public slots:
+    virtual void updateField();
+protected:
+    void finish();
+    QLineEdit *text;
+    QLabel *label;
+    QPushButton *browse;
+};
+
+class DirectoryConfigControl : public FileConfigControl
+{
+    Q_OBJECT;
+public:
+    DirectoryConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+                            QGridLayout *, int&, bool pwd );
+    DirectoryConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+                            QLineEdit *, QPushButton *, bool pwd );
+    virtual ~DirectoryConfigControl() {};
+public slots:
+    virtual void updateField();
+};
+
+class FontConfigControl : public FileConfigControl
+{
+    Q_OBJECT;
+public:
+    FontConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+                       QGridLayout *, int&, bool pwd );
+    FontConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+                       QLineEdit *, QPushButton *, bool pwd );
+    virtual ~FontConfigControl() {};
+public slots:
+    virtual void updateField();
+};
+
 class ModuleConfigControl : public VStringConfigControl
 {
 public:
@@ -268,6 +332,11 @@ private:
     QComboBox *combo;
 };
 
+struct checkBoxListItem {
+    QCheckBox *checkBox;
+    char *psz_module;
+};
+
 class ModuleListConfigControl : public VStringConfigControl
 {
     Q_OBJECT;
@@ -281,11 +350,11 @@ public:
     virtual void hide();
     virtual void show();
 public slots:
-    void wakeUp_TheUserJustClickedOnSomething( int value );
+    void onUpdate( int value );
 private:
     void finish( bool );
-    QVector<QCheckBox*> modules;
-    QLabel *label;
+    QVector<checkBoxListItem*> modules;
+    QGroupBox *groupBox;
     QLineEdit *text;
 };
 
@@ -336,7 +405,9 @@ public:
     int keyValue;
     bool conflicts;
 private:
+    void checkForConflicts( int i_vlckey );
     void keyPressEvent( QKeyEvent *);
+    void wheelEvent( QWheelEvent *);
     QLabel *selected;
     QLabel *warning;
     const char * keyToChange;