Use "media" instead of "video"
[nomnom.git] / src / i / MainWindow.h
blobc64a60f931ab6e972c33ed0d77ed06842033ac53
1 /*
2 * Copyright (C) 2010-2011 Toni Gundogdu.
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 3 of the License, or
7 * (at your option) any later version.
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.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef nomnom_mainwindow_h
19 #define nomnom_mainwindow_h
21 #include <QSystemTrayIcon>
22 #include <QProcess>
23 #include <QPointer>
24 #include <QLabel>
25 #include <QMenu>
26 #include <QHash>
28 #include "Media.h"
29 #include "DownloadDiag.h"
30 #include "ProcProgDiag.h"
32 #include "ui_MainWindow.h"
34 class MainWindow : public QMainWindow, private Ui::MainWindow
36 Q_OBJECT
37 public:
38 MainWindow ();
39 protected:
40 void showEvent (QShowEvent*);
41 void hideEvent (QHideEvent*);
42 void closeEvent (QCloseEvent*);
43 void dragEnterEvent (QDragEnterEvent*);
44 void dropEvent (QDropEvent*);
45 private:
46 void createContextMenu ();
47 void createTray ();
48 void readSettings ();
49 void handleURL (const QString&);
50 bool parseOK (QString&);
51 void streamMedia ();
52 void downloadMedia ();
53 void changeProgramIcon ();
54 bool queryFormats (QStringList&,
55 const QString&,
56 const QString&,
57 bool&);
58 bool selectFormat (QStringList&, QString&);
59 private slots:
60 // UI
61 void onTrayActivated(QSystemTrayIcon::ActivationReason);
62 void onPreferences ();
63 void onAddress ();
64 void onFeed ();
65 void onAbout ();
66 void onRecent ();
67 // quvi.
68 void onProcFinished (QString);
69 private:
70 QPointer<ProcessProgressDialog> proc;
71 QPointer<QSystemTrayIcon> trayIcon;
72 QPointer<DownloadDialog> download;
73 QHash<QString,QAction*> actions;
74 QPointer<QMenu> trayMenu;
75 QPointer<Media> media;
76 QString json;
79 #endif
81 // vim: set ts=2 sw=2 tw=72 expandtab: