Qt4 - Info Panels: Rewrite Meta Data and Dionoea's feature request. (1)
[vlc.git] / modules / gui / qt4 / components / infopanels.hpp
1 /*****************************************************************************
2  * infopanels.hpp : Panels for the information dialogs
3  ****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Baptiste Kempf <jb@videolan.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef _INFOPANELS_H_
26 #define _INFOPANELS_H_
27
28 #include <vlc/vlc.h>
29 #include <vlc_meta.h>
30
31 #include <QWidget>
32 #include <QTabWidget>
33
34 #ifdef HAVE_LIMITS_H
35 #   include <limits.h>
36 #endif
37
38 #define setSpinBounds( spinbox ) {               \
39     spinbox->setRange( 0, INT_MAX );             \
40     spinbox->setAccelerated( true ) ;            \
41     spinbox->setAlignment( Qt::AlignRight );     \
42     spinbox->setSpecialValueText(""); }
43
44 class QTreeWidget;
45 class QTreeWidgetItem;
46 class QTreeView;
47 class QSpinBox;
48 class QLineEdit;
49
50 class MetaPanel: public QWidget
51 {
52     Q_OBJECT;
53 public:
54     MetaPanel( QWidget *, intf_thread_t * );
55     virtual ~MetaPanel();
56 private:
57     intf_thread_t *p_intf;
58     QLineEdit *uri_text;
59     QLineEdit *title_text;
60     QLineEdit *artist_text;
61     QLineEdit *genre_text;
62     QLineEdit *copyright_text;
63     QLineEdit *collection_text;
64     QSpinBox *seqnum_text;
65     QLineEdit *description_text;
66     QSpinBox *rating_text;
67     QSpinBox *date_text;
68     QLineEdit *setting_text;
69     QLineEdit *language_text;
70     QLineEdit *nowplaying_text;
71     QLineEdit *publisher_text;
72
73 public slots:
74     void update( input_item_t * );
75     void clear();
76 };
77
78 class ExtraMetaPanel: public QWidget
79 {
80     Q_OBJECT;
81 public:
82     ExtraMetaPanel( QWidget *, intf_thread_t * );
83     virtual  ~ExtraMetaPanel() {};
84 private:
85     intf_thread_t *p_intf;
86     QTreeWidget *extraMetaTree;
87 public slots:
88     void update( input_item_t * );
89     void clear();
90 };
91
92 class InputStatsPanel: public QWidget
93 {
94     Q_OBJECT;
95 public:
96     InputStatsPanel( QWidget *, intf_thread_t * );
97     virtual ~InputStatsPanel();
98 private:
99     intf_thread_t *p_intf;
100
101     QTreeWidget *StatsTree;
102     QTreeWidgetItem *input;
103     QTreeWidgetItem *read_media_stat;
104     QTreeWidgetItem *input_bitrate_stat;
105     QTreeWidgetItem *demuxed_stat;
106     QTreeWidgetItem *stream_bitrate_stat;
107
108     QTreeWidgetItem *video;
109     QTreeWidgetItem *vdecoded_stat;
110     QTreeWidgetItem *vdisplayed_stat;
111     QTreeWidgetItem *vlost_frames_stat;
112
113     QTreeWidgetItem *streaming;
114     QTreeWidgetItem *send_stat;
115     QTreeWidgetItem *send_bytes_stat;
116     QTreeWidgetItem *send_bitrate_stat;
117
118     QTreeWidgetItem *audio;
119     QTreeWidgetItem *adecoded_stat;
120     QTreeWidgetItem *aplayed_stat;
121     QTreeWidgetItem *alost_stat;
122
123 public slots:
124     void update( input_item_t * );
125     void clear();
126 };
127
128 class InfoPanel: public QWidget
129 {
130     Q_OBJECT;
131 public:
132     InfoPanel( QWidget *, intf_thread_t * );
133     virtual ~InfoPanel();
134 private:
135     intf_thread_t *p_intf;
136     QTreeWidget *InfoTree;
137 public slots:
138     void update( input_item_t * );
139     void clear();
140 };
141
142 class InfoTab: public QTabWidget
143 {
144     Q_OBJECT;
145 public:
146     InfoTab( QWidget *, intf_thread_t *, bool );
147     virtual ~InfoTab();
148     void update( input_item_t *, bool, bool );
149     void clear();
150 private:
151     bool stats;
152     intf_thread_t *p_intf;
153     InputStatsPanel *ISP;
154     MetaPanel *MP;
155     InfoPanel *IP;
156     ExtraMetaPanel *EMP;
157     int i_runs;
158 };
159
160 #endif