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