class QAbstractKineticScroller;
class ProgressDialog;
class FlickCharm;
+class QTimer;
/** Visual representation of a book. */
class BookView: public QWebView
/** 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);
/** 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();
- /** Adjust web view position after orientation change. */
- void adjustPosition(const QSize &size, const QSize &oldSize);
-
-protected slots:
#ifdef Q_OS_SYMBIAN
/** Observe media keys. */
void onMediaKeysPressed(MediaKeysObserver::MediaKeys key);
void wheelEvent(QWheelEvent *);
bool eventFilter(QObject *o, QEvent *e);
void timerEvent(QTimerEvent *e);
+ void hideEvent(QHideEvent *e);
/** Load given part. */
void loadContent(int index);
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)
#endif
#if defined(Q_OS_SYMBIAN)
- FlickCharm *charm; /**< Kinetic scroller. */
+ FlickCharm *charm; /**< Kinetic scroller. */
#endif
};