Enable tracing to file. Attempt to fix last position restoration on S^3.
[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
26 public slots:
27     void showLibrary();
28     void showInfo();
29     void showSettings();
30     void showDevTools();
31     void showBookmarks();
32     void onCurrentBookChanged();
33     void showRegular();
34     void showBig();
35     void onSettingsChanged(const QString &key);
36     void onPartLoadStart();
37     void onPartLoadEnd(int index);
38     void onAddBookmark(const QString &note);
39     void onGoToBookmark(int index);
40     void showChapters();
41     void onGoToChapter(int index);
42     void about();
43     void goToNextPage();
44     void goToPreviousPage();
45     void onBeginUpgrade(int total);
46     void onUpgrading(const QString &book);
47     void onEndUpgrade();
48     void onBeginLoad(int total);
49     void onLoading(const QString &book);
50     void onEndLoad();
51
52 protected:
53     void closeEvent(QCloseEvent *event);
54     void timerEvent(QTimerEvent *event);
55     void resizeEvent(QResizeEvent *event);
56
57 private:
58     void setCurrentBook(const QModelIndex &current);
59     BookView *view;
60     QAction *settingsAction;
61     QAction *libraryAction;
62     QAction *infoAction;
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 *progress;
75     TranslucentButton *previousButton;
76     TranslucentButton *nextButton;
77     ProgressDialog *libraryProgress;
78 };
79
80 #endif // MAINWINDOW_H