release 0.6.6
[fapman] / mainwindow.h
1 /*
2         This file is part of Faster Application Manager.
3
4         Faster Application Manager 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.
8
9         Faster Application Manager 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.
13
14         You should have received a copy of the GNU General Public License
15         along with Faster Application Manager.  If not, see <http://www.gnu.org/licenses/>.
16
17         (C) Heikki Holstila 2010
18 */
19
20 #ifndef MAINWINDOW_H
21 #define MAINWINDOW_H
22
23 #include <QtCore>
24 #include <QMainWindow>
25 #include <phonon/MediaObject>
26 #include "aaptinterface.h"
27
28 class PackageView;
29 class Uninstall;
30 class Dialog;
31 class dimmer;
32 class RepoView;
33 class Settings;
34 class DpkgInterface;
35
36 namespace Ui {
37     class MainWindow;
38 }
39
40 class MainWindow : public QMainWindow
41 {
42     Q_OBJECT
43 #ifdef Q_WS_MAEMO_5
44         Q_CLASSINFO("D-Bus Interface", "org.maemo.faster_application_manager")
45 #endif
46
47 public:
48         enum nextOperation { OpNone, OpPromptSimulated, OpOpenPkgView };
49
50     explicit MainWindow(QWidget *parent = 0);
51     ~MainWindow();
52         void operationQueueFinished(QList<AAptInterface::interfaceMode> lastModes, bool success, QString title, QStringList msgs);
53         void busyDialog(bool show_, QString title="", QString text="");
54         void closeEvent(QCloseEvent *event);
55         void GdkEventIconThemeReload();
56         void notifyDialog(QString title, QString msg);
57         bool confirmDialog(QString title, QString msg);
58         void setNextOperation(nextOperation op_) { iNextOperation=op_; }
59
60         void on_btnUpdate_clicked();
61
62 public slots:
63         void orientationChanged();
64 #ifdef Q_WS_MAEMO_5
65         Q_SCRIPTABLE int top_application();
66 #endif
67
68 protected:
69     void changeEvent(QEvent *e);
70
71 private:
72         void dateFetchAsk();
73         void showFreeSpace();
74
75     Ui::MainWindow *ui;
76         AAptInterface* iAptInterface;
77         DpkgInterface* iDpkgInterface;
78         PackageView* iWinPackageView;
79         RepoView* iWinRepoView;
80         Dialog* iDlgBusy;
81         Settings* iSettings;
82         //operation iOperation;
83         dimmer* iDimmer;
84         bool iReposAutoUpdating;
85         bool iUpgradeAutoUpdate;
86         nextOperation iNextOperation;
87         Phonon::MediaObject* iMediaObject;
88
89         void on_btnRepos_clicked();
90         void on_btnUpgrade_clicked();
91         void on_btnListInstallable_clicked();
92         void on_btnListInstalled_clicked();
93
94 private slots:
95         void on_listWidget_itemClicked(QListWidgetItem* item);
96  void on_actionLoad_file_triggered();
97         void on_actionOptions_triggered();
98         void on_actionView_log_triggered();
99         void on_actionClean_triggered();
100         void on_actionAbout_triggered();
101 };
102
103 #endif // MAINWINDOW_H