]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/simple_preferences.hpp
Qt: SoutInputBox: show decoded mrl (fix #8436 part1)
[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 class ConfigControl;
67 class QComboBox;
68 class QLineEdit;
69 class QRadioButton;
70 class QCheckBox;
71 class QString;
72
73 #ifdef WIN32
74 class QTreeWidgetItem;
75 #endif
76
77 class SPrefsCatList : public QWidget
78 {
79     Q_OBJECT
80 public:
81     SPrefsCatList( intf_thread_t *, QWidget *, bool );
82     virtual ~SPrefsCatList() {};
83 private:
84     intf_thread_t *p_intf;
85 signals:
86     void currentItemChanged( int );
87 public slots:
88     void switchPanel( int );
89 };
90
91 class SPrefsPanel : public QWidget
92 {
93     Q_OBJECT
94 public:
95     SPrefsPanel( intf_thread_t *, QWidget *, int, bool );
96     virtual ~SPrefsPanel();
97     void apply();
98     void clean();
99
100 private:
101     intf_thread_t *p_intf;
102     QList<ConfigControl *> controls;
103
104     int number;
105
106     QHash<QString, QWidget*> optionWidgets;
107     QStringList qs_filter;
108     QButtonGroup *radioGroup;
109
110 #ifdef WIN32
111     QList<QTreeWidgetItem *> listAsso;
112     bool addType( const char * psz_ext, QTreeWidgetItem*, QTreeWidgetItem*, QVLCRegistry* );
113 #endif
114
115 /* Display only the options for the selected audio output */
116 private slots:
117     void lastfm_Changed( int );
118     void updateAudioOptions( int );
119     void updateAudioVolume( int );
120 #ifdef WIN32
121     void assoDialog();
122     void saveAsso();
123 #endif
124     void configML();
125     void changeStyle( QString );
126 };
127
128 #endif