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 *****************************************************************************/
24 class ConfigControl: public wxPanel
27 ConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
31 virtual int GetIntValue() {return 0;}
32 virtual float GetFloatValue() {return 0;}
33 virtual wxString GetPszValue() {return wxString();}
37 vlc_bool_t IsAdvanced();
39 void SetUpdateCallback( void (*)( void * ), void * );
46 void (*pf_update_callback)( void * );
49 void OnUpdate( wxCommandEvent& );
54 vlc_bool_t b_advanced;
57 ConfigControl *CreateConfigControl( vlc_object_t *,
58 module_config_t *, wxWindow * );
60 class KeyConfigControl: public ConfigControl
63 KeyConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
65 virtual int GetIntValue();
71 // Array of key descriptions, for the ComboBox
72 static wxString *m_keysList;
75 class ModuleConfigControl: public ConfigControl
78 ModuleConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
79 ~ModuleConfigControl();
80 virtual wxString GetPszValue();
85 class StringConfigControl: public ConfigControl
88 StringConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
89 ~StringConfigControl();
90 virtual wxString GetPszValue();
97 class StringListConfigControl: public ConfigControl
100 StringListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
101 ~StringListConfigControl();
102 virtual wxString GetPszValue();
105 char *psz_default_value;
106 void UpdateCombo( module_config_t *p_item );
108 void OnAction( wxCommandEvent& );
110 DECLARE_EVENT_TABLE()
113 class FileConfigControl: public ConfigControl
116 FileConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
117 ~FileConfigControl();
118 void OnBrowse( wxCommandEvent& );
119 virtual wxString GetPszValue();
121 wxTextCtrl *textctrl;
125 DECLARE_EVENT_TABLE()
128 class IntegerConfigControl: public ConfigControl
131 IntegerConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
132 ~IntegerConfigControl();
133 virtual int GetIntValue();
138 void OnUpdate( wxCommandEvent& );
140 DECLARE_EVENT_TABLE()
143 class IntegerListConfigControl: public ConfigControl
146 IntegerListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
147 ~IntegerListConfigControl();
148 virtual int GetIntValue();
151 void UpdateCombo( module_config_t *p_item );
153 void OnAction( wxCommandEvent& );
155 DECLARE_EVENT_TABLE()
158 class RangedIntConfigControl: public ConfigControl
161 RangedIntConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
162 ~RangedIntConfigControl();
163 virtual int GetIntValue();
167 DECLARE_EVENT_TABLE()
170 class FloatConfigControl: public ConfigControl
173 FloatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
174 ~FloatConfigControl();
175 virtual float GetFloatValue();
177 wxTextCtrl *textctrl;
179 DECLARE_EVENT_TABLE()
182 class BoolConfigControl: public ConfigControl
185 BoolConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
186 ~BoolConfigControl();
187 virtual int GetIntValue();
189 wxCheckBox *checkbox;
191 DECLARE_EVENT_TABLE()