]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/complete_preferences.hpp
Hide module_t
[vlc] / modules / gui / qt4 / components / complete_preferences.hpp
1 /*****************************************************************************
2  * preferences_tree.hpp : Tree of modules for preferences
3  ****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
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.
13  *
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.
18  *
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  *****************************************************************************/
23
24 #ifndef _PREFSTREE_H_
25 #define _PREFSTREE_H_
26
27 #include <vlc/vlc.h>
28 #include <vlc_interface.h>
29
30 #include <QTreeWidget>
31
32 enum
33 {
34     TYPE_CATEGORY,
35     TYPE_CATSUBCAT,
36     TYPE_SUBCATEGORY,
37     TYPE_MODULE
38 };
39
40 class AdvPrefsPanel;
41 class QLabel;
42 class QVBoxLayout;
43
44 class PrefsItemData : public QObject
45 {
46 public:
47     PrefsItemData()
48     { panel = NULL; i_object_id = 0; i_subcat_id = -1; psz_name = NULL; };
49     virtual ~PrefsItemData() { free( psz_name ); };
50     AdvPrefsPanel *panel;
51     int i_object_id;
52     int i_subcat_id;
53     int i_type;
54     char *psz_name;
55     QString name;
56     QString help;
57 };
58
59 Q_DECLARE_METATYPE( PrefsItemData* );
60
61 class PrefsTree : public QTreeWidget
62 {
63     Q_OBJECT;
64 public:
65     PrefsTree( intf_thread_t *, QWidget * );
66     virtual ~PrefsTree();
67
68     void applyAll();
69     void cleanAll();
70
71 private:
72     void doAll( bool );
73     intf_thread_t *p_intf;
74 };
75
76 class ConfigControl;
77
78 class AdvPrefsPanel : public QWidget
79 {
80     Q_OBJECT
81 public:
82     AdvPrefsPanel( intf_thread_t *, QWidget *, PrefsItemData * );
83     AdvPrefsPanel( QWidget *);
84     virtual ~AdvPrefsPanel() {};
85     void apply();
86     void clean();
87 private:
88     intf_thread_t *p_intf;
89     QList<ConfigControl *> controls;
90     QVBoxLayout *global_layout;
91 };
92
93 #endif