Facelift bookmarks dialog. Add Maemo-friendly dialog box class.
[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     void onAddBookmark();
34     void onGoToBookmark(int index);
35
36 protected:
37 #ifdef Q_WS_MAEMO5
38 #   define MOUSE_ACTIVATE_EVENT mouseReleaseEvent
39 #else
40 #   define MOUSE_ACTIVATE_EVENT mousePressEvent
41 #endif
42     virtual void MOUSE_ACTIVATE_EVENT(QMouseEvent *event);
43     virtual void resizeEvent(QResizeEvent *event);
44     virtual void closeEvent(QCloseEvent *event);
45
46 private:
47     void setCurrentBook(const QModelIndex &current);
48     QAction *addToolBarAction(const QObject *receiver, const char *member,
49                               const QString &name);
50     QRect fullScreenZone() const;
51     BookView *view;
52     QAction *settingsAction;
53     QAction *libraryAction;
54     QAction *infoAction;
55     QAction *devToolsAction;
56     QAction *bookmarksAction;
57     QAction *fullScreenAction;
58     QAction *forwardAction;
59     QAction *backwardAction;
60     QAction *previousAction;
61     QAction *nextAction;
62     QToolBar *toolBar;
63     QDialog *settings;
64     DevTools *devTools;
65     QModelIndex mCurrent;
66     Qt::WindowFlags normalFlags;
67     TranslucentButton *restoreButton;
68     bool isFullscreen;
69     QRect normalGeometry;
70 };
71
72 #endif // MAINWINDOW_H