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( wxEvent& );
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 ModuleCatConfigControl: public ConfigControl
95 ModuleCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
96 ~ModuleCatConfigControl();
97 virtual wxString GetPszValue();
103 class ModuleListCatConfigControl: public ConfigControl
106 ModuleListCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
107 ~ModuleListCatConfigControl();
108 virtual wxString GetPszValue();
110 std::vector<moduleCheckBox *> pp_checkboxes;
112 void OnUpdate( wxCommandEvent& );
115 DECLARE_EVENT_TABLE()
120 class StringConfigControl: public ConfigControl
123 StringConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
124 ~StringConfigControl();
125 virtual wxString GetPszValue();
127 wxTextCtrl *textctrl;
129 DECLARE_EVENT_TABLE()
132 class StringListConfigControl: public ConfigControl
135 StringListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
136 ~StringListConfigControl();
137 virtual wxString GetPszValue();
140 char *psz_default_value;
141 void UpdateCombo( module_config_t *p_item );
143 void OnAction( wxCommandEvent& );
145 DECLARE_EVENT_TABLE()
148 class FileConfigControl: public ConfigControl
151 FileConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
152 ~FileConfigControl();
153 void OnBrowse( wxCommandEvent& );
154 virtual wxString GetPszValue();
156 wxTextCtrl *textctrl;
160 DECLARE_EVENT_TABLE()
163 class IntegerConfigControl: public ConfigControl
166 IntegerConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
167 ~IntegerConfigControl();
168 virtual int GetIntValue();
173 void OnUpdate( wxScrollEvent& );
175 DECLARE_EVENT_TABLE()
178 class IntegerListConfigControl: public ConfigControl
181 IntegerListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
182 ~IntegerListConfigControl();
183 virtual int GetIntValue();
186 void UpdateCombo( module_config_t *p_item );
188 void OnAction( wxCommandEvent& );
190 DECLARE_EVENT_TABLE()
193 class RangedIntConfigControl: public ConfigControl
196 RangedIntConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
197 ~RangedIntConfigControl();
198 virtual int GetIntValue();
202 DECLARE_EVENT_TABLE()
205 class FloatConfigControl: public ConfigControl
208 FloatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
209 ~FloatConfigControl();
210 virtual float GetFloatValue();
212 wxTextCtrl *textctrl;
214 DECLARE_EVENT_TABLE()
217 class BoolConfigControl: public ConfigControl
220 BoolConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
221 ~BoolConfigControl();
222 virtual int GetIntValue();
224 wxCheckBox *checkbox;
226 DECLARE_EVENT_TABLE()
229 class SectionConfigControl: public ConfigControl
232 SectionConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
233 ~SectionConfigControl();