| 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| 2 | Copyright (C) 2006-2010 Ricardo Villalba <rvm@escomposlinux.org>
|
|---|
| 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 quit();
|
|---|
| 72 | #ifdef Q_OS_OS2
|
|---|
| 73 | void trayAvailable();
|
|---|
| 74 | #endif
|
|---|
| 75 |
|
|---|
| 76 | #if DOCK_PLAYLIST
|
|---|
| 77 | virtual void showPlaylist(bool b);
|
|---|
| 78 | void playlistClosed();
|
|---|
| 79 |
|
|---|
| 80 | #if !USE_DOCK_TOPLEVEL_EVENT
|
|---|
| 81 | void dockVisibilityChanged(bool visible);
|
|---|
| 82 | #else
|
|---|
| 83 | void dockTopLevelChanged(bool floating);
|
|---|
| 84 | #endif
|
|---|
| 85 |
|
|---|
| 86 | void stretchWindow();
|
|---|
| 87 | void shrinkWindow();
|
|---|
| 88 | #endif
|
|---|
| 89 |
|
|---|
| 90 | protected:
|
|---|
| 91 | QSystemTrayIcon * tray;
|
|---|
| 92 | QMenu * context_menu;
|
|---|
| 93 |
|
|---|
| 94 | MyAction * quitAct;
|
|---|
| 95 | MyAction * showTrayAct;
|
|---|
| 96 | MyAction * showAllAct;
|
|---|
| 97 |
|
|---|
| 98 | // To save state
|
|---|
| 99 | QPoint mainwindow_pos;
|
|---|
| 100 | bool mainwindow_visible;
|
|---|
| 101 |
|
|---|
| 102 | QPoint playlist_pos;
|
|---|
| 103 | bool trayicon_playlist_was_visible;
|
|---|
| 104 |
|
|---|
| 105 | //QPoint infowindow_pos;
|
|---|
| 106 | //bool infowindow_visible;
|
|---|
| 107 |
|
|---|
| 108 | int widgets_size; // To be able to restore the original size after exiting from compact mode
|
|---|
| 109 |
|
|---|
| 110 | #if DOCK_PLAYLIST
|
|---|
| 111 | PlaylistDock * playlistdock;
|
|---|
| 112 | bool fullscreen_playlist_was_visible;
|
|---|
| 113 | bool fullscreen_playlist_was_floating;
|
|---|
| 114 | bool compact_playlist_was_visible;
|
|---|
| 115 | bool ignore_playlist_events;
|
|---|
| 116 | #endif
|
|---|
| 117 |
|
|---|
| 118 | };
|
|---|
| 119 |
|
|---|
| 120 | #endif
|
|---|