14 class QAbstractKineticScroller;
16 /** Visual representation of a book. */
17 class BookView: public QWebView
22 explicit BookView(QWidget *parent = 0);
24 void setBook(Book *book);
26 void goToBookmark(const Book::Bookmark &bookmark);
28 void setLastBookmark();
29 void restoreLastBookmark();
32 void partLoadStart(int index);
33 void partLoadEnd(int index);
35 /** Signal button press when the real event has been suppressed. */
36 void suppressedMouseButtonPress();
38 /** Signal progress in reading the book. */
39 void progress(qreal p);
44 void onLoadFinished(bool ok);
45 void onSettingsChanged(const QString &key);
47 /** Add QObjects to the main frame. */
48 void addJavaScriptObjects();
50 /** Handle main frame contents size changes. */
51 void onContentsSizeChanged(const QSize &size);
54 void paintEvent(QPaintEvent *e);
55 void mousePressEvent(QMouseEvent *e);
56 void wheelEvent(QWheelEvent *);
57 bool eventFilter(QObject *o, QEvent *e);
58 void leaveEvent(QEvent *e);
59 void enterEvent(QEvent *e);
60 void timerEvent(QTimerEvent *e);
63 /** Save navigation icons from resource to the file system. */
66 /** Remove extracted icons. */
69 /** Load given part. */
70 void loadContent(int index);
72 /** Decorate web page frame with navigation icons. */
73 void addNavigationBar();
75 /** Get temporary directory for extracting book contents. */
78 /** Go to a given (relative) position in current part. */
79 void goToPosition(qreal position);
84 int contentIndex; /**< Current part in book. */
85 Book *mBook; /**< Book to show. */
86 bool restorePositionAfterLoad;
87 /**< If true, restoring position after load is needed. */
88 qreal positionAfterLoad;
89 /**< Position to be restored after load. */
91 /**< Bookmark icon pre-loaded. */
92 bool loaded; /**< True if content has been loaded. */
94 int contentsHeight; /**< Last know height of the frame. */
95 bool decorated; /**< True after adding the arrows to the frame contents. */
99 QAbstractKineticScroller *scroller;