Make library full screen on Maemo. Show busy indicator while loading
[dorian] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QtGui>
5
6 class QString;
7 class QModelIndex;
8 class DevTools;
9 class BookView;
10 class Book;
11 class TranslucentButton;
12
13 class MainWindow: public QMainWindow
14 {
15     Q_OBJECT
16
17 public:
18     MainWindow(QWidget *parent = 0);
19     virtual ~MainWindow() {}
20
21 public slots:
22     void showLibrary();
23     void showInfo();
24     void showSettings();
25     void showDevTools();
26     void showBookmarks();
27     void onCurrentBookChanged();
28     void showNormal();
29     void showFullScreen();
30     void onSettingsChanged(const QString &key);
31     void onChapterLoadStart();
32     void onChapterLoadEnd(int index);
33
34 protected:
35 #ifdef Q_WS_MAEMO5
36 #   define MOUSE_ACTIVATE_EVENT mouseReleaseEvent
37 #else
38 #   define MOUSE_ACTIVATE_EVENT mousePressEvent
39 #endif
40     virtual void MOUSE_ACTIVATE_EVENT(QMouseEvent *event);
41     virtual void resizeEvent(QResizeEvent *event);
42     virtual void closeEvent(QCloseEvent *event);
43
44 private:
45     void setCurrentBook(const QModelIndex &current);
46     QAction *addToolBarAction(const QObject *receiver, const char *member,
47                               const QString &name);
48     QRect fullScreenZone() const;
49     BookView *view;
50     QAction *settingsAction;
51     QAction *libraryAction;
52     QAction *infoAction;
53     QAction *devToolsAction;
54     QAction *bookmarksAction;
55     QAction *fullScreenAction;
56     QAction *forwardAction;
57     QAction *backwardAction;
58     QAction *previousAction;
59     QAction *nextAction;
60     QToolBar *toolBar;
61     QDialog *settings;
62     DevTools *devTools;
63     QModelIndex mCurrent;
64     Qt::WindowFlags normalFlags;
65     TranslucentButton *restoreButton;
66     bool isFullscreen;
67     QRect normalGeometry;
68 };
69
70 #endif // MAINWINDOW_H