complete_preferences.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * preferences_tree.hpp : Tree of modules for preferences
00003  ****************************************************************************
00004  * Copyright (C) 2006-2007 the VideoLAN team
00005  * $Id: 32ad1896b8e0c5ed91449ef802a0c51ff4ad3a3c $
00006  *
00007  * Authors: Clément Stenac <zorglub@videolan.org>
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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef _PREFSTREE_H_
00025 #define _PREFSTREE_H_
00026 
00027 #ifdef HAVE_CONFIG_H
00028 # include "config.h"
00029 #endif
00030 
00031 #include <vlc_common.h>
00032 #include <vlc_interface.h>
00033 
00034 #include <QTreeWidget>
00035 
00036 enum
00037 {
00038     TYPE_CATEGORY,
00039     TYPE_CATSUBCAT,
00040     TYPE_SUBCATEGORY,
00041     TYPE_MODULE
00042 };
00043 
00044 class AdvPrefsPanel;
00045 class QLabel;
00046 class QVBoxLayout;
00047 
00048 class PrefsItemData : public QObject
00049 {
00050 public:
00051     PrefsItemData()
00052     { panel = NULL; i_object_id = 0; i_subcat_id = -1; psz_name = NULL; };
00053     virtual ~PrefsItemData() { free( psz_name ); };
00054     AdvPrefsPanel *panel;
00055     int i_object_id;
00056     int i_subcat_id;
00057     int i_type;
00058     char *psz_name;
00059     QString name;
00060     QString help;
00061 };
00062 
00063 Q_DECLARE_METATYPE( PrefsItemData* );
00064 
00065 class PrefsTree : public QTreeWidget
00066 {
00067     Q_OBJECT
00068 public:
00069     PrefsTree( intf_thread_t *, QWidget * );
00070     virtual ~PrefsTree();
00071 
00072     void applyAll();
00073     void cleanAll();
00074 
00075 private:
00076     void doAll( bool );
00077     intf_thread_t *p_intf;
00078 };
00079 
00080 class ConfigControl;
00081 
00082 class AdvPrefsPanel : public QWidget
00083 {
00084     Q_OBJECT
00085 public:
00086     AdvPrefsPanel( intf_thread_t *, QWidget *, PrefsItemData * );
00087     AdvPrefsPanel( QWidget *);
00088     virtual ~AdvPrefsPanel();
00089     void apply();
00090     void clean();
00091 private:
00092     intf_thread_t *p_intf;
00093     QList<ConfigControl *> controls;
00094     QVBoxLayout *global_layout;
00095 };
00096 
00097 #endif

Generated on Tue May 25 08:04:57 2010 for VLC by  doxygen 1.5.6