]> git.sesse.net Git - vlc/blob - modules/gui/qt4/main_interface.hpp
Qt4 : build fix.
[vlc] / modules / gui / qt4 / main_interface.hpp
1 /*****************************************************************************
2  * main_interface.hpp : Main Interface
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 _MAIN_INTERFACE_H_
26 #define _MAIN_INTERFACE_H_
27
28
29 #include "qt4.hpp"
30 #include "util/qvlcframe.hpp"
31
32 #include <vlc_aout.h>
33
34 #include <QSystemTrayIcon>
35
36 class QSettings;
37 class QCloseEvent;
38 class QKeyEvent;
39 class QLabel;
40 class QEvent;
41 class InputManager;
42 class VideoWidget;
43 class BackgroundWidget;
44 class PlaylistWidget;
45 class VisualSelector;
46 class AdvControlsWidget;
47 class ControlsWidget;
48 class QMenu;
49 class QSize;
50
51 class MainInterface : public QVLCMW
52 {
53     Q_OBJECT;
54 public:
55     MainInterface( intf_thread_t *);
56     virtual ~MainInterface();
57     void *requestVideo( vout_thread_t *p_nvout, int *pi_x,
58                         int *pi_y, unsigned int *pi_width,
59                         unsigned int *pi_height );
60     void releaseVideo( void *);
61     int controlVideo( void *p_window, int i_query, va_list args );
62
63     QSystemTrayIcon *getSysTray() { return sysTray; };
64     QMenu *getSysTrayMenu() { return systrayMenu; };
65 protected:
66     void resizeEvent( QResizeEvent * );
67     void dropEvent( QDropEvent *);
68     void dragEnterEvent( QDragEnterEvent * );
69     void dragMoveEvent( QDragMoveEvent * );
70     void dragLeaveEvent( QDragLeaveEvent * );
71     void closeEvent( QCloseEvent *);
72     //Ui::MainInterfaceUI ui;
73     friend class VolumeClickHandler;
74 private:
75     QSettings *settings;
76     QSize mainSize, addSize;
77     QSystemTrayIcon *sysTray;
78     QMenu *systrayMenu;
79     QString input_name;
80     QVBoxLayout *mainLayout;
81     ControlsWidget *controls;
82
83     bool need_components_update;
84     void calculateInterfaceSize();
85     void handleMainUi( QSettings* );
86     void handleSystray();
87     void doComponentsUpdate();
88     void createSystray();
89
90     /* Video */
91     VideoWidget         *videoWidget;
92     virtual void keyPressEvent( QKeyEvent *);
93     virtual void wheelEvent( QWheelEvent * );
94
95     bool embeddedPlaylistWasActive;
96     bool videoIsActive;
97     QSize savedVideoSize;
98
99
100     BackgroundWidget    *bgWidget;
101     VisualSelector      *visualSelector;
102     AdvControlsWidget      *advControls;
103     PlaylistWidget      *playlistWidget;
104
105     bool                 playlistEmbeddedFlag;
106     bool                 videoEmbeddedFlag;
107     bool                 alwaysVideoFlag;
108     bool                 advControlsEnabled;
109     bool                 visualSelectorEnabled;
110
111     InputManager        *main_input_manager;
112     input_thread_t      *p_input;    ///< Main input associated to the playlist
113
114     QLabel              *timeLabel;
115     QLabel              *speedLabel;
116     QLabel              *nameLabel;
117
118     void customEvent( QEvent *);
119 public slots:
120     void undockPlaylist();
121     void toggleMenus();
122     void playlist();
123     void toggleUpdateSystrayMenu();
124 private slots:
125     void setStatus( int );
126     void setName( QString );
127     void setVLCWindowsTitle( QString title = "" );
128     void setDisplay( float, int, int );
129     void updateOnTimer();
130     void visual();
131     void advanced();
132     void handleSystrayClick(  QSystemTrayIcon::ActivationReason );
133     void updateSystrayMenu( int );
134     void updateSystrayTooltipName( QString );
135     void updateSystrayTooltipStatus( int );
136     void showSpeedMenu( QPoint );
137     void showTimeMenu( QPoint );
138 };
139
140 #endif