15 class QAbstractKineticScroller;
18 /** Visual representation of a book. */
19 class BookView: public QWebView
24 explicit BookView(QWidget *parent = 0);
26 void setBook(Book *book);
28 void goToBookmark(const Book::Bookmark &bookmark);
29 void addBookmark(const QString ¬e);
30 void setLastBookmark();
31 void restoreLastBookmark();
34 void partLoadStart(int index);
35 void partLoadEnd(int index);
37 /** Signal button press when the real event has been suppressed. */
38 void suppressedMouseButtonPress();
40 /** Signal progress in reading the book. */
41 void progress(qreal p);
44 /** Go to next part. */
47 /** Go to previous part. */
50 void onLoadFinished(bool ok);
51 void onSettingsChanged(const QString &key);
53 /** Add QObjects to the main frame. */
54 void addJavaScriptObjects();
56 /** Handle main frame contents size changes. */
57 void onContentsSizeChanged(const QSize &size);
59 /** Go to previous page. */
60 void goPreviousPage();
62 /** Go to next page. */
66 void paintEvent(QPaintEvent *e);
67 void mousePressEvent(QMouseEvent *e);
68 void wheelEvent(QWheelEvent *);
69 bool eventFilter(QObject *o, QEvent *e);
70 void leaveEvent(QEvent *e);
71 void enterEvent(QEvent *e);
72 void timerEvent(QTimerEvent *e);
73 void keyPressEvent(QKeyEvent *e);
76 /** Load given part. */
77 void loadContent(int index);
79 /** Get temporary directory for extracting book contents. */
82 /** Go to a given (relative) position in current part. */
83 void goToPosition(qreal position);
85 /** Show reading progress. */
88 int contentIndex; /**< Current part in book. */
89 Book *mBook; /**< Book to show. */
90 bool restorePositionAfterLoad;
91 /**< If true, restore current position after load. */
92 qreal positionAfterLoad;
93 /**< Position to be restored after load. */
95 /**< Bookmark icon pre-loaded. */
96 bool loaded; /**< True if content has been loaded. */
98 int contentsHeight; /**< Last know height of the frame. */
100 #if defined(Q_WS_MAEMO_5)
102 QAbstractKineticScroller *scroller;