]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/interface_widgets.hpp
Qt4 : remove useless files.
[vlc] / modules / gui / qt4 / components / interface_widgets.hpp
1 /*****************************************************************************
2  * interface_widgets.hpp : Custom widgets for the main interface
3  ****************************************************************************
4  * Copyright (C) 2006 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 _INTFWIDGETS_H_
26 #define _INTFWIDGETS_H_
27
28 #include <vlc/vlc.h>
29 #include <vlc_interface.h>
30
31 #include <vlc_aout.h>
32 #include "qt4.hpp"
33
34 #include <QWidget>
35 #include <QFrame>
36
37 class ResizeEvent;
38 class QPalette;
39 class QPixmap;
40 class QLabel;
41 class QHBoxLayout;
42
43 /******************** Video Widget ****************/
44 class VideoWidget : public QFrame
45 {
46     Q_OBJECT
47 public:
48     VideoWidget( intf_thread_t * );
49     virtual ~VideoWidget();
50
51     void *request( vout_thread_t *, int *, int *,
52                    unsigned int *, unsigned int * );
53     void release( void * );
54     int control( void *, int, va_list );
55
56     int i_video_height, i_video_width;
57     vout_thread_t *p_vout;
58
59     QSize widgetSize;
60     virtual QSize sizeHint() const;
61 private:
62     QWidget *frame;
63     intf_thread_t *p_intf;
64     vlc_mutex_t lock;
65 };
66
67 /******************** Background Widget ****************/
68 class BackgroundWidget : public QFrame
69 {
70     Q_OBJECT
71 public:
72     BackgroundWidget( intf_thread_t * );
73     virtual ~BackgroundWidget();
74     QSize widgetSize;
75     virtual QSize sizeHint() const;
76 private:
77     QPalette plt;
78     QLabel *label;
79     QHBoxLayout *backgroundLayout;
80     virtual void resizeEvent( QResizeEvent *e );
81     int DrawBackground();
82     int CleanBackground();
83     intf_thread_t *p_intf;
84 private slots:
85     void setArt( QString );
86 };
87
88 class VisualSelector : public QFrame
89 {
90     Q_OBJECT
91 public:
92     VisualSelector( intf_thread_t *);
93     virtual ~VisualSelector();
94 private:
95     intf_thread_t *p_intf;
96     QLabel *current;
97 private slots:
98     void prev();
99     void next();
100 };
101
102 class QPushButton;
103 class AdvControlsWidget : public QFrame
104 {
105     Q_OBJECT
106 public:
107     AdvControlsWidget( intf_thread_t *);
108     virtual ~AdvControlsWidget();
109     void enableInput( bool );
110     void enableVideo( bool );
111 private:
112     intf_thread_t *p_intf;
113     QPushButton *normalButton;
114     QPushButton *fullscreenButton, *snapshotButton;
115 private slots:
116     void normal();
117     void snapshot();
118     void fullscreen();
119 };
120
121 class InputSlider;
122 class QSlider;
123 class QGridLayout;
124 class VolumeClickHandler;
125 class ControlsWidget : public QFrame
126 {
127     Q_OBJECT
128 public:
129     ControlsWidget( intf_thread_t *);
130     virtual ~ControlsWidget();
131
132     QPushButton *playlistButton;
133     QSlider *volumeSlider;
134     void setStatus( int );
135     void enableInput( bool );
136 public slots:
137     void setNavigation( int );
138     void updateOnTimer();
139 protected:
140     friend class MainInterface;
141     friend class VolumeClickHandler;
142 private:
143     intf_thread_t *p_intf;
144     QFrame *discFrame;
145     QGridLayout *controlLayout;
146     InputSlider         *slider;
147     QPushButton *prevSectionButton, *nextSectionButton, *menuButton;
148     QPushButton *playButton;
149     QPushButton *slowerButton, *fasterButton;
150 private slots:
151     void play();
152     void stop();
153     void prev();
154     void next();
155     void updateVolume( int );
156     void fullscreen();
157     void extSettings();
158     void prefs();
159     void faster();
160     void slower();
161 };
162
163 class VolumeClickHandler : public QObject
164 {
165 public:
166     VolumeClickHandler( intf_thread_t *_p_intf, ControlsWidget *_m ) :QObject(_m)
167     {m = _m; p_intf = _p_intf; }
168     virtual ~VolumeClickHandler() {};
169     bool eventFilter( QObject *obj, QEvent *e )
170     {
171         if (e->type() == QEvent::MouseButtonPress )
172         {
173             aout_VolumeMute( p_intf, NULL );
174             return true;
175         }
176         return false;
177     }
178 private:
179     ControlsWidget *m;
180     intf_thread_t *p_intf;
181 };
182
183
184 /******************** Playlist Widgets ****************/
185 #include <QModelIndex>
186 #include <QSplitter>
187 class QSignalMapper;
188 class PLSelector;
189 class PLPanel;
190 class QPushButton;
191
192 class PlaylistWidget : public QSplitter
193 {
194     Q_OBJECT;
195 public:
196     PlaylistWidget( intf_thread_t *_p_i ) ;
197     virtual ~PlaylistWidget();
198     QSize widgetSize;
199     virtual QSize sizeHint() const;
200 private:
201     PLSelector *selector;
202     PLPanel *rightPanel;
203     QPushButton *addButton;
204     QLabel *art;
205     QString prevArt;
206 protected:
207      intf_thread_t *p_intf;
208 private slots:
209     void setArt( QString );
210 signals:
211     void rootChanged( int );
212     void artSet( QString );
213 };
214
215 #endif