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();
75 QSize sizeHint() const;
77 // void resizeEvent( QResizeEvent * );
78 void dropEvent( QDropEvent *);
79 void dragEnterEvent( QDragEnterEvent * );
80 void dragMoveEvent( QDragMoveEvent * );
81 void dragLeaveEvent( QDragLeaveEvent * );
82 void closeEvent( QCloseEvent *);
84 friend class VolumeClickHandler;
87 QSize mainSize, addSize;
88 QSystemTrayIcon *sysTray;
91 QVBoxLayout *mainLayout;
92 ControlsWidget *controls;
93 QMenu *speedControlMenu;
94 SpeedControlWidget *speedControl;
96 bool need_components_update;
98 void handleMainUi( QSettings* );
101 void createSystray();
102 void privacyDialog( QList<ConfigControl *> controls );
105 VideoWidget *videoWidget;
106 virtual void keyPressEvent( QKeyEvent *);
107 virtual void wheelEvent( QWheelEvent * );
109 bool embeddedPlaylistWasActive;
111 QSize savedVideoSize;
113 BackgroundWidget *bgWidget;
114 VisualSelector *visualSelector;
115 PlaylistWidget *playlistWidget;
118 bool videoEmbeddedFlag;
119 bool alwaysVideoFlag;
120 bool visualSelectorEnabled;
121 bool notificationEnabled;
123 InputManager *main_input_manager;
124 input_thread_t *p_input; ///< Main input associated to the playlist
131 bool b_remainingTime; /* showing elapsed or remaining time */
133 void customEvent( QEvent *);
135 void undockPlaylist();
136 void toggleMinimalView();
137 void togglePlaylist();
138 void toggleUpdateSystrayMenu();
139 void toggleAdvanced();
141 /* Manage the Video Functions from the vout threads */
142 void releaseVideoSlot( void * );
146 void updateOnTimer();
147 void doComponentsUpdate();
148 void setStatus( int );
150 void setName( QString );
151 void setVLCWindowsTitle( QString title = "" );
152 void setDisplayPosition( float, int, int );
153 void toggleTimeDisplay();
157 void handleSystrayClick( QSystemTrayIcon::ActivationReason );
158 void updateSystrayTooltipName( QString );
159 void updateSystrayTooltipStatus( int );
160 void showSpeedMenu( QPoint );
162 void askReleaseVideo( void * );
163 void askVideoToToggle();
164 void askBgWidgetToToggle();