1 /*****************************************************************************
2 * preferences_widgets.h : wxWindows plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000-2003 VideoLAN
7 * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
26 class ConfigControl: public wxPanel
29 ConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
33 virtual int GetIntValue() {return 0;}
34 virtual float GetFloatValue() {return 0;}
35 virtual wxString GetPszValue() {return wxString();}
39 vlc_bool_t IsAdvanced();
41 void SetUpdateCallback( void (*)( void * ), void * );
48 void (*pf_update_callback)( void * );
51 void OnUpdate( wxCommandEvent& );
56 vlc_bool_t b_advanced;
59 ConfigControl *CreateConfigControl( vlc_object_t *,
60 module_config_t *, wxWindow * );
62 class KeyConfigControl: public ConfigControl
65 KeyConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
67 virtual int GetIntValue();
73 // Array of key descriptions, for the ComboBox
74 static wxString *m_keysList;
77 class ModuleConfigControl: public ConfigControl
80 ModuleConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
81 ~ModuleConfigControl();
82 virtual wxString GetPszValue();
87 struct moduleCheckBox {
92 class ModuleListCatConfigControl: public ConfigControl
95 ModuleListCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
96 ~ModuleListCatConfigControl();
97 virtual wxString GetPszValue();
99 std::vector<moduleCheckBox *> pp_checkboxes;
101 void OnUpdate( wxCommandEvent& );
104 DECLARE_EVENT_TABLE()
109 class StringConfigControl: public ConfigControl
112 StringConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
113 ~StringConfigControl();
114 virtual wxString GetPszValue();
116 wxTextCtrl *textctrl;
118 DECLARE_EVENT_TABLE()
121 class StringListConfigControl: public ConfigControl
124 StringListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
125 ~StringListConfigControl();
126 virtual wxString GetPszValue();
129 char *psz_default_value;
130 void UpdateCombo( module_config_t *p_item );
132 void OnAction( wxCommandEvent& );
134 DECLARE_EVENT_TABLE()
137 class FileConfigControl: public ConfigControl
140 FileConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
141 ~FileConfigControl();
142 void OnBrowse( wxCommandEvent& );
143 virtual wxString GetPszValue();
145 wxTextCtrl *textctrl;
149 DECLARE_EVENT_TABLE()
152 class IntegerConfigControl: public ConfigControl
155 IntegerConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
156 ~IntegerConfigControl();
157 virtual int GetIntValue();
162 void OnUpdate( wxCommandEvent& );
164 DECLARE_EVENT_TABLE()
167 class IntegerListConfigControl: public ConfigControl
170 IntegerListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
171 ~IntegerListConfigControl();
172 virtual int GetIntValue();
175 void UpdateCombo( module_config_t *p_item );
177 void OnAction( wxCommandEvent& );
179 DECLARE_EVENT_TABLE()
182 class RangedIntConfigControl: public ConfigControl
185 RangedIntConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
186 ~RangedIntConfigControl();
187 virtual int GetIntValue();
191 DECLARE_EVENT_TABLE()
194 class FloatConfigControl: public ConfigControl
197 FloatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
198 ~FloatConfigControl();
199 virtual float GetFloatValue();
201 wxTextCtrl *textctrl;
203 DECLARE_EVENT_TABLE()
206 class BoolConfigControl: public ConfigControl
209 BoolConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
210 ~BoolConfigControl();
211 virtual int GetIntValue();
213 wxCheckBox *checkbox;
215 DECLARE_EVENT_TABLE()
218 class SectionConfigControl: public ConfigControl
221 SectionConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
222 ~SectionConfigControl();