New version. Update home page link in About box.
[dorian] / mainwindow.h
index 628fd18..4f499d2 100755 (executable)
@@ -1,22 +1,28 @@
 #ifndef MAINWINDOW_H
 #define MAINWINDOW_H
 
-#include <QtGui>
+#include <QModelIndex>
+#include <QEvent>
+
+#include "adopterwindow.h"
 
 class QString;
 class QModelIndex;
 class DevTools;
 class BookView;
 class Book;
+class FullScreenWindow;
+class Progress;
+class ProgressDialog;
 class TranslucentButton;
 
-class MainWindow: public QMainWindow
+class MainWindow: public AdopterWindow
 {
     Q_OBJECT
 
 public:
     MainWindow(QWidget *parent = 0);
-    virtual ~MainWindow() {}
+    void initialize();
 
 public slots:
     void showLibrary();
@@ -25,27 +31,35 @@ public slots:
     void showDevTools();
     void showBookmarks();
     void onCurrentBookChanged();
-    void showNormal();
-    void showFullScreen();
+    void showRegular();
+    void showBig();
     void onSettingsChanged(const QString &key);
-    void onChapterLoadStart();
-    void onChapterLoadEnd(int index);
+    void onPartLoadStart();
+    void onPartLoadEnd(int index);
+    void onAddBookmark(const QString &note);
+    void onGoToBookmark(int index);
+    void showChapters();
+    void onGoToChapter(int index);
+    void about();
+    void goToNextPage();
+    void goToPreviousPage();
+    void onBeginUpgrade(int total);
+    void onUpgrading(const QString &book);
+    void onEndUpgrade();
+    void onBeginLoad(int total);
+    void onLoading(const QString &book);
+    void onEndLoad();
 
 protected:
-#ifdef Q_WS_MAEMO5
-#   define MOUSE_ACTIVATE_EVENT mouseReleaseEvent
-#else
-#   define MOUSE_ACTIVATE_EVENT mousePressEvent
-#endif
-    virtual void MOUSE_ACTIVATE_EVENT(QMouseEvent *event);
-    virtual void resizeEvent(QResizeEvent *event);
-    virtual void closeEvent(QCloseEvent *event);
+    void closeEvent(QCloseEvent *event);
+    void timerEvent(QTimerEvent *event);
+    void resizeEvent(QResizeEvent *event);
+
+protected slots:
+    void placeChildren();
 
 private:
     void setCurrentBook(const QModelIndex &current);
-    QAction *addToolBarAction(const QObject *receiver, const char *member,
-                              const QString &name);
-    QRect fullScreenZone() const;
     BookView *view;
     QAction *settingsAction;
     QAction *libraryAction;
@@ -55,16 +69,16 @@ private:
     QAction *fullScreenAction;
     QAction *forwardAction;
     QAction *backwardAction;
-    QAction *previousAction;
-    QAction *nextAction;
-    QToolBar *toolBar;
+    QAction *chaptersAction;
     QDialog *settings;
     DevTools *devTools;
     QModelIndex mCurrent;
-    Qt::WindowFlags normalFlags;
-    TranslucentButton *restoreButton;
-    bool isFullscreen;
-    QRect normalGeometry;
+    FullScreenWindow *fullScreenWindow;
+    int preventBlankingTimer;
+    Progress *progress;
+    TranslucentButton *previousButton;
+    TranslucentButton *nextButton;
+    ProgressDialog *libraryProgress;
 };
 
 #endif // MAINWINDOW_H