]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/preferences_widgets.h
Factored the code for each of the different types of config options out into
[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.1 2003/10/19 22:41:18 sigmunau 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( wxWindow *parent );
28     ~ConfigControl();
29     wxSizer *Sizer();
30     virtual int GetIntValue();
31     virtual float GetFloatValue();
32     virtual const char * GetPszValue();
33 protected:
34     wxBoxSizer *sizer;
35     wxStaticText *label;
36 private:
37     int i_value;
38     float f_value;
39     char *psz_value;
40 };
41
42 class KeyConfigControl: public ConfigControl
43 {
44 public:
45     KeyConfigControl( module_config_t *p_item, wxWindow *parent );
46     ~KeyConfigControl();
47     virtual int GetIntValue();
48 private:
49     wxCheckBox *alt;
50     wxCheckBox *ctrl;
51     wxCheckBox *shift;
52     wxComboBox *combo;
53 };
54
55 class ModuleConfigControl: public ConfigControl
56 {
57 public:
58     ModuleConfigControl( intf_thread_t *p_intf, module_config_t *p_item,
59                       wxWindow *parent );
60     ~ModuleConfigControl();
61     virtual const char *GetPszValue();
62 private:
63     wxComboBox *combo;
64 };
65     
66 class StringConfigControl: public ConfigControl
67 {
68 public:
69     StringConfigControl( module_config_t *p_item, wxWindow *parent );
70     ~StringConfigControl();
71     virtual const char *GetPszValue();
72 private:
73     wxTextCtrl *textctrl;
74 };
75
76 class StringListConfigControl: public ConfigControl
77 {
78 public:
79     StringListConfigControl( module_config_t *p_item, wxWindow *parent );
80     ~StringListConfigControl();
81     virtual const char *GetPszValue();
82 private:
83     wxComboBox *combo;
84 };
85
86 class FileConfigControl: public ConfigControl
87 {
88 public:
89     FileConfigControl( module_config_t *p_item, wxWindow *parent );
90     ~FileConfigControl();
91     void FileConfigControl::OnBrowse( wxCommandEvent& );
92     virtual const char *GetPszValue();
93 private:
94     DECLARE_EVENT_TABLE()
95     wxTextCtrl *textctrl;
96     wxButton *browse;
97     bool directory;
98 };
99
100 class IntegerConfigControl: public ConfigControl
101 {
102 public:
103     IntegerConfigControl( module_config_t *p_item, wxWindow *parent );
104     ~IntegerConfigControl();
105     virtual int GetIntValue();
106 private:
107     wxSpinCtrl *spin;
108 };
109
110 class RangedIntConfigControl: public ConfigControl
111 {
112 public:
113     RangedIntConfigControl( module_config_t *p_item, wxWindow *parent );
114     ~RangedIntConfigControl();
115     virtual int GetIntValue();
116 private:
117     wxSlider *slider;
118 };
119
120 class FloatConfigControl: public ConfigControl
121 {
122 public:
123     FloatConfigControl( module_config_t *p_item, wxWindow *parent );
124     ~FloatConfigControl();
125     virtual float GetFloatValue();
126 private:
127     wxTextCtrl *textctrl;
128 };
129
130 class BoolConfigControl: public ConfigControl
131 {
132 public:
133     BoolConfigControl( module_config_t *p_item, wxWindow *parent );
134     ~BoolConfigControl();
135     virtual int GetIntValue();
136 private:
137     wxCheckBox *checkbox;
138 };
139