5 #include <phonon/audiooutput.h>
6 #include <phonon/volumeslider.h>
7 #include <phonon/mediaobject.h>
8 #include <phonon/seekslider.h>
19 class MainWindow : public QMainWindow {
24 static MainWindow* instance();
27 Phonon::SeekSlider* getSeekSlider() { return seekSlider; }
30 static void printHelp();
31 MediaView* getMediaView() { return mediaView; }
32 QToolButton* getRegionButton() { return regionButton; }
33 QAction* getRegionAction() { return regionAction; }
36 void showHome(bool transition = true);
37 void showMedia(SearchParams *params);
38 void showMedia(VideoSource *videoSource);
39 void showRegionsView();
41 void messageReceived(const QString &message);
43 void startToolbarSearch(QString query);
45 void showMessage(QString message);
47 void showActivationView(bool transition = true);
48 void showActivationDialog();
52 bool isReallyFullScreen();
53 bool isCompact() { return m_compact; }
56 void changeEvent(QEvent *);
57 void closeEvent(QCloseEvent *);
58 bool eventFilter(QObject *obj, QEvent *event);
59 void dragEnterEvent(QDragEnterEvent *event);
60 void dropEvent(QDropEvent *event);
61 void resizeEvent(QResizeEvent *);
64 void checkForUpdate();
65 void gotNewVersion(QString version);
71 void updateUIForFullscreen();
72 void compactView(bool enable);
74 void stateChanged(Phonon::State newState, Phonon::State oldState);
76 void tick(qint64 time);
77 void totalTimeChanged(qint64 time);
78 void setDefinitionMode(QString definitionName);
79 void toggleDefinitionMode();
80 void clearRecentKeywords();
86 void volumeChanged(qreal newVolume);
87 void volumeMutedChanged(bool muted);
90 void showFullscreenToolbar(bool show);
91 void showFullscreenPlaylist(bool show);
93 void setManualPlay(bool enabled);
94 void updateDownloadMessage(QString);
95 void downloadsFinished();
96 void toggleDownloads(bool show);
98 void floatOnTop(bool);
99 void showActionInStatusBar(QAction*, bool show);
100 void showStopAfterThisInStatusBar(bool show);
106 void createActions();
108 void createToolBars();
109 void createStatusBar();
110 void showWidget(QWidget*, bool transition = true);
111 static QString formatTime(qint64 time);
113 void simpleUpdateDialog(QString version);
115 UpdateChecker *updateChecker;
118 QStackedWidget *views;
119 QStack<QWidget*> *history;
123 MediaView *mediaView;
125 QWidget *downloadView;
126 QWidget *regionsView;
129 QAction *addGadgetAct;
135 QAction *searchFocusAct;
138 QAction *skipBackwardAct;
142 QAction *fullscreenAct;
143 QAction *compactViewAct;
145 QAction *copyPageAct;
146 QAction *copyLinkAct;
147 QAction *volumeUpAct;
148 QAction *volumeDownAct;
149 QAction *volumeMuteAct;
150 QAction *findVideoPartsAct;
154 QAction *moveDownAct;
156 QAction *fetchMoreAct;
165 // toolbar & statusbar
166 QToolBar *mainToolBar;
167 SearchLineEdit *toolbarSearch;
168 QToolBar *statusToolBar;
169 QToolButton *regionButton;
170 QAction *regionAction;
173 Phonon::SeekSlider *seekSlider;
174 Phonon::VolumeSlider *volumeSlider;
175 Phonon::MediaObject *mediaObject;
176 Phonon::AudioOutput *audioOutput;