1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
7 * Authors: Eric Petit <titer@videolan.org>
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 #ifndef BEOS_PREFERENCES_WINDOW_H
25 #define BEOS_PREFERENCES_WINDOW_H
27 #include <InterfaceKit.h>
29 #define PREFS_WINDOW_WIDTH 700
30 #define PREFS_WINDOW_HEIGHT 400
31 #define PREFS_ITEM_SELECTED 'pris'
32 #define PREFS_DEFAULTS 'prde'
33 #define PREFS_APPLY 'prap'
34 #define PREFS_SAVE 'prsa'
36 class StringItemWithView : public BStringItem
39 StringItemWithView( const char * text )
45 fText = strdup( text );
48 /* Here we store the config BBox associated to this module */
50 BScrollView * fConfigScroll;
55 class ConfigWidget : public BView
58 ConfigWidget( BRect rect, int type, char * configName );
59 virtual void Apply( intf_thread_t * p_intf, bool doIt ) = 0;
66 class ConfigTextControl : public ConfigWidget
69 ConfigTextControl( BRect rect, int type, char * label,
71 void Apply( intf_thread_t * p_intf, bool doIt );
74 BTextControl * fTextControl;
77 class ConfigCheckBox : public ConfigWidget
80 ConfigCheckBox( BRect rect, int type, char * label,
82 void Apply( intf_thread_t * p_intf, bool doIt );
85 BCheckBox * fCheckBox;
88 class ConfigMenuField : public ConfigWidget
91 ConfigMenuField( BRect rect, int type, char * label,
92 char * configName, char ** list );
93 void Apply( intf_thread_t * p_intf, bool doIt );
96 BPopUpMenu * fPopUpMenu;
97 BMenuField * fMenuField;
100 class ConfigSlider : public ConfigWidget
103 ConfigSlider( BRect rect, int type, char * label,
104 char * configName, int min, int max );
105 void Apply( intf_thread_t * p_intf, bool doIt );
111 class ConfigKey : public ConfigWidget
114 ConfigKey( BRect rect, int type, char * label,
116 void Apply( intf_thread_t * p_intf, bool doIt );
119 BStringView * fStringView;
120 BCheckBox * fAltCheck;
121 BCheckBox * fCtrlCheck;
122 BCheckBox * fShiftCheck;
123 BPopUpMenu * fPopUpMenu;
124 BMenuField * fMenuField;
127 class PreferencesWindow : public BWindow
130 PreferencesWindow( intf_thread_t * p_intf,
133 virtual ~PreferencesWindow();
135 virtual bool QuitRequested();
136 virtual void MessageReceived(BMessage* message);
137 virtual void FrameResized( float, float );
140 void UpdateScrollBar();
141 void ApplyChanges( bool doIt );
147 void BuildConfigView( StringItemWithView * stringItem,
148 module_config_t ** pp_item,
149 bool stop_after_category );
152 BOutlineListView * fOutline;
154 BScrollView * fConfigScroll;
155 StringItemWithView * fCurrent;
157 intf_thread_t * p_intf;
160 #endif // BEOS_PREFERENCES_WINDOW_H