source: smplayer/trunk/src/baseguiplus.h@ 181

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

smplayer: update trunk to version 16.8.0

  • Property svn:eol-style set to LF
File size: 3.9 KB
Line 
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 "widgetactions.h"
24#include <QSystemTrayIcon>
25#include <QPoint>
26#include "guiconfig.h"
27
28#define SCREENS_SUPPORT
29//#define DETACH_VIDEO_OPTION
30
31class QMenu;
32class PlaylistDock;
33
34class TimeSliderAction;
35class VolumeSliderAction;
36class TimeLabelAction;
37class InfoWindow;
38class GlobalShortcuts;
39
40class BaseGuiPlus : public BaseGui
41{
42 Q_OBJECT
43
44public:
45 BaseGuiPlus( QWidget* parent = 0, Qt::WindowFlags flags = 0);
46 ~BaseGuiPlus();
47
48 virtual bool startHidden();
49
50#ifdef SCREENS_SUPPORT
51 /* virtual void toggleFullscreen(bool); */
52#endif
53
54public slots:
55#ifdef GLOBALSHORTCUTS
56 virtual void showPreferencesDialog();
57#endif
58
59protected:
60 virtual void retranslateStrings();
61 virtual void populateMainMenu();
62
63 void loadConfig();
64 void saveConfig();
65 void updateShowAllAct();
66
67 virtual void aboutToEnterFullscreen();
68 virtual void aboutToExitFullscreen();
69 virtual void aboutToEnterCompactMode();
70 virtual void aboutToExitCompactMode();
71
72 virtual void closeEvent( QCloseEvent * e );
73
74 // Functions for other GUI's
75 TimeSliderAction * createTimeSliderAction(QWidget * parent);
76 VolumeSliderAction * createVolumeSliderAction(QWidget * parent);
77 TimeLabelAction * createTimeLabelAction(TimeLabelAction::TimeLabelType type, QWidget * parent);
78
79#ifdef SCREENS_SUPPORT
80 bool isVideoDetached();
81#endif
82
83protected slots:
84 // Reimplemented methods
85 virtual void closeWindow();
86 virtual void setWindowCaption(const QString & title);
87 virtual void resizeWindow(int w, int h);
88 virtual void updateMediaInfo();
89 // New
90 virtual void trayIconActivated(QSystemTrayIcon::ActivationReason);
91 virtual void toggleShowAll();
92 virtual void showAll(bool b);
93 virtual void showAll();
94 virtual void quit();
95
96#if DOCK_PLAYLIST
97 virtual void showPlaylist(bool b);
98 void playlistClosed();
99
100#if !USE_DOCK_TOPLEVEL_EVENT
101 void dockVisibilityChanged(bool visible);
102#else
103 void dockTopLevelChanged(bool floating);
104#endif
105
106 void stretchWindow();
107 void shrinkWindow();
108#endif
109
110#ifdef SCREENS_SUPPORT
111 void updateSendToScreen();
112 void sendVideoToScreen(int screen);
113
114 void detachVideo(bool);
115
116 void showScreensInfo();
117#endif
118
119#ifdef GLOBALSHORTCUTS
120 void updateGlobalShortcuts();
121#endif
122
123protected:
124 QSystemTrayIcon * tray;
125 QMenu * context_menu;
126
127 MyAction * quitAct;
128 MyAction * showTrayAct;
129 MyAction * showAllAct;
130
131#ifdef DETACH_VIDEO_OPTION
132 MyAction * detachVideoAct;
133#endif
134
135#ifdef SCREENS_SUPPORT
136 MyAction * showScreensInfoAct;
137 QMenu * sendToScreen_menu;
138 MyActionGroup * sendToScreenGroup;
139
140 InfoWindow * screens_info_window;
141 QLabel * detached_label;
142#endif
143
144#ifdef GLOBALSHORTCUTS
145 GlobalShortcuts * global_shortcuts;
146#endif
147
148 // To save state
149 QPoint mainwindow_pos;
150 bool mainwindow_visible;
151
152 QPoint playlist_pos;
153 bool trayicon_playlist_was_visible;
154
155 //QPoint infowindow_pos;
156 //bool infowindow_visible;
157
158 int widgets_size; // To be able to restore the original size after exiting from compact mode
159
160#if DOCK_PLAYLIST
161 PlaylistDock * playlistdock;
162 bool fullscreen_playlist_was_visible;
163 bool fullscreen_playlist_was_floating;
164 bool compact_playlist_was_visible;
165 bool ignore_playlist_events;
166#endif
167};
168
169#endif
Note: See TracBrowser for help on using the repository browser.