1 /*****************************************************************************
2 * main_interface.hpp : Main Interface
3 ****************************************************************************
4 * Copyright (C) 2006-2007 the VideoLAN team
7 * Authors: Clément Stenac <zorglub@videolan.org>
8 * Jean-Baptiste Kempf <jb@videolan.org>
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.
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.
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 *****************************************************************************/
25 #ifndef _MAIN_INTERFACE_H_
26 #define _MAIN_INTERFACE_H_
29 #include "util/qvlcframe.hpp"
30 #include "components/preferences_widgets.hpp"
34 #include <QSystemTrayIcon>
43 class BackgroundWidget;
46 class AdvControlsWidget;
48 class SpeedControlWidget;
54 CONTROLS_HIDDEN = 0x0,
55 CONTROLS_VISIBLE = 0x1,
56 CONTROLS_ADVANCED = 0x2
59 class MainInterface : public QVLCMW
63 MainInterface( intf_thread_t *);
64 virtual ~MainInterface();
66 void *requestVideo( vout_thread_t *p_nvout, int *pi_x,
67 int *pi_y, unsigned int *pi_width,
68 unsigned int *pi_height );
69 void releaseVideo( void * );
70 int controlVideo( void *p_window, int i_query, va_list args );
72 QSystemTrayIcon *getSysTray() { return sysTray; };
73 QMenu *getSysTrayMenu() { return systrayMenu; };
74 int getControlsVisibilityStatus();
76 // void resizeEvent( QResizeEvent * );
77 void dropEvent( QDropEvent *);
78 void dragEnterEvent( QDragEnterEvent * );
79 void dragMoveEvent( QDragMoveEvent * );
80 void dragLeaveEvent( QDragLeaveEvent * );
81 void closeEvent( QCloseEvent *);
83 friend class VolumeClickHandler;
86 QSize mainSize, addSize;
87 QSystemTrayIcon *sysTray;
90 QVBoxLayout *mainLayout;
91 ControlsWidget *controls;
92 QMenu *speedControlMenu;
93 SpeedControlWidget *speedControl;
95 bool need_components_update;
97 void handleMainUi( QSettings* );
99 void doComponentsUpdate();
100 void createSystray();
101 void privacyDialog( QList<ConfigControl *> controls );
104 VideoWidget *videoWidget;
105 virtual void keyPressEvent( QKeyEvent *);
106 virtual void wheelEvent( QWheelEvent * );
108 bool embeddedPlaylistWasActive;
110 QSize savedVideoSize;
112 BackgroundWidget *bgWidget;
113 VisualSelector *visualSelector;
114 PlaylistWidget *playlistWidget;
117 bool videoEmbeddedFlag;
118 bool alwaysVideoFlag;
119 bool visualSelectorEnabled;
120 bool notificationEnabled;
122 InputManager *main_input_manager;
123 input_thread_t *p_input; ///< Main input associated to the playlist
130 bool b_remainingTime; /* showing elapsed or remaining time */
132 void customEvent( QEvent *);
134 void undockPlaylist();
135 void toggleMinimalView();
136 void togglePlaylist();
137 void toggleUpdateSystrayMenu();
138 void toggleAdvanced();
140 /* Manage the Video Functions from the vout threads */
141 void releaseVideoSlot( void * );
145 void updateOnTimer();
147 void setStatus( int );
149 void setName( QString );
150 void setVLCWindowsTitle( QString title = "" );
151 void setDisplayPosition( float, int, int );
152 void toggleTimeDisplay();
156 void handleSystrayClick( QSystemTrayIcon::ActivationReason );
157 void updateSystrayTooltipName( QString );
158 void updateSystrayTooltipStatus( int );
159 void showSpeedMenu( QPoint );
161 void askReleaseVideo( void * );
162 void askVideoToToggle();
163 void askBgWidgetToToggle();