]> git.sesse.net Git - vlc/blob - modules/gui/qt4/main_interface.hpp
Removed useless member.
[vlc] / modules / gui / qt4 / main_interface.hpp
1 /*****************************************************************************
2  * main_interface.hpp : Main Interface
3  ****************************************************************************
4  * Copyright (C) 2006-2008 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 #include "qt4.hpp"
29
30 #include "util/qvlcframe.hpp"
31 #include "components/preferences_widgets.hpp" /* First Start */
32
33 #include <QSystemTrayIcon>
34
35 class QSettings;
36 class QCloseEvent;
37 class QKeyEvent;
38 class QLabel;
39 class QEvent;
40 class InputManager;
41 class VideoWidget;
42 class BackgroundWidget;
43 class PlaylistWidget;
44 class VisualSelector;
45 class AdvControlsWidget;
46 class ControlsWidget;
47 class InputControlsWidget;
48 class FullscreenControllerWidget;
49 class SpeedControlWidget;
50 class QMenu;
51 class QSize;
52
53 enum {
54     CONTROLS_HIDDEN = 0x0,
55     CONTROLS_VISIBLE = 0x1,
56     CONTROLS_ADVANCED = 0x2
57 };
58
59 typedef enum pl_dock_e {
60     PL_UNDOCKED,
61     PL_BOTTOM,
62     PL_RIGHT,
63     PL_LEFT
64 } pl_dock_e;
65
66 class MainInterface : public QVLCMW
67 {
68     Q_OBJECT;
69
70     friend class InteractionDialog;
71     friend class PlaylistWidget;
72
73 public:
74     MainInterface( intf_thread_t *);
75     virtual ~MainInterface();
76
77     /* Video requests from core */
78     void *requestVideo( vout_thread_t *p_nvout, int *pi_x,
79                         int *pi_y, unsigned int *pi_width,
80                         unsigned int *pi_height );
81     void releaseVideo( void  );
82     int controlVideo( void *p_window, int i_query, va_list args );
83
84     /* Getters */
85     QSystemTrayIcon *getSysTray() { return sysTray; };
86     QMenu *getSysTrayMenu() { return systrayMenu; };
87     int getControlsVisibilityStatus();
88
89     /* Sizehint() */
90     virtual QSize sizeHint() const;
91
92 protected:
93 //    void resizeEvent( QResizeEvent * );
94     void dropEvent( QDropEvent *);
95     void dropEventPlay( QDropEvent *, bool);
96     void dragEnterEvent( QDragEnterEvent * );
97     void dragMoveEvent( QDragMoveEvent * );
98     void dragLeaveEvent( QDragLeaveEvent * );
99     void closeEvent( QCloseEvent *);
100
101 private:
102     QSettings           *settings;
103     QSystemTrayIcon     *sysTray;
104     QMenu               *systrayMenu;
105     QString              input_name;
106     QVBoxLayout         *mainLayout;
107     ControlsWidget      *controls;
108     InputControlsWidget *inputC;
109     FullscreenControllerWidget *fullscreenControls;
110
111     void handleMainUi( QSettings* );
112     void askForPrivacy();
113     int  privacyDialog( QList<ConfigControl *> *controls );
114
115     /* Systray */
116     void handleSystray();
117     void createSystray();
118     void initSystray();
119
120     void createStatusBar();
121
122     /* Video */
123     VideoWidget         *videoWidget;
124
125     BackgroundWidget    *bgWidget;
126     VisualSelector      *visualSelector;
127     PlaylistWidget      *playlistWidget;
128
129     bool                 videoIsActive;       ///< Having a video now / THEMIM->hasV
130     bool                 videoEmbeddedFlag;   ///< Want an external Video Window
131     bool                 playlistVisible;     ///< Is the playlist visible ?
132     bool                 visualSelectorEnabled;
133     bool                 notificationEnabled; /// Systray Notifications
134     bool                 bgWasVisible;
135     int                  i_visualmode;        ///< Visual Mode
136     pl_dock_e            i_pl_dock;
137     bool                 isDocked() { return ( i_pl_dock != PL_UNDOCKED ); }
138
139     /* Status Bar */
140     QLabel              *nameLabel;
141
142     virtual void customEvent( QEvent *);
143     virtual void keyPressEvent( QKeyEvent *);
144     virtual void wheelEvent( QWheelEvent * );
145
146 public slots:
147     void undockPlaylist();
148     void dockPlaylist( pl_dock_e i_pos = PL_BOTTOM );
149     void toggleMinimalView();
150     void togglePlaylist();
151     void toggleUpdateSystrayMenu();
152     void toggleAdvanced();
153     void toggleFullScreen();
154     void toggleFSC();
155
156     /* Manage the Video Functions from the vout threads */
157     void releaseVideoSlot( void );
158
159 private slots:
160     void debug();
161     void doComponentsUpdate();
162     void setName( QString );
163     void setVLCWindowsTitle( QString title = "" );
164 #if 0
165     void visual();
166 #endif
167     void handleSystrayClick( QSystemTrayIcon::ActivationReason );
168     void updateSystrayTooltipName( QString );
169     void updateSystrayTooltipStatus( int );
170 signals:
171     void askReleaseVideo( );
172     void askVideoToResize( unsigned int, unsigned int );
173     void askVideoToToggle();
174     void askBgWidgetToToggle();
175     void askUpdate();
176 };
177
178 #endif