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();
54 void changeEvent(QEvent *);
55 void closeEvent(QCloseEvent *);
56 bool eventFilter(QObject *obj, QEvent *event);
57 void dragEnterEvent(QDragEnterEvent *event);
58 void dropEvent(QDropEvent *event);
59 void resizeEvent(QResizeEvent *);
62 void checkForUpdate();
63 void gotNewVersion(QString version);
69 void updateUIForFullscreen();
70 void compactView(bool enable);
72 void stateChanged(Phonon::State newState, Phonon::State oldState);
74 void tick(qint64 time);
75 void totalTimeChanged(qint64 time);
76 void setDefinitionMode(QString definitionName);
77 void toggleDefinitionMode();
78 void clearRecentKeywords();
84 void volumeChanged(qreal newVolume);
85 void volumeMutedChanged(bool muted);
88 void showFullscreenToolbar(bool show);
89 void showFullscreenPlaylist(bool show);
91 void setManualPlay(bool enabled);
92 void updateDownloadMessage(QString);
93 void downloadsFinished();
94 void toggleDownloads(bool show);
96 void floatOnTop(bool);
97 void showActionInStatusBar(QAction*, bool show);
98 void showStopAfterThisInStatusBar(bool show);
104 void createActions();
106 void createToolBars();
107 void createStatusBar();
108 void showWidget(QWidget*, bool transition = true);
109 static QString formatTime(qint64 time);
111 void simpleUpdateDialog(QString version);
113 UpdateChecker *updateChecker;
116 QStackedWidget *views;
117 QStack<QWidget*> *history;
121 MediaView *mediaView;
123 QWidget *downloadView;
124 QWidget *regionsView;
127 QAction *addGadgetAct;
133 QAction *searchFocusAct;
136 QAction *skipBackwardAct;
140 QAction *fullscreenAct;
141 QAction *compactViewAct;
143 QAction *copyPageAct;
144 QAction *copyLinkAct;
145 QAction *volumeUpAct;
146 QAction *volumeDownAct;
147 QAction *volumeMuteAct;
148 QAction *findVideoPartsAct;
152 QAction *moveDownAct;
154 QAction *fetchMoreAct;
163 // toolbar & statusbar
164 QToolBar *mainToolBar;
165 SearchLineEdit *toolbarSearch;
166 QToolBar *statusToolBar;
167 QToolButton *regionButton;
168 QAction *regionAction;
171 Phonon::SeekSlider *seekSlider;
172 Phonon::VolumeSlider *volumeSlider;
173 Phonon::MediaObject *mediaObject;
174 Phonon::AudioOutput *audioOutput;