Navigate with volume keys.
[dorian] / mainwindow.h
index 8698e8c..327b334 100755 (executable)
@@ -2,12 +2,15 @@
 #define MAINWINDOW_H
 
 #include <QtGui>
+#include "bookfinder.h"
 
 class QString;
+class QModelIndex;
 class DevTools;
 class BookView;
 class Book;
-class TranslucentButton;
+class FullScreenWindow;
+class Progress;
 
 class MainWindow: public QMainWindow
 {
@@ -15,7 +18,7 @@ class MainWindow: public QMainWindow
 
 public:
     MainWindow(QWidget *parent = 0);
-    virtual ~MainWindow() {}
+    ~MainWindow();
 
 public slots:
     void showLibrary();
@@ -24,26 +27,26 @@ public slots:
     void showDevTools();
     void showBookmarks();
     void onCurrentBookChanged();
-    void showNormal();
-    void showFullScreen();
+    void showRegular();
+    void showBig();
     void onSettingsChanged(const QString &key);
-    void onChapterLoaded(int index);
+    void onPartLoadStart();
+    void onPartLoadEnd(int index);
+    void onAddBookmark();
+    void onGoToBookmark(int index);
+    void showChapters();
+    void onGoToChapter(int index);
 
 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);
 
 private:
-    void setCurrentBook(Book *book);
+    void setCurrentBook(const QModelIndex &current);
     QAction *addToolBarAction(const QObject *receiver, const char *member,
                               const QString &name);
-    QRect fullScreenZone() const;
+    void grabZoomKeys();
     BookView *view;
     QAction *settingsAction;
     QAction *libraryAction;
@@ -55,14 +58,16 @@ private:
     QAction *backwardAction;
     QAction *previousAction;
     QAction *nextAction;
+    QAction *chaptersAction;
     QToolBar *toolBar;
     QDialog *settings;
     DevTools *devTools;
-    Book *book;
-    Qt::WindowFlags normalFlags;
-    TranslucentButton *restoreButton;
-    bool isFullscreen;
-    QRect normalGeometry;
+    QModelIndex mCurrent;
+    FullScreenWindow *fullScreenWindow;
+    int preventBlankingTimer;
+    BookFinder *bookFinder;
+    BookFinderThread bookFinderThread;
+    Progress *progress;
 };
 
 #endif // MAINWINDOW_H