Qt: allow SQL-ML configuration
[vlc/vlc-skelet.git] / modules / gui / qt4 / components / simple_preferences.hpp
blob7307a7668ac8387cd6e274d6490aef646fedeca2
1 /*****************************************************************************
2 * simple_preferences.hpp : Simple prefs
3 ****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
5 * $Id$
7 * Authors: Clément Stenac <zorglub@videolan.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
24 #ifndef _SIMPLEPREFS_H_
25 #define _SIMPLEPREFS_H_
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
31 #include <vlc_common.h>
32 #include <vlc_interface.h>
34 #include "ui/sprefs_input.h"
35 #include "ui/sprefs_audio.h"
36 #include "ui/sprefs_video.h"
37 #include "ui/sprefs_subtitles.h"
38 #include "ui/sprefs_interface.h"
40 #ifdef WIN32
41 # include "util/registry.hpp"
42 #endif
44 #include <QWidget>
46 enum {
47 SPrefsInterface = 0,
48 SPrefsAudio,
49 SPrefsVideo,
50 SPrefsSubtitles,
51 SPrefsInputAndCodecs,
52 SPrefsHotkeys,
53 SPrefsMax
55 #define SPrefsDefaultCat SPrefsInterface
57 enum {
58 CachingCustom = 0,
59 CachingLowest = 100,
60 CachingLow = 200,
61 CachingNormal = 300,
62 CachingHigh = 750,
63 CachingHigher = 2500
66 enum {
67 #ifdef WIN32
68 directxW,
69 #else
70 alsaW,
71 ossW,
72 #endif
73 fileW,
74 audioOutCoB,
75 normalizerChB,
76 volLW,
77 headphoneB,
78 spdifChB,
80 enum { inputLE, cachingCoB };
81 enum { skinRB, qtRB, styleCB };
83 class ConfigControl;
84 class QComboBox;
85 class QLineEdit;
86 class QRadioButton;
87 class QCheckBox;
88 class QString;
90 #ifdef WIN32
91 class QTreeWidgetItem;
92 #endif
94 class SPrefsCatList : public QWidget
96 Q_OBJECT
97 public:
98 SPrefsCatList( intf_thread_t *, QWidget *, bool );
99 virtual ~SPrefsCatList() {};
100 private:
101 intf_thread_t *p_intf;
102 signals:
103 void currentItemChanged( int );
104 public slots:
105 void switchPanel( int );
108 class SPrefsPanel : public QWidget
110 Q_OBJECT
111 public:
112 SPrefsPanel( intf_thread_t *, QWidget *, int, bool );
113 virtual ~SPrefsPanel();
114 void apply();
115 void clean();
116 private:
117 intf_thread_t *p_intf;
118 QList<ConfigControl *> controls;
120 int number;
122 QList<QWidget *> optionWidgets;
123 QStringList qs_filter;
124 QButtonGroup *radioGroup;
126 #ifdef WIN32
127 QList<QTreeWidgetItem *> listAsso;
128 bool addType( const char * psz_ext, QTreeWidgetItem*, QTreeWidgetItem*, QVLCRegistry* );
129 #endif
131 /* Display only the options for the selected audio output */
132 private slots:
133 void lastfm_Changed( int );
134 void updateAudioOptions( int );
135 void updateAudioVolume( int );
136 #ifdef SYS_MINGW32
137 void assoDialog();
138 void saveAsso();
139 #endif
140 void configML();
141 void changeStyle( QString );
144 #endif