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;
159 QAction *searchFocusAct;
162 QAction *skipBackwardAct;
166 QAction *fullscreenAct;
167 QAction *compactViewAct;
169 QAction *copyPageAct;
170 QAction *copyLinkAct;
171 QAction *volumeUpAct;
172 QAction *volumeDownAct;
173 QAction *volumeMuteAct;
174 QAction *findVideoPartsAct;
178 QAction *moveDownAct;
180 QAction *fetchMoreAct;
189 // toolbar & statusbar
190 QToolBar *mainToolBar;
191 SearchLineEdit *toolbarSearch;
192 QToolBar *statusToolBar;
193 QToolButton *regionButton;
194 QAction *regionAction;
198 #ifdef APP_PHONON_SEEK
199 Phonon::SeekSlider *seekSlider;
201 Phonon::VolumeSlider *volumeSlider;
202 Phonon::MediaObject *mediaObject;
203 Phonon::AudioOutput *audioOutput;