]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/infopanels.hpp
Qt4 - New icons for extended preferences.
[vlc] / 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  *          Ilkka Ollakka <ileoo@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 #ifndef _INFOPANELS_H_
27 #define _INFOPANELS_H_
28
29 #include <vlc/vlc.h>
30 #include <vlc_meta.h>
31
32 #include <QWidget>
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 class QLabel;
50
51 class MetaPanel: public QWidget
52 {
53     Q_OBJECT;
54 public:
55     MetaPanel( QWidget *, intf_thread_t * );
56     virtual ~MetaPanel();
57     void saveMeta();
58     void setInput( input_item_t * );
59  
60     bool isInEditMode();
61     void setEditMode( bool );
62
63 private:
64     input_item_t *p_input;
65     intf_thread_t *p_intf;
66     bool b_inEditMode;
67
68     QLineEdit *uri_text;
69     QLineEdit *title_text;
70     QLineEdit *artist_text;
71     QLineEdit *genre_text;
72     QLineEdit *copyright_text;
73     QLineEdit *collection_text;
74     QLineEdit *seqnum_text;
75     QLineEdit *description_text;
76 //    QSpinBox *rating_text;
77     QLineEdit *date_text;
78 //    QLineEdit *setting_text;
79     QLineEdit *language_text;
80     QLineEdit *nowplaying_text;
81     QLineEdit *publisher_text;
82 //    QLineEdit *encodedby_text;
83     QLabel *art_cover;
84
85 public slots:
86     void update( input_item_t * );
87     void clear();
88
89 private slots:
90     void enterEditMode();
91  
92 signals:
93     void uriSet( QString );
94     void editing();
95 };
96
97 class ExtraMetaPanel: public QWidget
98 {
99     Q_OBJECT;
100 public:
101     ExtraMetaPanel( QWidget *, intf_thread_t * );
102     virtual  ~ExtraMetaPanel() {};
103 private:
104     intf_thread_t *p_intf;
105     QTreeWidget *extraMetaTree;
106 public slots:
107     void update( input_item_t * );
108     void clear();
109 };
110
111 class InputStatsPanel: public QWidget
112 {
113     Q_OBJECT;
114 public:
115     InputStatsPanel( QWidget *, intf_thread_t * );
116     virtual ~InputStatsPanel();
117 private:
118     intf_thread_t *p_intf;
119
120     QTreeWidget *StatsTree;
121     QTreeWidgetItem *input;
122     QTreeWidgetItem *read_media_stat;
123     QTreeWidgetItem *input_bitrate_stat;
124     QTreeWidgetItem *demuxed_stat;
125     QTreeWidgetItem *stream_bitrate_stat;
126
127     QTreeWidgetItem *video;
128     QTreeWidgetItem *vdecoded_stat;
129     QTreeWidgetItem *vdisplayed_stat;
130     QTreeWidgetItem *vlost_frames_stat;
131
132     QTreeWidgetItem *streaming;
133     QTreeWidgetItem *send_stat;
134     QTreeWidgetItem *send_bytes_stat;
135     QTreeWidgetItem *send_bitrate_stat;
136
137     QTreeWidgetItem *audio;
138     QTreeWidgetItem *adecoded_stat;
139     QTreeWidgetItem *aplayed_stat;
140     QTreeWidgetItem *alost_stat;
141
142 public slots:
143     void update( input_item_t * );
144     void clear();
145 };
146
147 class InfoPanel: public QWidget
148 {
149     Q_OBJECT;
150 public:
151     InfoPanel( QWidget *, intf_thread_t * );
152     virtual ~InfoPanel();
153 private:
154     intf_thread_t *p_intf;
155     QTreeWidget *InfoTree;
156 public slots:
157     void update( input_item_t * );
158     void clear();
159 };
160 #endif