source: smplayer/vendor/current/src/baseguiplus.h@ 189

Last change on this file since 189 was 186, checked in by Silvan Scherrer, 9 years ago

SMPlayer: update vendor to 17.1.0

File size: 4.4 KB
RevLine 
[90]1/* smplayer, GUI front-end for mplayer.
[186]2 Copyright (C) 2006-2017 Ricardo Villalba <[email protected]>
[90]3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17*/
18
[175]19#ifndef BASEGUIPLUS_H
20#define BASEGUIPLUS_H
[90]21
22#include "basegui.h"
[179]23#include "widgetactions.h"
[90]24#include <QSystemTrayIcon>
25#include <QPoint>
26#include "guiconfig.h"
27
[179]28#define SCREENS_SUPPORT
29//#define DETACH_VIDEO_OPTION
30
[186]31#define SEND_AUDIO_OPTION
32
33#ifdef SEND_AUDIO_OPTION
34#include "deviceinfo.h"
35#endif
36
[90]37class QMenu;
38class PlaylistDock;
39
40class TimeSliderAction;
41class VolumeSliderAction;
[179]42class TimeLabelAction;
43class InfoWindow;
44class GlobalShortcuts;
[90]45
46class BaseGuiPlus : public BaseGui
47{
48 Q_OBJECT
49
50public:
[127]51 BaseGuiPlus( QWidget* parent = 0, Qt::WindowFlags flags = 0);
[90]52 ~BaseGuiPlus();
53
54 virtual bool startHidden();
55
[179]56#ifdef SCREENS_SUPPORT
57 /* virtual void toggleFullscreen(bool); */
58#endif
59
60public slots:
61#ifdef GLOBALSHORTCUTS
62 virtual void showPreferencesDialog();
63#endif
64
[90]65protected:
66 virtual void retranslateStrings();
[179]67 virtual void populateMainMenu();
[90]68
69 void loadConfig();
70 void saveConfig();
71 void updateShowAllAct();
72
[179]73 virtual void aboutToEnterFullscreen();
74 virtual void aboutToExitFullscreen();
[90]75 virtual void aboutToEnterCompactMode();
76 virtual void aboutToExitCompactMode();
77
78 virtual void closeEvent( QCloseEvent * e );
79
80 // Functions for other GUI's
81 TimeSliderAction * createTimeSliderAction(QWidget * parent);
82 VolumeSliderAction * createVolumeSliderAction(QWidget * parent);
[179]83 TimeLabelAction * createTimeLabelAction(TimeLabelAction::TimeLabelType type, QWidget * parent);
[90]84
[179]85#ifdef SCREENS_SUPPORT
86 bool isVideoDetached();
87#endif
88
[90]89protected slots:
90 // Reimplemented methods
[186]91 virtual void updateWidgets();
[90]92 virtual void closeWindow();
93 virtual void setWindowCaption(const QString & title);
94 virtual void resizeWindow(int w, int h);
95 virtual void updateMediaInfo();
96 // New
97 virtual void trayIconActivated(QSystemTrayIcon::ActivationReason);
98 virtual void toggleShowAll();
99 virtual void showAll(bool b);
[154]100 virtual void showAll();
[90]101 virtual void quit();
102
103#if DOCK_PLAYLIST
104 virtual void showPlaylist(bool b);
105 void playlistClosed();
106
107#if !USE_DOCK_TOPLEVEL_EVENT
108 void dockVisibilityChanged(bool visible);
109#else
110 void dockTopLevelChanged(bool floating);
111#endif
112
113 void stretchWindow();
114 void shrinkWindow();
115#endif
116
[179]117#ifdef SCREENS_SUPPORT
118 void updateSendToScreen();
119 void sendVideoToScreen(int screen);
[154]120
[179]121 void detachVideo(bool);
122
123 void showScreensInfo();
124#endif
125
[186]126#ifdef SEND_AUDIO_OPTION
127 void updateSendAudioMenu();
128 void addListToSendAudioMenu(const DeviceList & audio_devices, const QString & device_name);
129 void sendAudioClicked();
130#endif
131
132#ifdef CHROMECAST_SUPPORT
133 void playOnChromecast();
134#endif
135
[179]136#ifdef GLOBALSHORTCUTS
137 void updateGlobalShortcuts();
138#endif
139
[90]140protected:
141 QSystemTrayIcon * tray;
142 QMenu * context_menu;
143
144 MyAction * quitAct;
145 MyAction * showTrayAct;
146 MyAction * showAllAct;
147
[186]148#ifdef CHROMECAST_SUPPORT
149 MyAction * playOnChromecastAct;
150#endif
151
[179]152#ifdef DETACH_VIDEO_OPTION
153 MyAction * detachVideoAct;
154#endif
155
156#ifdef SCREENS_SUPPORT
157 MyAction * showScreensInfoAct;
158 QMenu * sendToScreen_menu;
159 MyActionGroup * sendToScreenGroup;
160
161 InfoWindow * screens_info_window;
162 QLabel * detached_label;
163#endif
164
[186]165#ifdef SEND_AUDIO_OPTION
166 DeviceList audio_devices;
167 QMenu * sendAudio_menu;
168 MyAction * sendAudioAct;
169#endif
170
[179]171#ifdef GLOBALSHORTCUTS
172 GlobalShortcuts * global_shortcuts;
173#endif
174
[90]175 // To save state
176 QPoint mainwindow_pos;
177 bool mainwindow_visible;
178
179 QPoint playlist_pos;
180 bool trayicon_playlist_was_visible;
181
182 //QPoint infowindow_pos;
183 //bool infowindow_visible;
184
[179]185 int widgets_size; // To be able to restore the original size after exiting from compact mode
[90]186
187#if DOCK_PLAYLIST
[179]188 PlaylistDock * playlistdock;
[90]189 bool fullscreen_playlist_was_visible;
190 bool fullscreen_playlist_was_floating;
191 bool compact_playlist_was_visible;
192 bool ignore_playlist_events;
193#endif
194};
195
196#endif
Note: See TracBrowser for help on using the repository browser.