1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2016 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
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 |
|
---|
19 | #ifndef BASEGUIPLUS_H
|
---|
20 | #define BASEGUIPLUS_H
|
---|
21 |
|
---|
22 | #include "basegui.h"
|
---|
23 | #include <QSystemTrayIcon>
|
---|
24 | #include <QPoint>
|
---|
25 | #include "guiconfig.h"
|
---|
26 |
|
---|
27 | class QMenu;
|
---|
28 | class PlaylistDock;
|
---|
29 |
|
---|
30 | class TimeSliderAction;
|
---|
31 | class VolumeSliderAction;
|
---|
32 |
|
---|
33 | class BaseGuiPlus : public BaseGui
|
---|
34 | {
|
---|
35 | Q_OBJECT
|
---|
36 |
|
---|
37 | public:
|
---|
38 | BaseGuiPlus( QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
---|
39 | ~BaseGuiPlus();
|
---|
40 |
|
---|
41 | virtual bool startHidden();
|
---|
42 |
|
---|
43 | protected:
|
---|
44 | virtual void retranslateStrings();
|
---|
45 |
|
---|
46 | void loadConfig();
|
---|
47 | void saveConfig();
|
---|
48 | void updateShowAllAct();
|
---|
49 |
|
---|
50 | virtual void aboutToEnterFullscreen();
|
---|
51 | virtual void aboutToExitFullscreen();
|
---|
52 | virtual void aboutToEnterCompactMode();
|
---|
53 | virtual void aboutToExitCompactMode();
|
---|
54 |
|
---|
55 | virtual void closeEvent( QCloseEvent * e );
|
---|
56 |
|
---|
57 | // Functions for other GUI's
|
---|
58 | TimeSliderAction * createTimeSliderAction(QWidget * parent);
|
---|
59 | VolumeSliderAction * createVolumeSliderAction(QWidget * parent);
|
---|
60 |
|
---|
61 | protected slots:
|
---|
62 | // Reimplemented methods
|
---|
63 | virtual void closeWindow();
|
---|
64 | virtual void setWindowCaption(const QString & title);
|
---|
65 | virtual void resizeWindow(int w, int h);
|
---|
66 | virtual void updateMediaInfo();
|
---|
67 | // New
|
---|
68 | virtual void trayIconActivated(QSystemTrayIcon::ActivationReason);
|
---|
69 | virtual void toggleShowAll();
|
---|
70 | virtual void showAll(bool b);
|
---|
71 | virtual void showAll();
|
---|
72 | virtual void quit();
|
---|
73 | #ifdef Q_OS_OS2
|
---|
74 | void trayAvailable();
|
---|
75 | #endif
|
---|
76 |
|
---|
77 | #if DOCK_PLAYLIST
|
---|
78 | virtual void showPlaylist(bool b);
|
---|
79 | void playlistClosed();
|
---|
80 |
|
---|
81 | #if !USE_DOCK_TOPLEVEL_EVENT
|
---|
82 | void dockVisibilityChanged(bool visible);
|
---|
83 | #else
|
---|
84 | void dockTopLevelChanged(bool floating);
|
---|
85 | #endif
|
---|
86 |
|
---|
87 | void stretchWindow();
|
---|
88 | void shrinkWindow();
|
---|
89 | #endif
|
---|
90 |
|
---|
91 |
|
---|
92 | protected:
|
---|
93 | QSystemTrayIcon * tray;
|
---|
94 | QMenu * context_menu;
|
---|
95 |
|
---|
96 | MyAction * quitAct;
|
---|
97 | MyAction * showTrayAct;
|
---|
98 | MyAction * showAllAct;
|
---|
99 |
|
---|
100 | // To save state
|
---|
101 | QPoint mainwindow_pos;
|
---|
102 | bool mainwindow_visible;
|
---|
103 |
|
---|
104 | QPoint playlist_pos;
|
---|
105 | bool trayicon_playlist_was_visible;
|
---|
106 |
|
---|
107 | //QPoint infowindow_pos;
|
---|
108 | //bool infowindow_visible;
|
---|
109 |
|
---|
110 | int widgets_size; // To be able to restore the original size after exiting from compact mode
|
---|
111 |
|
---|
112 | #if DOCK_PLAYLIST
|
---|
113 | PlaylistDock * playlistdock;
|
---|
114 | bool fullscreen_playlist_was_visible;
|
---|
115 | bool fullscreen_playlist_was_floating;
|
---|
116 | bool compact_playlist_was_visible;
|
---|
117 | bool ignore_playlist_events;
|
---|
118 | #endif
|
---|
119 |
|
---|
120 | };
|
---|
121 |
|
---|
122 | #endif
|
---|