]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/complete_preferences.hpp
Qt4 - Prefs; cleaning, disabling unused code, general comments, class renaming, in...
[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     bool b_submodule;
55     char *psz_name;
56     QString name;
57     QString help;
58 };
59
60 Q_DECLARE_METATYPE( PrefsItemData* );
61
62 class PrefsTree : public QTreeWidget
63 {
64     Q_OBJECT;
65 public:
66     PrefsTree( intf_thread_t *, QWidget * );
67     virtual ~PrefsTree();
68
69     void applyAll();
70     void cleanAll();
71
72 private:
73     void doAll( bool );
74     intf_thread_t *p_intf;
75 };
76
77 class ConfigControl;
78
79 class AdvPrefsPanel : public QWidget
80 {
81     Q_OBJECT
82 public:
83     AdvPrefsPanel( intf_thread_t *, QWidget *, PrefsItemData * );
84     AdvPrefsPanel( QWidget *);
85     virtual ~AdvPrefsPanel() {};
86     void apply();
87     void clean();
88 private:
89     intf_thread_t *p_intf;
90     QList<ConfigControl *> controls;
91     QVBoxLayout *global_layout;
92 };
93
94 #endif