1 /*****************************************************************************
2 * preferences_widgets.h : wxWindows plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2000-2003 the VideoLAN team
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& event );
52 void OnUpdateScroll( wxScrollEvent& event );
57 vlc_bool_t b_advanced;
60 ConfigControl *CreateConfigControl( vlc_object_t *,
61 module_config_t *, wxWindow * );
63 class KeyConfigControl: public ConfigControl
66 KeyConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
68 virtual int GetIntValue();
74 // Array of key descriptions, for the ComboBox
75 static wxString *m_keysList;
78 class ModuleConfigControl: public ConfigControl
81 ModuleConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
82 ~ModuleConfigControl();
83 virtual wxString GetPszValue();
88 struct moduleCheckBox {
93 class ModuleCatConfigControl: public ConfigControl
96 ModuleCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
97 ~ModuleCatConfigControl();
98 virtual wxString GetPszValue();
104 class ModuleListCatConfigControl: public ConfigControl
107 ModuleListCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
108 ~ModuleListCatConfigControl();
109 virtual wxString GetPszValue();
111 std::vector<moduleCheckBox *> pp_checkboxes;
113 void OnUpdate( wxCommandEvent& );
116 DECLARE_EVENT_TABLE()
121 class StringConfigControl: public ConfigControl
124 StringConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
125 ~StringConfigControl();
126 virtual wxString GetPszValue();
128 wxTextCtrl *textctrl;
130 DECLARE_EVENT_TABLE()
133 class StringListConfigControl: public ConfigControl
136 StringListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
137 ~StringListConfigControl();
138 virtual wxString GetPszValue();
141 char *psz_default_value;
142 void UpdateCombo( module_config_t *p_item );
144 void OnAction( wxCommandEvent& );
146 DECLARE_EVENT_TABLE()
149 class FileConfigControl: public ConfigControl
152 FileConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
153 ~FileConfigControl();
154 void OnBrowse( wxCommandEvent& );
155 virtual wxString GetPszValue();
157 wxTextCtrl *textctrl;
161 DECLARE_EVENT_TABLE()
164 class IntegerConfigControl: public ConfigControl
167 IntegerConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
168 ~IntegerConfigControl();
169 virtual int GetIntValue();
174 void OnUpdate( wxCommandEvent& event );
175 void OnUpdateScroll( wxScrollEvent& event );
177 DECLARE_EVENT_TABLE()
180 class IntegerListConfigControl: public ConfigControl
183 IntegerListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
184 ~IntegerListConfigControl();
185 virtual int GetIntValue();
188 void UpdateCombo( module_config_t *p_item );
190 void OnAction( wxCommandEvent& );
192 DECLARE_EVENT_TABLE()
195 class RangedIntConfigControl: public ConfigControl
198 RangedIntConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
199 ~RangedIntConfigControl();
200 virtual int GetIntValue();
204 DECLARE_EVENT_TABLE()
207 class FloatConfigControl: public ConfigControl
210 FloatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
211 ~FloatConfigControl();
212 virtual float GetFloatValue();
214 wxTextCtrl *textctrl;
216 DECLARE_EVENT_TABLE()
219 class BoolConfigControl: public ConfigControl
222 BoolConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
223 ~BoolConfigControl();
224 virtual int GetIntValue();
226 wxCheckBox *checkbox;
228 DECLARE_EVENT_TABLE()
231 class SectionConfigControl: public ConfigControl
234 SectionConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
235 ~SectionConfigControl();