]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/infopanels.hpp
Use QLineEdit+inputMask instead of QSpinBox, still some alignment issue
[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  *
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
33 #ifdef HAVE_LIMITS_H
34 #   include <limits.h>
35 #endif
36
37 #define setSpinBounds( spinbox ) {               \
38     spinbox->setRange( 0, INT_MAX );             \
39     spinbox->setAccelerated( true ) ;            \
40     spinbox->setAlignment( Qt::AlignRight );     \
41     spinbox->setSpecialValueText(""); }
42
43 class QTreeWidget;
44 class QTreeWidgetItem;
45 class QTreeView;
46 class QSpinBox;
47 class QLineEdit;
48 class QLabel;
49
50 class MetaPanel: public QWidget
51 {
52     Q_OBJECT;
53 public:
54     MetaPanel( QWidget *, intf_thread_t * );
55     virtual ~MetaPanel();
56     void saveMeta();
57     void setInput( input_item_t * );
58     void setEdit( bool );
59 private:
60     input_item_t *p_input;
61     intf_thread_t *p_intf;
62     QLineEdit *uri_text;
63     QLineEdit *title_text;
64     QLineEdit *artist_text;
65     QLineEdit *genre_text;
66 //    QLineEdit *copyright_text;
67     QLineEdit *collection_text;
68     QLineEdit *seqnum_text;
69 //    QLineEdit *description_text;
70     QSpinBox *rating_text;
71     QLineEdit *date_text;
72 //    QLineEdit *setting_text;
73     QLineEdit *language_text;
74 //    QLineEdit *nowplaying_text;
75 //    QLineEdit *publisher_text;
76 //    QLineEdit *encodedby_text;
77     QLabel *art_cover;
78     bool in_edit;
79
80 public slots:
81     void update( input_item_t * );
82     void clear();
83     void editMeta( QString );
84 signals:
85     void uriSet( QString );
86     void editing();
87 };
88
89 class ExtraMetaPanel: public QWidget
90 {
91     Q_OBJECT;
92 public:
93     ExtraMetaPanel( QWidget *, intf_thread_t * );
94     virtual  ~ExtraMetaPanel() {};
95 private:
96     intf_thread_t *p_intf;
97     QTreeWidget *extraMetaTree;
98 public slots:
99     void update( input_item_t * );
100     void clear();
101 };
102
103 class InputStatsPanel: public QWidget
104 {
105     Q_OBJECT;
106 public:
107     InputStatsPanel( QWidget *, intf_thread_t * );
108     virtual ~InputStatsPanel();
109 private:
110     intf_thread_t *p_intf;
111
112     QTreeWidget *StatsTree;
113     QTreeWidgetItem *input;
114     QTreeWidgetItem *read_media_stat;
115     QTreeWidgetItem *input_bitrate_stat;
116     QTreeWidgetItem *demuxed_stat;
117     QTreeWidgetItem *stream_bitrate_stat;
118
119     QTreeWidgetItem *video;
120     QTreeWidgetItem *vdecoded_stat;
121     QTreeWidgetItem *vdisplayed_stat;
122     QTreeWidgetItem *vlost_frames_stat;
123
124     QTreeWidgetItem *streaming;
125     QTreeWidgetItem *send_stat;
126     QTreeWidgetItem *send_bytes_stat;
127     QTreeWidgetItem *send_bitrate_stat;
128
129     QTreeWidgetItem *audio;
130     QTreeWidgetItem *adecoded_stat;
131     QTreeWidgetItem *aplayed_stat;
132     QTreeWidgetItem *alost_stat;
133
134 public slots:
135     void update( input_item_t * );
136     void clear();
137 };
138
139 class InfoPanel: public QWidget
140 {
141     Q_OBJECT;
142 public:
143     InfoPanel( QWidget *, intf_thread_t * );
144     virtual ~InfoPanel();
145 private:
146     intf_thread_t *p_intf;
147     QTreeWidget *InfoTree;
148 public slots:
149     void update( input_item_t * );
150     void clear();
151 };
152 #endif