1 /*****************************************************************************
2 * preferences_widgets.hpp : Widgets for preferences panels
3 ****************************************************************************
4 * Copyright (C) 2006 the VideoLAN team
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 _INFOPANELS_H_
25 #define _INFOPANELS_H_
28 #include "ui/input_stats.h"
36 class ConfigControl : public QWidget
40 ConfigControl( vlc_object_t *, module_config_t *, QWidget * );
41 virtual ~ConfigControl();
42 QString getName() { return _name; }
43 bool isAdvanced() { return _advanced; }
45 static ConfigControl * createControl( vlc_object_t*,
46 module_config_t*,QWidget* );
55 /*******************************************************
56 * Integer-based controls
57 *******************************************************/
58 class VIntConfigControl : public ConfigControl
61 VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
62 ConfigControl(a,b,c) {};
63 virtual ~VIntConfigControl() {};
64 virtual int getValue() = 0;
68 class IntegerConfigControl : public VIntConfigControl
71 IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget * );
72 virtual ~IntegerConfigControl();
73 virtual int getValue();
78 class BoolConfigControl : public VIntConfigControl
81 IntConfigControl( vlc_object_t *, module_config_t *, QWidget * );
82 virtual ~IntConfigControl();
83 virtual int getValue();
89 /*******************************************************
90 * Float-based controls
91 *******************************************************/
92 class VFloatConfigControl : public ConfigControl
95 VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
96 ConfigControl(a,b,c) {};
97 virtual ~VFloatConfigControl() {};
98 virtual float getValue() = 0;
102 class FloatConfigControl : public VFloatConfigControl
105 FloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
106 ConfigControl(a,b,c) {};
107 virtual ~FloatConfigControl() {};
108 virtual float getValue();
110 QDoubleSpinBox *spin;
114 /*******************************************************
115 * String-based controls
116 *******************************************************/
117 class VStringConfigControl : public ConfigControl
120 VStringConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
121 ConfigControl(a,b,c) {};
122 virtual ~VStringConfigControl() {};
123 virtual QString getValue() = 0;
126 class StringConfigControl : public VStringConfigControl
129 StringConfigControl( vlc_object_t *, module_config_t *, QWidget *,
131 virtual ~StringConfigControl();
132 virtual QString getValue();
137 class ModuleConfigControl : public VStringConfigControl
140 ModuleConfigControl( vlc_object_t *, module_config_t *, QWidget *, bool
142 virtual ~ModuleConfigControl();
143 virtual QString getValue();
148 struct ModuleCheckBox {
153 class ModuleListConfigControl : public ConfigControl
156 StringConfigControl( vlc_object_t *, module_config_t *, QWidget *, bool
158 virtual ~StringConfigControl();
159 virtual QString getValue();
161 std::vector<ModuleCheckBox> checkboxes;