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

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

smplayer: restore some os/2 removals from vendor, fix branding

  • 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#ifdef Q_OS_OS2
96 void trayAvailable();
97#endif
98
99#if DOCK_PLAYLIST
100 virtual void showPlaylist(bool b);
101 void playlistClosed();
102
103#if !USE_DOCK_TOPLEVEL_EVENT
104 void dockVisibilityChanged(bool visible);
105#else
106 void dockTopLevelChanged(bool floating);
107#endif
108
109 void stretchWindow();
110 void shrinkWindow();
111#endif
112
113#ifdef SCREENS_SUPPORT
114 void updateSendToScreen();
115 void sendVideoToScreen(int screen);
116
117 void detachVideo(bool);
118
119 void showScreensInfo();
120#endif
121
122#ifdef GLOBALSHORTCUTS
123 void updateGlobalShortcuts();
124#endif
125
126protected:
127 QSystemTrayIcon * tray;
128 QMenu * context_menu;
129
130 MyAction * quitAct;
131 MyAction * showTrayAct;
132 MyAction * showAllAct;
133
134#ifdef DETACH_VIDEO_OPTION
135 MyAction * detachVideoAct;
136#endif
137
138#ifdef SCREENS_SUPPORT
139 MyAction * showScreensInfoAct;
140 QMenu * sendToScreen_menu;
141 MyActionGroup * sendToScreenGroup;
142
143 InfoWindow * screens_info_window;
144 QLabel * detached_label;
145#endif
146
147#ifdef GLOBALSHORTCUTS
148 GlobalShortcuts * global_shortcuts;
149#endif
150
151 // To save state
152 QPoint mainwindow_pos;
153 bool mainwindow_visible;
154
155 QPoint playlist_pos;
156 bool trayicon_playlist_was_visible;
157
158 //QPoint infowindow_pos;
159 //bool infowindow_visible;
160
161 int widgets_size; // To be able to restore the original size after exiting from compact mode
162
163#if DOCK_PLAYLIST
164 PlaylistDock * playlistdock;
165 bool fullscreen_playlist_was_visible;
166 bool fullscreen_playlist_was_floating;
167 bool compact_playlist_was_visible;
168 bool ignore_playlist_events;
169#endif
170};
171
172#endif
Note: See TracBrowser for help on using the repository browser.