main_interface.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef QVLC_MAIN_INTERFACE_H_
00026 #define QVLC_MAIN_INTERFACE_H_
00027
00028 #include "qt4.hpp"
00029
00030 #include "util/qvlcframe.hpp"
00031
00032 #ifdef WIN32
00033 #include <vlc_windows_interfaces.h>
00034 #endif
00035
00036 #include <QSystemTrayIcon>
00037 #include <QStackedWidget>
00038
00039 class QSettings;
00040 class QCloseEvent;
00041 class QKeyEvent;
00042 class QLabel;
00043 class QEvent;
00044 class InputManager;
00045 class VideoWidget;
00046 class BackgroundWidget;
00047 class PlaylistWidget;
00048 class VisualSelector;
00049 class AdvControlsWidget;
00050 class ControlsWidget;
00051 class InputControlsWidget;
00052 class FullscreenControllerWidget;
00053 class SpeedControlWidget;
00054 class QVBoxLayout;
00055 class QMenu;
00056 class QSize;
00057
00058 enum {
00059 CONTROLS_VISIBLE = 0x1,
00060 CONTROLS_HIDDEN = 0x2,
00061 CONTROLS_ADVANCED = 0x4,
00062 };
00063
00064
00065 class MainInterface : public QVLCMW
00066 {
00067 Q_OBJECT
00068
00069 friend class PlaylistWidget;
00070
00071 public:
00072
00073 MainInterface( intf_thread_t *);
00074 virtual ~MainInterface();
00075
00076
00077 WId getVideo( int *pi_x, int *pi_y,
00078 unsigned int *pi_width, unsigned int *pi_height );
00079 void releaseVideo( void );
00080 int controlVideo( int i_query, va_list args );
00081
00082
00083 #ifndef HAVE_MAEMO
00084 QSystemTrayIcon *getSysTray() { return sysTray; }
00085 QMenu *getSysTrayMenu() { return systrayMenu; }
00086 #endif
00087 int getControlsVisibilityStatus();
00088 bool isPlDocked() { return ( b_plDocked != false ); }
00089
00090 protected:
00091 void dropEventPlay( QDropEvent *, bool);
00092 #ifdef WIN32
00093 virtual bool winEvent( MSG *, long * );
00094 #endif
00095 virtual void dropEvent( QDropEvent *);
00096 virtual void dragEnterEvent( QDragEnterEvent * );
00097 virtual void dragMoveEvent( QDragMoveEvent * );
00098 virtual void dragLeaveEvent( QDragLeaveEvent * );
00099 virtual void closeEvent( QCloseEvent *);
00100 virtual void customEvent( QEvent *);
00101 virtual void keyPressEvent( QKeyEvent *);
00102 virtual void wheelEvent( QWheelEvent * );
00103
00104 private:
00105
00106 void createMainWidget( QSettings* );
00107 void createStatusBar();
00108 void createPlaylist();
00109
00110
00111 void createSystray();
00112 void initSystray();
00113 void handleSystray();
00114
00115
00116 void showTab( QWidget *);
00117 void showVideo();
00118 void restoreStackOldWidget();
00119
00120
00121 QSettings *settings;
00122 #ifndef HAVE_MAEMO
00123 QSystemTrayIcon *sysTray;
00124 QMenu *systrayMenu;
00125 #endif
00126
00127 QString input_name;
00128 QVBoxLayout *mainLayout;
00129 ControlsWidget *controls;
00130 InputControlsWidget *inputC;
00131 FullscreenControllerWidget *fullscreenControls;
00132
00133
00134 QStackedWidget *stackCentralW;
00135
00136 VideoWidget *videoWidget;
00137 BackgroundWidget *bgWidget;
00138 PlaylistWidget *playlistWidget;
00139
00140
00141
00142 QLabel *nameLabel;
00143 QLabel *cryptedLabel;
00144
00145
00146 QWidget *stackCentralOldWidget;
00147
00148 QMap<QWidget *, QSize> stackWidgetsSizes;
00149
00150
00151 bool b_notificationEnabled;
00152 bool b_autoresize;
00153 bool b_videoEmbedded;
00154 bool b_hideAfterCreation;
00155 int i_visualmode;
00156
00157
00158 bool playlistVisible;
00159
00160
00161 bool b_plDocked;
00162
00163
00164 #ifdef WIN32
00165 HIMAGELIST himl;
00166 LPTASKBARLIST3 p_taskbl;
00167 UINT taskbar_wmsg;
00168 void createTaskBarButtons();
00169 #endif
00170
00171 public slots:
00172 void dockPlaylist( bool b_docked = true );
00173 void toggleMinimalView( bool );
00174 void togglePlaylist();
00175 #ifndef HAVE_MAEMO
00176 void toggleUpdateSystrayMenu();
00177 #endif
00178 void toggleAdvancedButtons();
00179 void toggleFullScreen();
00180 void toggleFSC();
00181
00182 void popupMenu( const QPoint& );
00183 void changeThumbbarButtons( int );
00184
00185
00186 void getVideoSlot( WId *p_id, int *pi_x, int *pi_y,
00187 unsigned *pi_width, unsigned *pi_height );
00188 void releaseVideoSlot( void );
00189
00190 private slots:
00191 void debug();
00192 void destroyPopupMenu();
00193 void recreateToolbars();
00194 void setName( const QString& );
00195 void setVLCWindowsTitle( const QString& title = "" );
00196 #if 0
00197 void visual();
00198 #endif
00199 #ifndef HAVE_MAEMO
00200 void handleSystrayClick( QSystemTrayIcon::ActivationReason );
00201 void updateSystrayTooltipName( const QString& );
00202 void updateSystrayTooltipStatus( int );
00203 #endif
00204 void showCryptedLabel( bool );
00205
00206 void handleKeyPress( QKeyEvent * );
00207
00208 void showBuffering( float );
00209
00210 void resizeStack( int w, int h ) {
00211 if( !isFullScreen() && !isMaximized() )
00212 resize( size() - stackCentralW->size() + QSize( w, h ) );
00213 debug(); }
00214
00215
00216 signals:
00217 void askGetVideo( WId *p_id, int *pi_x, int *pi_y,
00218 unsigned *pi_width, unsigned *pi_height );
00219 void askReleaseVideo( );
00220 void askVideoToResize( unsigned int, unsigned int );
00221 void askVideoSetFullScreen( bool );
00222 void minimalViewToggled( bool );
00223 void fullscreenInterfaceToggled( bool );
00224
00225 };
00226
00227 #endif