Abstract out progress dialog.
[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 ProgressDialog;
16 class TranslucentButton;
17
18 class MainWindow: public AdopterWindow
19 {
20     Q_OBJECT
21
22 public:
23     MainWindow(QWidget *parent = 0);
24     ~MainWindow();
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