Fix sorting of library. Add basic search framework.
[dorian] / mainwindow.h
index c44599e..416865f 100755 (executable)
@@ -2,7 +2,8 @@
 #define MAINWINDOW_H
 
 #include <QtGui>
-#include "bookfinder.h"
+
+#include "adopterwindow.h"
 
 class QString;
 class QModelIndex;
@@ -10,8 +11,10 @@ class DevTools;
 class BookView;
 class Book;
 class FullScreenWindow;
+class Progress;
+class TranslucentButton;
 
-class MainWindow: public QMainWindow
+class MainWindow: public AdopterWindow
 {
     Q_OBJECT
 
@@ -29,21 +32,29 @@ public slots:
     void showRegular();
     void showBig();
     void onSettingsChanged(const QString &key);
-    void onChapterLoadStart();
-    void onChapterLoadEnd(int index);
+    void onPartLoadStart();
+    void onPartLoadEnd(int index);
     void onAddBookmark();
     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:
-    virtual void closeEvent(QCloseEvent *event);
-    virtual void timerEvent(QTimerEvent *event);
+    void closeEvent(QCloseEvent *event);
+    void timerEvent(QTimerEvent *event);
+    void resizeEvent(QResizeEvent *event);
 
 private:
     void setCurrentBook(const QModelIndex &current);
-    QAction *addToolBarAction(const QObject *receiver, const char *member,
-                              const QString &name);
     BookView *view;
     QAction *settingsAction;
     QAction *libraryAction;
@@ -53,17 +64,16 @@ private:
     QAction *fullScreenAction;
     QAction *forwardAction;
     QAction *backwardAction;
-    QAction *previousAction;
-    QAction *nextAction;
     QAction *chaptersAction;
-    QToolBar *toolBar;
     QDialog *settings;
     DevTools *devTools;
     QModelIndex mCurrent;
     FullScreenWindow *fullScreenWindow;
     int preventBlankingTimer;
-    BookFinder *bookFinder;
-    BookFinderThread bookFinderThread;
+    Progress *progress;
+    TranslucentButton *previousButton;
+    TranslucentButton *nextButton;
+    QProgressDialog *libraryProgress;
 };
 
 #endif // MAINWINDOW_H