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

PreferencesWindow.h

00001 /*****************************************************************************
00002  * PreferencesWindow.h
00003  *****************************************************************************
00004  * Copyright (C) 1999, 2000, 2001 the VideoLAN team
00005  * $Id: PreferencesWindow.h 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Eric Petit <[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 #ifndef BEOS_PREFERENCES_WINDOW_H
00025 #define BEOS_PREFERENCES_WINDOW_H
00026 
00027 #include <InterfaceKit.h>
00028 
00029 #define PREFS_WINDOW_WIDTH   700
00030 #define PREFS_WINDOW_HEIGHT  400
00031 #define PREFS_ITEM_SELECTED  'pris'
00032 #define PREFS_DEFAULTS       'prde'
00033 #define PREFS_APPLY          'prap'
00034 #define PREFS_SAVE           'prsa'
00035 
00036 class VTextView : public BTextView
00037 {
00038     public:
00039              VTextView( BRect frame, const char *name,
00040                         uint32 resizingMode, uint32 flags );
00041         void FrameResized( float width, float height );
00042 };
00043 
00044 class VTextControl : public BTextControl
00045 {
00046     public:
00047              VTextControl( BRect frame, const char *name,
00048                            const char *label, const char *text,
00049                            BMessage * message, uint32 resizingMode );
00050         void FrameResized( float width, float height );
00051 };
00052 
00053 class ConfigWidget : public BView
00054 {
00055     public:
00056                         ConfigWidget( intf_thread_t * p_intf, BRect rect,
00057                                       module_config_t * p_item );
00058                         ~ConfigWidget();
00059         bool            InitCheck() { return fInitOK; }
00060         void            Apply( bool doIt );
00061 
00062     private:
00063         intf_thread_t * p_intf;
00064 
00065         bool            fInitOK;
00066         int             fType;
00067         char          * fName;
00068 
00069         VTextControl  * fTextControl;
00070         BCheckBox     * fCheckBox;
00071         BPopUpMenu    * fPopUpMenu;
00072         BMenuField    * fMenuField;
00073         BSlider       * fSlider;
00074         BStringView   * fStringView;
00075         BCheckBox     * fAltCheck;
00076         BCheckBox     * fCtrlCheck;
00077         BCheckBox     * fShiftCheck;
00078 };
00079 
00080 class ConfigItem : public BStringItem
00081 {
00082     public:
00083                       ConfigItem( intf_thread_t * p_intf,
00084                                   char * name, bool subModule,
00085                                   int objectId, int type, char * help );
00086                       ~ConfigItem();
00087         int           ObjectId() { return fObjectId; }
00088         BBox        * Box() { return fBox; }
00089         void          UpdateScrollBar();
00090         void          ResetScroll();
00091         void          Apply( bool doIt );
00092 
00093     private:
00094         intf_thread_t * p_intf;
00095 
00096         bool            fSubModule;
00097         int             fObjectId;
00098         int             fType;
00099         char          * fHelp;
00100 
00101         BBox          * fBox;
00102         VTextView     * fTextView;
00103         BScrollView   * fScroll;
00104         BView         * fView;
00105 };
00106 
00107 class PreferencesWindow : public BWindow
00108 {
00109   public:
00110                             PreferencesWindow( intf_thread_t * p_intf,
00111                                                BRect frame,
00112                                                const char * name );
00113     virtual                 ~PreferencesWindow();
00114 
00115     virtual bool            QuitRequested();
00116     virtual void            MessageReceived(BMessage* message);
00117     virtual void            FrameResized( float, float );
00118 
00119             void            Update();
00120             void            Apply( bool doIt );
00121 
00122             void            ReallyQuit();
00123 
00124   private:
00125     void                    BuildConfigView( ConfigItem * stringItem,
00126                                              module_config_t ** pp_item,
00127                                              bool stop_after_category );
00128 
00129     BView                 * fPrefsView;
00130     BOutlineListView      * fOutline;
00131     BView                 * fDummyView;
00132     ConfigItem            * fCurrent;
00133 
00134     intf_thread_t         * p_intf;
00135 };
00136 
00137 #endif    // BEOS_PREFERENCES_WINDOW_H

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