]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/info_panels.hpp
Qt: respect font sizes
[vlc] / modules / gui / qt4 / components / info_panels.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 #ifdef HAVE_CONFIG_H
30 # include "config.h"
31 #endif
32
33 #include <vlc_common.h>
34 #include <vlc_meta.h>
35
36 #include <QWidget>
37
38 #include <limits.h>
39
40 #define setSpinBounds( spinbox ) {               \
41     spinbox->setRange( 0, INT_MAX );             \
42     spinbox->setAccelerated( true ) ;            \
43     spinbox->setAlignment( Qt::AlignRight );     \
44     spinbox->setSpecialValueText(""); }
45
46 class QTreeWidget;
47 class QTreeWidgetItem;
48 class QTreeView;
49 class QSpinBox;
50 class QLineEdit;
51 class CoverArtLabel;
52
53 class MetaPanel: public QWidget
54 {
55     Q_OBJECT;
56 public:
57     MetaPanel( QWidget *, struct intf_thread_t * );
58     void saveMeta();
59
60     bool isInEditMode();
61     void setEditMode( bool );
62
63 private:
64     input_item_t *p_input;
65     struct intf_thread_t *p_intf;
66     bool b_inEditMode;
67
68     QLineEdit *title_text;
69     QLineEdit *artist_text;
70     QLineEdit *genre_text;
71     QLineEdit *copyright_text;
72     QLineEdit *collection_text;
73     QLineEdit *seqnum_text;
74     QLineEdit *description_text;
75 //    QSpinBox *rating_text;
76     QLineEdit *date_text;
77 //    QLineEdit *setting_text;
78     QLineEdit *language_text;
79     QLineEdit *nowplaying_text;
80     QLineEdit *publisher_text;
81 //    QLineEdit *encodedby_text;
82     CoverArtLabel *art_cover;
83
84 public slots:
85     void update( input_item_t * );
86     void clear();
87
88 private slots:
89     void enterEditMode();
90
91 signals:
92     void uriSet( const QString& );
93     void editing();
94 };
95
96 class ExtraMetaPanel: public QWidget
97 {
98     Q_OBJECT;
99 public:
100     ExtraMetaPanel( QWidget *, struct intf_thread_t * );
101 private:
102     struct intf_thread_t *p_intf;
103     QTreeWidget *extraMetaTree;
104 public slots:
105     void update( input_item_t * );
106     void clear();
107 };
108
109 class InputStatsPanel: public QWidget
110 {
111     Q_OBJECT;
112 public:
113     InputStatsPanel( QWidget *, struct intf_thread_t * );
114 private:
115     struct intf_thread_t *p_intf;
116
117     QTreeWidget *StatsTree;
118     QTreeWidgetItem *input;
119     QTreeWidgetItem *read_media_stat;
120     QTreeWidgetItem *input_bitrate_stat;
121     QTreeWidgetItem *demuxed_stat;
122     QTreeWidgetItem *stream_bitrate_stat;
123     QTreeWidgetItem *corrupted_stat;
124     QTreeWidgetItem *discontinuity_stat;
125
126     QTreeWidgetItem *video;
127     QTreeWidgetItem *vdecoded_stat;
128     QTreeWidgetItem *vdisplayed_stat;
129     QTreeWidgetItem *vlost_frames_stat;
130     QTreeWidgetItem *vfps_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 *, struct intf_thread_t * );
152 private:
153     struct intf_thread_t *p_intf;
154     QTreeWidget *InfoTree;
155 public slots:
156     void update( input_item_t * );
157     void clear();
158 };
159
160 #endif