3 This file is part of Minitube.
4 Copyright 2009, Flavio Tordini <flavio.tordini@gmail.com>
6 Minitube is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 Minitube is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with Minitube. If not, see <http://www.gnu.org/licenses/>.
25 #include <phonon/audiooutput.h>
26 #include <phonon/volumeslider.h>
27 #include <phonon/mediaobject.h>
28 #include <phonon/seekslider.h>
39 class MainWindow : public QMainWindow {
44 static MainWindow* instance();
47 #ifdef APP_PHONON_SEEK
48 Phonon::SeekSlider* getSeekSlider() { return seekSlider; }
50 QSlider* getSlider() { return slider; }
53 static void printHelp();
54 MediaView* getMediaView() { return mediaView; }
55 QToolButton* getRegionButton() { return regionButton; }
56 QAction* getRegionAction() { return regionAction; }
57 void showActionInStatusBar(QAction*, bool show);
60 void showHome(bool transition = true);
61 void showMedia(SearchParams *params);
62 void showMedia(VideoSource *videoSource);
63 void showRegionsView();
65 void messageReceived(const QString &message);
67 void startToolbarSearch(QString query);
69 void showMessage(QString message);
71 void showActivationView(bool transition = true);
72 void showActivationDialog();
76 bool isReallyFullScreen();
77 bool isCompact() { return m_compact; }
80 void changeEvent(QEvent *);
81 void closeEvent(QCloseEvent *);
82 bool eventFilter(QObject *obj, QEvent *event);
83 void dragEnterEvent(QDragEnterEvent *event);
84 void dropEvent(QDropEvent *event);
85 void resizeEvent(QResizeEvent *);
89 void checkForUpdate();
90 void gotNewVersion(QString version);
96 void updateUIForFullscreen();
97 void compactView(bool enable);
99 void stateChanged(Phonon::State newState, Phonon::State oldState);
101 void tick(qint64 time);
102 void totalTimeChanged(qint64 time);
103 void setDefinitionMode(QString definitionName);
104 void toggleDefinitionMode();
105 void clearRecentKeywords();
111 void volumeChanged(qreal newVolume);
112 void volumeMutedChanged(bool muted);
114 // fullscreen toolbar
115 void showFullscreenToolbar(bool show);
116 void showFullscreenPlaylist(bool show);
118 void setManualPlay(bool enabled);
119 void updateDownloadMessage(QString);
120 void downloadsFinished();
121 void toggleDownloads(bool show);
123 void floatOnTop(bool);
124 void showStopAfterThisInStatusBar(bool show);
130 void createActions();
132 void createToolBars();
133 void createStatusBar();
134 void showWidget(QWidget*, bool transition = true);
135 static QString formatTime(qint64 time);
137 void simpleUpdateDialog(QString version);
139 UpdateChecker *updateChecker;
142 QStackedWidget *views;
143 QStack<QWidget*> *history;
144 QList<QAction*> viewActions;
148 MediaView *mediaView;
150 QWidget *downloadView;
151 QWidget *regionsView;
154 QAction *addGadgetAct;
160 QAction *searchFocusAct;
163 QAction *skipBackwardAct;
167 QAction *fullscreenAct;
168 QAction *compactViewAct;
170 QAction *copyPageAct;
171 QAction *copyLinkAct;
172 QAction *volumeUpAct;
173 QAction *volumeDownAct;
174 QAction *volumeMuteAct;
175 QAction *findVideoPartsAct;
179 QAction *moveDownAct;
181 QAction *fetchMoreAct;
190 // toolbar & statusbar
191 QToolBar *mainToolBar;
192 SearchLineEdit *toolbarSearch;
193 QToolBar *statusToolBar;
194 QToolButton *regionButton;
195 QAction *regionAction;
199 #ifdef APP_PHONON_SEEK
200 Phonon::SeekSlider *seekSlider;
202 Phonon::VolumeSlider *volumeSlider;
203 Phonon::MediaObject *mediaObject;
204 Phonon::AudioOutput *audioOutput;