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