New version. Update home page link in About box.
[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     void initialize();
26
27 public slots:
28     void showLibrary();
29     void showInfo();
30     void showSettings();
31     void showDevTools();
32     void showBookmarks();
33     void onCurrentBookChanged();
34     void showRegular();
35     void showBig();
36     void onSettingsChanged(const QString &key);
37     void onPartLoadStart();
38     void onPartLoadEnd(int index);
39     void onAddBookmark(const QString &note);
40     void onGoToBookmark(int index);
41     void showChapters();
42     void onGoToChapter(int index);
43     void about();
44     void goToNextPage();
45     void goToPreviousPage();
46     void onBeginUpgrade(int total);
47     void onUpgrading(const QString &book);
48     void onEndUpgrade();
49     void onBeginLoad(int total);
50     void onLoading(const QString &book);
51     void onEndLoad();
52
53 protected:
54     void closeEvent(QCloseEvent *event);
55     void timerEvent(QTimerEvent *event);
56     void resizeEvent(QResizeEvent *event);
57
58 protected slots:
59     void placeChildren();
60
61 private:
62     void setCurrentBook(const QModelIndex &current);
63     BookView *view;
64     QAction *settingsAction;
65     QAction *libraryAction;
66     QAction *infoAction;
67     QAction *devToolsAction;
68     QAction *bookmarksAction;
69     QAction *fullScreenAction;
70     QAction *forwardAction;
71     QAction *backwardAction;
72     QAction *chaptersAction;
73     QDialog *settings;
74     DevTools *devTools;
75     QModelIndex mCurrent;
76     FullScreenWindow *fullScreenWindow;
77     int preventBlankingTimer;
78     Progress *progress;
79     TranslucentButton *previousButton;
80     TranslucentButton *nextButton;
81     ProgressDialog *libraryProgress;
82 };
83
84 #endif // MAINWINDOW_H