1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 the VideoLAN team
7 * Authors: Eric Petit <titer@m0k.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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 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 VTextView : public BTextView
39 VTextView( BRect frame, const char *name,
40 uint32 resizingMode, uint32 flags );
41 void FrameResized( float width, float height );
44 class VTextControl : public BTextControl
47 VTextControl( BRect frame, const char *name,
48 const char *label, const char *text,
49 BMessage * message, uint32 resizingMode );
50 void FrameResized( float width, float height );
53 class ConfigWidget : public BView
56 ConfigWidget( intf_thread_t * p_intf, BRect rect,
57 module_config_t * p_item );
59 bool InitCheck() { return fInitOK; }
60 void Apply( bool doIt );
63 intf_thread_t * p_intf;
69 VTextControl * fTextControl;
70 BCheckBox * fCheckBox;
71 BPopUpMenu * fPopUpMenu;
72 BMenuField * fMenuField;
74 BStringView * fStringView;
75 BCheckBox * fAltCheck;
76 BCheckBox * fCtrlCheck;
77 BCheckBox * fShiftCheck;
80 class ConfigItem : public BStringItem
83 ConfigItem( intf_thread_t * p_intf,
84 char * name, bool subModule,
85 int objectId, int type, char * help );
87 int ObjectId() { return fObjectId; }
88 BBox * Box() { return fBox; }
89 void UpdateScrollBar();
91 void Apply( bool doIt );
94 intf_thread_t * p_intf;
102 VTextView * fTextView;
103 BScrollView * fScroll;
107 class PreferencesWindow : public BWindow
110 PreferencesWindow( intf_thread_t * p_intf,
113 virtual ~PreferencesWindow();
115 virtual bool QuitRequested();
116 virtual void MessageReceived(BMessage* message);
117 virtual void FrameResized( float, float );
120 void Apply( bool doIt );
125 void BuildConfigView( ConfigItem * stringItem,
126 module_config_t ** pp_item,
127 bool stop_after_category );
130 BOutlineListView * fOutline;
132 ConfigItem * fCurrent;
134 intf_thread_t * p_intf;
137 #endif // BEOS_PREFERENCES_WINDOW_H