X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=bookview.h;fp=bookview.h;h=9a177e60932328b1e5e0813d60d2fa5c044e2397;hb=399cd6cba2b7a0ad3d2de29593c3143ece63aad3;hp=74ef2004e6546830d66082ae0e8ddc4e53877336;hpb=f022d4d369f0721e0036268c0869adcda52d1061;p=dorian diff --git a/bookview.h b/bookview.h index 74ef200..9a177e6 100644 --- a/bookview.h +++ b/bookview.h @@ -19,6 +19,7 @@ class Progress; class QAbstractKineticScroller; class ProgressDialog; class FlickCharm; +class QTimer; /** Visual representation of a book. */ class BookView: public QWebView @@ -52,6 +53,12 @@ public: /** If grab is true, volume keys will generate act as page up/down. */ void grabVolumeKeys(bool grab); + /** Schedule restoring last reading position after loading part. */ + void scheduleRestoreAfterLoad(); + + /** Schedule restoring last reading position. */ + void scheduleRestoreLastBookmark(); + signals: /** Part loading started. */ void partLoadStart(int index); @@ -84,13 +91,13 @@ public slots: /** Go to next page. */ void goNextPage(); - /** Restore saved position after URL loading finished. */ +protected slots: + /** Restore last reading position after part loading finished. */ void restoreAfterLoad(); - /** Restore book's last reading position. */ + /** Restore book's last reading position, load new part if needed. */ void restoreLastBookmark(); -protected slots: #ifdef Q_OS_SYMBIAN /** Observe media keys. */ void onMediaKeysPressed(MediaKeysObserver::MediaKeys key); @@ -117,22 +124,27 @@ protected: void showProgress(); private: - int contentIndex; /**< Current part in book. */ - Book *mBook; /**< Book to show. */ + int contentIndex; /**< Current part in book. */ + Book *mBook; /**< Book to show. */ bool restorePositionAfterLoad; - /**< If true, restore current position after load. */ - qreal positionAfterLoad;/**< Position to be restored after load. */ + /**< If true, restore reading position after load. */ + qreal positionAfterLoad; + /**< Position to be restored after load. */ bool restoreFragmentAfterLoad; - /**< If true, restore fragment location after load. */ + /**< If true, restore fragment location after load. */ QString fragmentAfterLoad; - /**< Fragment location to be restored after load. */ - QImage bookmarkImage; /**< Bookmark icon pre-loaded. */ - bool loaded; /**< True, if content has been loaded. */ - bool mousePressed; /**< Event filter's mouse button state. */ - bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */ + /**< Fragment location to be restored after load. */ + QImage bookmarkImage; + /**< Bookmark icon pre-loaded. */ + bool loaded; /**< True, if content has been loaded. */ + bool mousePressed; /**< Event filter's mouse button state. */ + bool grabbingVolumeKeys; + /**< True, if volume keys should be grabbed. */ + QTimer *restoreTimer; + /**< Single timer for scheduling all restore ops. */ #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) - int scrollerMonitor; /**< ID of timer monitoring kinetic scroll. */ + int scrollerMonitor;/**< ID of timer monitoring kinetic scroll. */ #endif #if defined(Q_WS_MAEMO_5) @@ -140,7 +152,7 @@ private: #endif #if defined(Q_OS_SYMBIAN) - FlickCharm *charm; /**< Kinetic scroller. */ + FlickCharm *charm; /**< Kinetic scroller. */ #endif };