Fix forward navigation control on Linux.
[dorian] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QModelIndex>
5 #include <QEvent>
6
7 #include "adopterwindow.h"
8
9 class QString;
10 class QModelIndex;
11 class DevTools;
12 class BookView;
13 class Book;
14 class FullScreenWindow;
15 class Progress;
16 class ProgressDialog;
17 class TranslucentButton;
18
19 class MainWindow: public AdopterWindow
20 {
21     Q_OBJECT
22
23 public:
24     MainWindow(QWidget *parent = 0);
25     ~MainWindow();
26     void initialize();
27
28 public slots:
29     void showLibrary();
30     void rotate();
31     void showSettings();
32     void showDevTools();
33     void showBookmarks();
34     void onCurrentBookChanged();
35     void showRegular();
36     void showBig();
37     void onSettingsChanged(const QString &key);
38     void onPartLoadStart();
39     void onPartLoadEnd(int index);
40     void onAddBookmark(const QString &note);
41     void onGoToBookmark(int index);
42     void showChapters();
43     void onGoToChapter(int index);
44     void about();
45     void goToNextPage();
46     void goToPreviousPage();
47     void onBeginUpgrade(int total);
48     void onUpgrading(const QString &book);
49     void onEndUpgrade();
50     void onBeginLoad(int total);
51     void onLoading(const QString &book);
52     void onEndLoad();
53
54 protected:
55     void timerEvent(QTimerEvent *event);
56
57 private:
58     void setCurrentBook(const QModelIndex &current);
59     BookView *view;
60     QAction *settingsAction;
61     QAction *libraryAction;
62     QAction *rotateAction;
63     QAction *devToolsAction;
64     QAction *bookmarksAction;
65     QAction *fullScreenAction;
66     QAction *forwardAction;
67     QAction *backwardAction;
68     QAction *chaptersAction;
69     QDialog *settings;
70     DevTools *devTools;
71     QModelIndex mCurrent;
72     FullScreenWindow *fullScreenWindow;
73     int preventBlankingTimer;
74     Progress *prog;
75     TranslucentButton *prev;
76     TranslucentButton *next;
77     ProgressDialog *libraryProgress;
78 };
79
80 #endif // MAINWINDOW_H