Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

preferences_widgets.h

00001 /*****************************************************************************
00002  * preferences_widgets.h : wxWindows plugin for vlc
00003  *****************************************************************************
00004  * Copyright (C) 2000-2003 the VideoLAN team
00005  * $Id: preferences_widgets.h 12836 2005-10-15 13:23:08Z sigmunau $
00006  *
00007  * Authors: Sigmund Augdal Helberg <[email protected]>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00022  *****************************************************************************/
00023 
00024 #include <vector>
00025 
00026 class ConfigControl: public wxPanel
00027 {
00028 public:
00029     ConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00030     ~ConfigControl();
00031     wxSizer *Sizer();
00032 
00033     virtual int GetIntValue() {return 0;}
00034     virtual float GetFloatValue() {return 0;}
00035     virtual wxString GetPszValue() {return wxString();}
00036 
00037     wxString GetName();
00038     int GetType();
00039     vlc_bool_t IsAdvanced();
00040 
00041     void SetUpdateCallback( void (*)( void * ), void * );
00042 
00043 protected:
00044     wxBoxSizer *sizer;
00045     wxStaticText *label;
00046     vlc_object_t *p_this;
00047 
00048     void (*pf_update_callback)( void * );
00049     void *p_update_data;
00050 
00051     void OnUpdate( wxCommandEvent& event );
00052     void OnUpdateScroll( wxScrollEvent& event );
00053 
00054 private:
00055     wxString name;
00056     int i_type;
00057     vlc_bool_t b_advanced;
00058 };
00059 
00060 ConfigControl *CreateConfigControl( vlc_object_t *,
00061                                     module_config_t *, wxWindow * );
00062 
00063 class KeyConfigControl: public ConfigControl
00064 {
00065 public:
00066     KeyConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00067     ~KeyConfigControl();
00068     virtual int GetIntValue();
00069 private:
00070     wxCheckBox *alt;
00071     wxCheckBox *ctrl;
00072     wxCheckBox *shift;
00073     wxComboBox *combo;
00074     // Array of key descriptions, for the ComboBox
00075     static wxString *m_keysList;
00076 };
00077 
00078 class ModuleConfigControl: public ConfigControl
00079 {
00080 public:
00081     ModuleConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00082     ~ModuleConfigControl();
00083     virtual wxString GetPszValue();
00084 private:
00085     wxComboBox *combo;
00086 };
00087 
00088 struct moduleCheckBox {
00089     wxCheckBox *checkbox;
00090     char *psz_module;
00091 };
00092 
00093 class ModuleCatConfigControl: public ConfigControl
00094 {
00095 public:
00096     ModuleCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00097     ~ModuleCatConfigControl();
00098     virtual wxString GetPszValue();
00099 private:
00100     wxComboBox *combo;
00101 };
00102 
00103 
00104 class ModuleListCatConfigControl: public ConfigControl
00105 {
00106 public:
00107     ModuleListCatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00108     ~ModuleListCatConfigControl();
00109     virtual wxString GetPszValue();
00110 private:
00111     std::vector<moduleCheckBox *> pp_checkboxes;
00112 
00113     void OnUpdate( wxCommandEvent& );
00114 
00115     wxTextCtrl *text;
00116     DECLARE_EVENT_TABLE()
00117 };
00118 
00119 ;
00120 
00121 class StringConfigControl: public ConfigControl
00122 {
00123 public:
00124     StringConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00125     ~StringConfigControl();
00126     virtual wxString GetPszValue();
00127 private:
00128     wxTextCtrl *textctrl;
00129 
00130     DECLARE_EVENT_TABLE()
00131 };
00132 
00133 class StringListConfigControl: public ConfigControl
00134 {
00135 public:
00136     StringListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00137     ~StringListConfigControl();
00138     virtual wxString GetPszValue();
00139 private:
00140     wxComboBox *combo;
00141     char *psz_default_value;
00142     void UpdateCombo( module_config_t *p_item );
00143 
00144     void OnAction( wxCommandEvent& );
00145 
00146     DECLARE_EVENT_TABLE()
00147 };
00148 
00149 class FileConfigControl: public ConfigControl
00150 {
00151 public:
00152     FileConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00153     ~FileConfigControl();
00154     void OnBrowse( wxCommandEvent& );
00155     virtual wxString GetPszValue();
00156 private:
00157     wxTextCtrl *textctrl;
00158     wxButton *browse;
00159     bool directory;
00160 
00161     DECLARE_EVENT_TABLE()
00162 };
00163 
00164 class IntegerConfigControl: public ConfigControl
00165 {
00166 public:
00167     IntegerConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00168     ~IntegerConfigControl();
00169     virtual int GetIntValue();
00170 private:
00171     wxSpinCtrl *spin;
00172     int i_value;
00173 
00174     void OnUpdate( wxCommandEvent& event );
00175     void OnUpdateScroll( wxScrollEvent& event );
00176 
00177     DECLARE_EVENT_TABLE()
00178 };
00179 
00180 class IntegerListConfigControl: public ConfigControl
00181 {
00182 public:
00183     IntegerListConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00184     ~IntegerListConfigControl();
00185     virtual int GetIntValue();
00186 private:
00187     wxComboBox *combo;
00188     void UpdateCombo( module_config_t *p_item );
00189 
00190     void OnAction( wxCommandEvent& );
00191 
00192     DECLARE_EVENT_TABLE()
00193 };
00194 
00195 class RangedIntConfigControl: public ConfigControl
00196 {
00197 public:
00198     RangedIntConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00199     ~RangedIntConfigControl();
00200     virtual int GetIntValue();
00201 private:
00202     wxSlider *slider;
00203 
00204     DECLARE_EVENT_TABLE()
00205 };
00206 
00207 class FloatConfigControl: public ConfigControl
00208 {
00209 public:
00210     FloatConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00211     ~FloatConfigControl();
00212     virtual float GetFloatValue();
00213 private:
00214     wxTextCtrl *textctrl;
00215 
00216     DECLARE_EVENT_TABLE()
00217 };
00218 
00219 class BoolConfigControl: public ConfigControl
00220 {
00221 public:
00222     BoolConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00223     ~BoolConfigControl();
00224     virtual int GetIntValue();
00225 private:
00226     wxCheckBox *checkbox;
00227 
00228     DECLARE_EVENT_TABLE()
00229 };
00230 
00231 class SectionConfigControl: public ConfigControl
00232 {
00233 public:
00234     SectionConfigControl( vlc_object_t *, module_config_t *, wxWindow * );
00235     ~SectionConfigControl();
00236 };

Generated on Tue Dec 20 10:14:46 2005 for vlc-0.8.4a by  doxygen 1.4.2