15 class QAbstractKineticScroller;
17 /** Visual representation of a book. */
18 class BookView: public QWebView
26 explicit BookView(QWidget *parent = 0);
28 void setBook(Book *book);
30 void goToBookmark(const Book::Bookmark &bookmark);
32 void setLastBookmark();
33 void restoreLastBookmark();
36 void partLoadStart(int index);
37 void partLoadEnd(int index);
39 /** Signal button press when the real event has been suppressed. */
40 void suppressedMouseButtonPress();
42 /** Signal progress in reading the book. */
43 void progress(qreal p);
46 /** Go to next part. */
49 /** Go to previous part. */
52 void onLoadFinished(bool ok);
53 void onSettingsChanged(const QString &key);
55 /** Add QObjects to the main frame. */
56 void addJavaScriptObjects();
58 /** Handle main frame contents size changes. */
59 void onContentsSizeChanged(const QSize &size);
61 /** Go to previous page. */
62 void goPreviousPage();
64 /** Go to next page. */
68 void paintEvent(QPaintEvent *e);
69 void mousePressEvent(QMouseEvent *e);
70 void wheelEvent(QWheelEvent *);
71 bool eventFilter(QObject *o, QEvent *e);
72 void leaveEvent(QEvent *e);
73 void enterEvent(QEvent *e);
74 void timerEvent(QTimerEvent *e);
75 void keyPressEvent(QKeyEvent *e);
78 /** Load given part. */
79 void loadContent(int index);
81 /** Get temporary directory for extracting book contents. */
84 /** Go to a given (relative) position in current part. */
85 void goToPosition(qreal position);
90 int contentIndex; /**< Current part in book. */
91 Book *mBook; /**< Book to show. */
92 bool restorePositionAfterLoad;
93 /**< If true, restoring position after load is needed. */
94 qreal positionAfterLoad;
95 /**< Position to be restored after load. */
97 /**< Bookmark icon pre-loaded. */
98 bool loaded; /**< True if content has been loaded. */
100 int contentsHeight; /**< Last know height of the frame. */
102 #if def(Q_WS_MAEMO_5)
104 QAbstractKineticScroller *scroller;