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