]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/simple_preferences.hpp
Qt: PLSelector: Make effectless root entries not selectable
[vlc] / modules / gui / qt4 / components / simple_preferences.hpp
1 /*****************************************************************************
2  * simple_preferences.hpp : Simple prefs
3  ****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #ifndef _SIMPLEPREFS_H_
25 #define _SIMPLEPREFS_H_
26
27 #ifdef HAVE_CONFIG_H
28 # include "config.h"
29 #endif
30
31 #include <vlc_common.h>
32 #include <vlc_interface.h>
33
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"
39
40 #ifdef WIN32
41 # include "util/registry.hpp"
42 #endif
43
44 #include <QWidget>
45
46 enum {
47     SPrefsInterface = 0,
48     SPrefsAudio,
49     SPrefsVideo,
50     SPrefsSubtitles,
51     SPrefsInputAndCodecs,
52     SPrefsHotkeys,
53     SPrefsMax
54 };
55 #define SPrefsDefaultCat SPrefsInterface
56
57 enum {
58     CachingCustom = 0,
59     CachingLowest = 100,
60     CachingLow    = 200,
61     CachingNormal = 300,
62     CachingHigh   = 500,
63     CachingHigher = 1000
64 };
65
66 enum {
67 #ifdef WIN32
68        directxW,
69 #elif defined( __OS2__)
70        kaiW,
71 #else
72        alsaW,
73        ossW,
74 #endif
75        fileW,
76        audioOutCoB,
77        normalizerChB,
78        volLW,
79        headphoneB,
80        spdifChB,
81 };
82 enum { inputLE, cachingCoB };
83 enum { skinRB, qtRB, styleCB };
84 enum { shadowCB, backgroundCB };
85
86 class ConfigControl;
87 class QComboBox;
88 class QLineEdit;
89 class QRadioButton;
90 class QCheckBox;
91 class QString;
92
93 #ifdef WIN32
94 class QTreeWidgetItem;
95 #endif
96
97 class SPrefsCatList : public QWidget
98 {
99     Q_OBJECT
100 public:
101     SPrefsCatList( intf_thread_t *, QWidget *, bool );
102     virtual ~SPrefsCatList() {};
103 private:
104     intf_thread_t *p_intf;
105 signals:
106     void currentItemChanged( int );
107 public slots:
108     void switchPanel( int );
109 };
110
111 class SPrefsPanel : public QWidget
112 {
113     Q_OBJECT
114 public:
115     SPrefsPanel( intf_thread_t *, QWidget *, int, bool );
116     virtual ~SPrefsPanel();
117     void apply();
118     void clean();
119
120 private:
121     intf_thread_t *p_intf;
122     QList<ConfigControl *> controls;
123
124     int number;
125
126     QWidgetList optionWidgets;
127     QStringList qs_filter;
128     QButtonGroup *radioGroup;
129
130 #ifdef WIN32
131     QList<QTreeWidgetItem *> listAsso;
132     bool addType( const char * psz_ext, QTreeWidgetItem*, QTreeWidgetItem*, QVLCRegistry* );
133 #endif
134
135 /* Display only the options for the selected audio output */
136 private slots:
137     void lastfm_Changed( int );
138     void updateAudioOptions( int );
139     void updateAudioVolume( int );
140 #ifdef WIN32
141     void assoDialog();
142     void saveAsso();
143 #endif
144     void configML();
145     void changeStyle( QString );
146 };
147
148 #endif