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"
33 #include <QSystemTrayIcon>
42 class BackgroundWidget;
45 class AdvControlsWidget;
50 class MainInterface : public QVLCMW
54 MainInterface( intf_thread_t *);
55 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 );
63 QSystemTrayIcon *getSysTray() { return sysTray; };
64 QMenu *getSysTrayMenu() { return systrayMenu; };
65 bool isAdvancedVisible();
67 void resizeEvent( QResizeEvent * );
68 void dropEvent( QDropEvent *);
69 void dragEnterEvent( QDragEnterEvent * );
70 void dragMoveEvent( QDragMoveEvent * );
71 void dragLeaveEvent( QDragLeaveEvent * );
72 void closeEvent( QCloseEvent *);
73 friend class VolumeClickHandler;
76 QSize mainSize, addSize;
77 QSystemTrayIcon *sysTray;
80 QVBoxLayout *mainLayout;
81 ControlsWidget *controls;
83 bool need_components_update;
85 void calculateInterfaceSize();
86 void handleMainUi( QSettings* );
88 void doComponentsUpdate();
92 VideoWidget *videoWidget;
93 virtual void keyPressEvent( QKeyEvent *);
94 virtual void wheelEvent( QWheelEvent * );
96 bool embeddedPlaylistWasActive;
100 BackgroundWidget *bgWidget;
101 VisualSelector *visualSelector;
102 PlaylistWidget *playlistWidget;
104 bool playlistEmbeddedFlag;
105 bool videoEmbeddedFlag;
106 bool alwaysVideoFlag;
107 bool visualSelectorEnabled;
108 bool notificationEnabled;
110 InputManager *main_input_manager;
111 input_thread_t *p_input; ///< Main input associated to the playlist
117 void customEvent( QEvent *);
119 void undockPlaylist();
121 void togglePlaylist();
122 void toggleUpdateSystrayMenu();
123 void toggleAdvanced();
125 void updateOnTimer();
126 void setStatus( int );
127 void setName( QString );
128 void setVLCWindowsTitle( QString title = "" );
129 void setDisplay( float, int, int );
133 void handleSystrayClick( QSystemTrayIcon::ActivationReason );
134 void updateSystrayMenu( int );
135 void updateSystrayTooltipName( QString );
136 void updateSystrayTooltipStatus( int );
137 void showSpeedMenu( QPoint );
138 void showTimeMenu( QPoint );