416865f3e6a27312b931f2a88bc734456912719d
[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     void onBeginLoad(int total);
48     void onLoading(const QString &book);
49     void onEndLoad();
50
51 protected:
52     void closeEvent(QCloseEvent *event);
53     void timerEvent(QTimerEvent *event);
54     void resizeEvent(QResizeEvent *event);
55
56 private:
57     void setCurrentBook(const QModelIndex &current);
58     BookView *view;
59     QAction *settingsAction;
60     QAction *libraryAction;
61     QAction *infoAction;
62     QAction *devToolsAction;
63     QAction *bookmarksAction;
64     QAction *fullScreenAction;
65     QAction *forwardAction;
66     QAction *backwardAction;
67     QAction *chaptersAction;
68     QDialog *settings;
69     DevTools *devTools;
70     QModelIndex mCurrent;
71     FullScreenWindow *fullScreenWindow;
72     int preventBlankingTimer;
73     Progress *progress;
74     TranslucentButton *previousButton;
75     TranslucentButton *nextButton;
76     QProgressDialog *libraryProgress;
77 };
78
79 #endif // MAINWINDOW_H