]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/interface_widgets.hpp
Put the dock/undock back in the menu
[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  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _INTFWIDGETS_H_
25 #define _INTFWIDGETS_H_
26
27 #include <vlc/vlc.h>
28 #include <vlc/intf.h>
29
30 #include "qt4.hpp"
31
32 #include <QWidget>
33 #include <QFrame>
34 #include <QPalette>
35 #include <QResizeEvent>
36 #include <QPixmap>
37
38 class QLabel;
39 class QHBoxLayout;
40
41 /******************** Video Widget ****************/
42 class VideoWidget : public QFrame
43 {
44     Q_OBJECT
45 public:
46     VideoWidget( intf_thread_t * );
47     virtual ~VideoWidget();
48
49     void *request( vout_thread_t *, int *, int *,
50                    unsigned int *, unsigned int * );
51     void release( void * );
52     int control( void *, int, va_list );
53
54     int i_video_height, i_video_width;
55     vout_thread_t *p_vout;
56
57     QSize widgetSize;
58     virtual QSize sizeHint() const;
59 private:
60     QWidget *frame;
61     intf_thread_t *p_intf;
62     vlc_mutex_t lock;
63 };
64
65 /******************** Background Widget ****************/
66 class BackgroundWidget : public QFrame
67 {
68     Q_OBJECT
69 public:
70     BackgroundWidget( intf_thread_t * );
71     virtual ~BackgroundWidget();
72     QSize widgetSize;
73     virtual QSize sizeHint() const;
74 private:
75     QPalette plt;
76     QLabel *label;
77     QHBoxLayout *backgroundLayout;
78     virtual void resizeEvent( QResizeEvent *e );
79     int DrawBackground();
80     int CleanBackground();
81     intf_thread_t *p_intf;
82 };
83
84 class VisualSelector : public QFrame
85 {
86     Q_OBJECT
87 public:
88     VisualSelector( intf_thread_t *);
89     virtual ~VisualSelector();
90 private:
91     intf_thread_t *p_intf;
92 };
93
94 /******************** Playlist Widgets ****************/
95 #include <QModelIndex>
96 class QSignalMapper;
97 class PLSelector;
98 class PLPanel;
99 class QPushButton;
100
101 class PlaylistWidget : public BasePlaylistWidget
102 {
103     Q_OBJECT;
104 public:
105     PlaylistWidget( intf_thread_t * );
106     virtual ~PlaylistWidget();
107     QSize widgetSize;
108     virtual QSize sizeHint() const;
109 private:
110     PLSelector *selector;
111     PLPanel *rightPanel;
112     QPushButton *addButton;
113 signals:
114     void rootChanged( int );
115 };
116
117 #endif