]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/preferences_widgets.h
* include/configuration.h: some small re-work of the config declaration macros.
[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: preferences_widgets.h,v 1.4 2003/11/05 00:39:16 gbazin Exp $
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( module_config_t *, wxWindow *parent );
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 protected:
40     wxBoxSizer *sizer;
41     wxStaticText *label;
42
43 private:
44     wxString name;
45     int i_type;
46     vlc_bool_t b_advanced;
47 };
48
49 ConfigControl *CreateConfigControl( vlc_object_t *,
50                                     module_config_t *, wxWindow * );
51
52 class KeyConfigControl: public ConfigControl
53 {
54 public:
55     KeyConfigControl( module_config_t *p_item, wxWindow *parent );
56     ~KeyConfigControl();
57     virtual int GetIntValue();
58 private:
59     wxCheckBox *alt;
60     wxCheckBox *ctrl;
61     wxCheckBox *shift;
62     wxComboBox *combo;
63 };
64
65 class ModuleConfigControl: public ConfigControl
66 {
67 public:
68     ModuleConfigControl( vlc_object_t *p_this, module_config_t *p_item,
69                          wxWindow *parent );
70     ~ModuleConfigControl();
71     virtual wxString GetPszValue();
72 private:
73     wxComboBox *combo;
74 };
75     
76 class StringConfigControl: public ConfigControl
77 {
78 public:
79     StringConfigControl( module_config_t *p_item, wxWindow *parent );
80     ~StringConfigControl();
81     virtual wxString GetPszValue();
82 private:
83     wxTextCtrl *textctrl;
84 };
85
86 class StringListConfigControl: public ConfigControl
87 {
88 public:
89     StringListConfigControl( module_config_t *p_item, wxWindow *parent );
90     ~StringListConfigControl();
91     virtual wxString GetPszValue();
92 private:
93     wxComboBox *combo;
94 };
95
96 class FileConfigControl: public ConfigControl
97 {
98 public:
99     FileConfigControl( module_config_t *p_item, wxWindow *parent );
100     ~FileConfigControl();
101     void FileConfigControl::OnBrowse( wxCommandEvent& );
102     virtual wxString GetPszValue();
103 private:
104     DECLARE_EVENT_TABLE()
105     wxTextCtrl *textctrl;
106     wxButton *browse;
107     bool directory;
108 };
109
110 class IntegerConfigControl: public ConfigControl
111 {
112 public:
113     IntegerConfigControl( module_config_t *p_item, wxWindow *parent );
114     ~IntegerConfigControl();
115     virtual int GetIntValue();
116 private:
117     wxSpinCtrl *spin;
118 };
119
120 class IntegerListConfigControl: public ConfigControl
121 {
122 public:
123     IntegerListConfigControl( module_config_t *p_item, wxWindow *parent );
124     ~IntegerListConfigControl();
125     virtual int GetIntValue();
126 private:
127     wxComboBox *combo;
128 };
129
130 class RangedIntConfigControl: public ConfigControl
131 {
132 public:
133     RangedIntConfigControl( module_config_t *p_item, wxWindow *parent );
134     ~RangedIntConfigControl();
135     virtual int GetIntValue();
136 private:
137     wxSlider *slider;
138 };
139
140 class FloatConfigControl: public ConfigControl
141 {
142 public:
143     FloatConfigControl( module_config_t *p_item, wxWindow *parent );
144     ~FloatConfigControl();
145     virtual float GetFloatValue();
146 private:
147     wxTextCtrl *textctrl;
148 };
149
150 class BoolConfigControl: public ConfigControl
151 {
152 public:
153     BoolConfigControl( module_config_t *p_item, wxWindow *parent );
154     ~BoolConfigControl();
155     virtual int GetIntValue();
156 private:
157     wxCheckBox *checkbox;
158 };