X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=bookview.h;h=9d25d2d46311de62aaaec19636a34c31701fc171;hb=9d6624b77d5ce16de6f3f722fd500f1a8ff6418f;hp=bc2cf3ff08abe0d8c359423889880da200dc0848;hpb=986c5df2ad57bad44e8dd02286a2326406ace831;p=dorian diff --git a/bookview.h b/bookview.h index bc2cf3f..9d25d2d 100644 --- a/bookview.h +++ b/bookview.h @@ -27,20 +27,36 @@ class BookView: public QWebView public: explicit BookView(QWidget *parent = 0); + + /** Set current book. */ void setBook(Book *book); + + /** Get current book. */ Book *book(); + + /** Go to the position decribed by "bookmark". */ void goToBookmark(const Book::Bookmark &bookmark); + + /** Add bookmark to book at the current position. */ void addBookmark(const QString ¬e); + + /** Save current reading position into book. */ void setLastBookmark(); - void restoreLastBookmark(); + + /** Go to given part + part fragment URL. */ void goToPart(int part, const QString &fragment); + + /** Go to given fragment URL in current part. */ void goToFragment(const QString &fragment); /** If grab is true, volume keys will generate act as page up/down. */ void grabVolumeKeys(bool grab); signals: + /** Part loading started. */ void partLoadStart(int index); + + /** Part loading finished. */ void partLoadEnd(int index); /** Signal button press, when the real event has been suppressed. */ @@ -56,21 +72,27 @@ public slots: /** Go to previous part. */ void goNext(); + /** Actions to perform after URL loading finished. */ void onLoadFinished(bool ok); + + /** Handle settings changes. */ void onSettingsChanged(const QString &key); /** Add QObjects to the main frame. */ void addJavaScriptObjects(); - /** Handle main frame contents size changes. */ - void onContentsSizeChanged(const QSize &size); - /** Go to previous page. */ void goPreviousPage(); /** Go to next page. */ void goNextPage(); + /** Restore saved position after URL loading finished. */ + void restoreAfterLoad(); + + /** Restore book's last reading position. */ + void restoreLastBookmark(); + protected slots: #ifdef Q_OS_SYMBIAN /** Observe media keys. */ @@ -83,10 +105,6 @@ protected: void wheelEvent(QWheelEvent *); bool eventFilter(QObject *o, QEvent *e); void timerEvent(QTimerEvent *e); -#ifdef Q_WS_MAEMO_5 - void leaveEvent(QEvent *e); - void enterEvent(QEvent *e); -#endif // Q_WS_MAEMO_5 /** Load given part. */ void loadContent(int index); @@ -112,7 +130,6 @@ protected: QImage bookmarkImage; /**< Bookmark icon pre-loaded. */ bool loaded; /**< True, if content has been loaded. */ bool mousePressed; /**< Event filter's mouse button state. */ - int contentsHeight; /**< Last know height of the frame. */ bool grabbingVolumeKeys;/**< True, if volume keys should be grabbed. */ #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)