Navigate with volume keys.
[dorian] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QtGui>
5 #include "bookfinder.h"
6
7 class QString;
8 class QModelIndex;
9 class DevTools;
10 class BookView;
11 class Book;
12 class FullScreenWindow;
13 class Progress;
14
15 class MainWindow: public QMainWindow
16 {
17     Q_OBJECT
18
19 public:
20     MainWindow(QWidget *parent = 0);
21     ~MainWindow();
22
23 public slots:
24     void showLibrary();
25     void showInfo();
26     void showSettings();
27     void showDevTools();
28     void showBookmarks();
29     void onCurrentBookChanged();
30     void showRegular();
31     void showBig();
32     void onSettingsChanged(const QString &key);
33     void onPartLoadStart();
34     void onPartLoadEnd(int index);
35     void onAddBookmark();
36     void onGoToBookmark(int index);
37     void showChapters();
38     void onGoToChapter(int index);
39
40 protected:
41     void closeEvent(QCloseEvent *event);
42     void timerEvent(QTimerEvent *event);
43     void resizeEvent(QResizeEvent *event);
44
45 private:
46     void setCurrentBook(const QModelIndex &current);
47     QAction *addToolBarAction(const QObject *receiver, const char *member,
48                               const QString &name);
49     void grabZoomKeys();
50     BookView *view;
51     QAction *settingsAction;
52     QAction *libraryAction;
53     QAction *infoAction;
54     QAction *devToolsAction;
55     QAction *bookmarksAction;
56     QAction *fullScreenAction;
57     QAction *forwardAction;
58     QAction *backwardAction;
59     QAction *previousAction;
60     QAction *nextAction;
61     QAction *chaptersAction;
62     QToolBar *toolBar;
63     QDialog *settings;
64     DevTools *devTools;
65     QModelIndex mCurrent;
66     FullScreenWindow *fullScreenWindow;
67     int preventBlankingTimer;
68     BookFinder *bookFinder;
69     BookFinderThread bookFinderThread;
70     Progress *progress;
71 };
72
73 #endif // MAINWINDOW_H