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