1 /*****************************************************************************
2 * preferences_widgets.h : wxWindows plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000-2003 the VideoLAN team
7 * Authors: Sigmund Augdal Helberg <dnumgis@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 *****************************************************************************/
25 #include <wx/spinctrl.h>
27 class ConfigControl: public wxPanel
30 ConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
34 virtual int GetIntValue() {return 0;}
35 virtual float GetFloatValue() {return 0;}
36 virtual wxString GetPszValue() {return wxString();}
40 vlc_bool_t IsAdvanced();
42 void SetUpdateCallback( void (*)( void * ), void * );
49 void (*pf_update_callback)( void * );
52 void OnUpdate( wxCommandEvent& event );
53 void OnUpdateScroll( wxScrollEvent& event );
58 vlc_bool_t b_advanced;
61 ConfigControl *CreateConfigControl( vlc_object_t *,
62 module_config_t *, wxWindow * );
64 class KeyConfigControl: public ConfigControl
67 KeyConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
69 virtual int GetIntValue();
75 // Array of key descriptions, for the ComboBox
76 static wxString *m_keysList;
79 class ModuleConfigControl: public ConfigControl
82 ModuleConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
83 ~ModuleConfigControl();
84 virtual wxString GetPszValue();
89 struct moduleCheckBox {
94 class ModuleCatConfigControl: public ConfigControl
97 ModuleCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
98 ~ModuleCatConfigControl();
99 virtual wxString GetPszValue();
105 class ModuleListCatConfigControl: public ConfigControl
108 ModuleListCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
109 ~ModuleListCatConfigControl();
110 virtual wxString GetPszValue();
112 std::vector<moduleCheckBox *> pp_checkboxes;
114 void OnUpdate( wxCommandEvent& );
117 DECLARE_EVENT_TABLE()
122 class StringConfigControl: public ConfigControl
125 StringConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
126 ~StringConfigControl();
127 virtual wxString GetPszValue();
129 wxTextCtrl *textctrl;
131 DECLARE_EVENT_TABLE()
134 class StringListConfigControl: public ConfigControl
137 StringListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
138 ~StringListConfigControl();
139 virtual wxString GetPszValue();
142 char *psz_default_value;
143 void UpdateCombo( module_config_t *p_item );
145 void OnAction( wxCommandEvent& );
147 DECLARE_EVENT_TABLE()
150 class FileConfigControl: public ConfigControl
153 FileConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
154 ~FileConfigControl();
155 void OnBrowse( wxCommandEvent& );
156 virtual wxString GetPszValue();
158 wxTextCtrl *textctrl;
162 DECLARE_EVENT_TABLE()
165 class IntegerConfigControl: public ConfigControl
168 IntegerConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
169 ~IntegerConfigControl();
170 virtual int GetIntValue();
175 void OnUpdate( wxCommandEvent& event );
176 void OnUpdateScroll( wxScrollEvent& event );
178 DECLARE_EVENT_TABLE()
181 class IntegerListConfigControl: public ConfigControl
184 IntegerListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
185 ~IntegerListConfigControl();
186 virtual int GetIntValue();
189 void UpdateCombo( module_config_t *p_item );
191 void OnAction( wxCommandEvent& );
193 DECLARE_EVENT_TABLE()
196 class RangedIntConfigControl: public ConfigControl
199 RangedIntConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
200 ~RangedIntConfigControl();
201 virtual int GetIntValue();
205 DECLARE_EVENT_TABLE()
208 class FloatConfigControl: public ConfigControl
211 FloatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
212 ~FloatConfigControl();
213 virtual float GetFloatValue();
215 wxTextCtrl *textctrl;
217 DECLARE_EVENT_TABLE()
220 class BoolConfigControl: public ConfigControl
223 BoolConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
224 ~BoolConfigControl();
225 virtual int GetIntValue();
227 wxCheckBox *checkbox;
229 DECLARE_EVENT_TABLE()
232 class SectionConfigControl: public ConfigControl
235 SectionConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
236 ~SectionConfigControl();