1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 1999, 2000, 2001 VideoLAN
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., 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 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 );
58 bool InitCheck() { return fInitOK; }
59 void Apply( bool doIt );
62 intf_thread_t * p_intf;
65 VTextControl * fTextControl;
66 BCheckBox * fCheckBox;
67 BPopUpMenu * fPopUpMenu;
68 BMenuField * fMenuField;
70 BStringView * fStringView;
71 BCheckBox * fAltCheck;
72 BCheckBox * fCtrlCheck;
73 BCheckBox * fShiftCheck;
76 class ConfigItem : public BStringItem
79 ConfigItem( intf_thread_t * p_intf,
80 char * name, bool subModule,
81 int objectId, int type, char * help );
83 int ObjectId() { return fObjectId; }
84 BBox * Box() { return fBox; }
85 void UpdateScrollBar();
87 void Apply( bool doIt );
90 intf_thread_t * p_intf;
98 VTextView * fTextView;
99 BScrollView * fScroll;
103 class PreferencesWindow : public BWindow
106 PreferencesWindow( intf_thread_t * p_intf,
109 virtual ~PreferencesWindow();
111 virtual bool QuitRequested();
112 virtual void MessageReceived(BMessage* message);
113 virtual void FrameResized( float, float );
116 void ApplyChanges( bool doIt );
122 void BuildConfigView( ConfigItem * stringItem,
123 module_config_t ** pp_item,
124 bool stop_after_category );
127 BOutlineListView * fOutline;
129 ConfigItem * fCurrent;
131 intf_thread_t * p_intf;
134 #endif // BEOS_PREFERENCES_WINDOW_H