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);
61 void keyPressEvent(QKeyEvent *e);
64 /** Save navigation icons from resource to the file system. */
67 /** Remove extracted icons. */
70 /** Load given part. */
71 void loadContent(int index);
73 /** Decorate web page frame with navigation icons. */
74 void addNavigationBar();
76 /** Get temporary directory for extracting book contents. */
79 /** Go to a given (relative) position in current part. */
80 void goToPosition(qreal position);
85 /** Go to previous page. */
86 void goPreviousPage();
88 /** Go to next page. */
91 int contentIndex; /**< Current part in book. */
92 Book *mBook; /**< Book to show. */
93 bool restorePositionAfterLoad;
94 /**< If true, restoring position after load is needed. */
95 qreal positionAfterLoad;
96 /**< Position to be restored after load. */
98 /**< Bookmark icon pre-loaded. */
99 bool loaded; /**< True if content has been loaded. */
101 int contentsHeight; /**< Last know height of the frame. */
102 bool decorated; /**< True after adding the arrows to the frame contents. */
106 QAbstractKineticScroller *scroller;