]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/preferences.hpp
913d38c7b5e44654b071e8c4d6230f651b8d2e4d
[vlc] / modules / gui / qt4 / components / preferences.hpp
1 /*****************************************************************************
2  * preferences_tree.hpp : Tree of modules for preferences
3  ****************************************************************************
4  * Copyright (C) 2000-2005 the VideoLAN team
5  * $Id: wxwidgets.cpp 15731 2006-05-25 14:43:53Z zorglub $
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 <QTreeWidget>
28 #include <vlc/vlc.h>
29 #include <vlc/intf.h>
30
31 enum
32 {
33     TYPE_CATEGORY,
34     TYPE_CATSUBCAT,
35     TYPE_SUBCATEGORY,
36     TYPE_MODULE
37 };
38
39 class PrefsPanel;
40 class QLabel;
41 class QVBoxLayout;
42
43 class PrefsItemData : public QObject
44 {
45 public:
46     PrefsItemData()
47     { panel = NULL; i_object_id = 0; i_subcat_id = -1; };
48     virtual ~PrefsItemData() {};
49     PrefsPanel *panel;
50     int i_object_id;
51     int i_subcat_id;
52     int i_type;
53     bool b_submodule;
54     QString name;
55     QString help;
56 };
57
58 Q_DECLARE_METATYPE( PrefsItemData* );
59
60 class PrefsTree : public QTreeWidget
61 {
62     Q_OBJECT;
63 public:
64     PrefsTree( intf_thread_t *, QWidget * );
65     virtual ~PrefsTree();
66
67     void ApplyAll();
68     void CleanAll();
69
70 private:
71     void DoAll( bool );
72     intf_thread_t *p_intf;
73 };
74
75 class ConfigControl;
76
77 class PrefsPanel : public QWidget
78 {
79     Q_OBJECT
80 public:
81     PrefsPanel( intf_thread_t *, QWidget *, PrefsItemData * );
82     PrefsPanel( QWidget *);
83     virtual ~PrefsPanel() {};
84     void Apply();
85     void Clean();
86 private:
87     intf_thread_t *p_intf;
88     QList<ConfigControl *> controls;
89     QLabel *some_hidden_text;
90     QVBoxLayout *global_layout;
91     bool advanced;
92 public slots:
93     void setAdvanced( bool );
94 };
95
96 #endif