]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/preferences_widgets.h
51669c61e794a3d3e3e27e572a29ddc60d61db58
[vlc] / modules / gui / wxwindows / preferences_widgets.h
1 /*****************************************************************************
2  * preferences_widgets.h : wxWindows plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2000-2003 VideoLAN
5  * $Id$
6  *
7  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 class ConfigControl: public wxPanel
25 {
26 public:
27     ConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
28     ~ConfigControl();
29     wxSizer *Sizer();
30
31     virtual int GetIntValue() {return 0;}
32     virtual float GetFloatValue() {return 0;}
33     virtual wxString GetPszValue() {return wxString();}
34
35     wxString GetName();
36     int GetType();
37     vlc_bool_t IsAdvanced();
38
39     void SetUpdateCallback( void (*)( void * ), void * );
40
41 protected:
42     wxBoxSizer *sizer;
43     wxStaticText *label;
44     vlc_object_t *p_this;
45
46     void (*pf_update_callback)( void * );
47     void *p_update_data;
48
49     void OnUpdate( wxCommandEvent& );
50
51 private:
52     wxString name;
53     int i_type;
54     vlc_bool_t b_advanced;
55 };
56
57 ConfigControl *CreateConfigControl( vlc_object_t *,
58                                     module_config_t *, wxWindow * );
59
60 class KeyConfigControl: public ConfigControl
61 {
62 public:
63     KeyConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
64     ~KeyConfigControl();
65     virtual int GetIntValue();
66 private:
67     wxCheckBox *alt;
68     wxCheckBox *ctrl;
69     wxCheckBox *shift;
70     wxComboBox *combo;
71     // Array of key descriptions, for the ComboBox
72     static wxString *m_keysList;
73 };
74
75 class ModuleConfigControl: public ConfigControl
76 {
77 public:
78     ModuleConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
79     ~ModuleConfigControl();
80     virtual wxString GetPszValue();
81 private:
82     wxComboBox *combo;
83 };
84
85 class StringConfigControl: public ConfigControl
86 {
87 public:
88     StringConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
89     ~StringConfigControl();
90     virtual wxString GetPszValue();
91 private:
92     wxTextCtrl *textctrl;
93
94     DECLARE_EVENT_TABLE()
95 };
96
97 class StringListConfigControl: public ConfigControl
98 {
99 public:
100     StringListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
101     ~StringListConfigControl();
102     virtual wxString GetPszValue();
103 private:
104     wxComboBox *combo;
105     char *psz_default_value;
106     void UpdateCombo( module_config_t *p_item );
107
108     void OnAction( wxCommandEvent& );
109
110     DECLARE_EVENT_TABLE()
111 };
112
113 class FileConfigControl: public ConfigControl
114 {
115 public:
116     FileConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
117     ~FileConfigControl();
118     void OnBrowse( wxCommandEvent& );
119     virtual wxString GetPszValue();
120 private:
121     wxTextCtrl *textctrl;
122     wxButton *browse;
123     bool directory;
124
125     DECLARE_EVENT_TABLE()
126 };
127
128 class IntegerConfigControl: public ConfigControl
129 {
130 public:
131     IntegerConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
132     ~IntegerConfigControl();
133     virtual int GetIntValue();
134 private:
135     wxSpinCtrl *spin;
136     int i_value;
137
138     void OnUpdate( wxCommandEvent& );
139
140     DECLARE_EVENT_TABLE()
141 };
142
143 class IntegerListConfigControl: public ConfigControl
144 {
145 public:
146     IntegerListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
147     ~IntegerListConfigControl();
148     virtual int GetIntValue();
149 private:
150     wxComboBox *combo;
151     void UpdateCombo( module_config_t *p_item );
152
153     void OnAction( wxCommandEvent& );
154
155     DECLARE_EVENT_TABLE()
156 };
157
158 class RangedIntConfigControl: public ConfigControl
159 {
160 public:
161     RangedIntConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
162     ~RangedIntConfigControl();
163     virtual int GetIntValue();
164 private:
165     wxSlider *slider;
166
167     DECLARE_EVENT_TABLE()
168 };
169
170 class FloatConfigControl: public ConfigControl
171 {
172 public:
173     FloatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
174     ~FloatConfigControl();
175     virtual float GetFloatValue();
176 private:
177     wxTextCtrl *textctrl;
178
179     DECLARE_EVENT_TABLE()
180 };
181
182 class BoolConfigControl: public ConfigControl
183 {
184 public:
185     BoolConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
186     ~BoolConfigControl();
187     virtual int GetIntValue();
188 private:
189     wxCheckBox *checkbox;
190
191     DECLARE_EVENT_TABLE()
192 };