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);
42 /** Go to next part. */
45 /** Go to previous part. */
48 void onLoadFinished(bool ok);
49 void onSettingsChanged(const QString &key);
51 /** Add QObjects to the main frame. */
52 void addJavaScriptObjects();
54 /** Handle main frame contents size changes. */
55 void onContentsSizeChanged(const QSize &size);
57 /** Go to previous page. */
58 void goPreviousPage();
60 /** Go to next page. */
64 void paintEvent(QPaintEvent *e);
65 void mousePressEvent(QMouseEvent *e);
66 void wheelEvent(QWheelEvent *);
67 bool eventFilter(QObject *o, QEvent *e);
68 void leaveEvent(QEvent *e);
69 void enterEvent(QEvent *e);
70 void timerEvent(QTimerEvent *e);
71 void keyPressEvent(QKeyEvent *e);
74 /** Load given part. */
75 void loadContent(int index);
77 /** Decorate web page frame with navigation icons. */
78 void addNavigationBar();
80 /** Get temporary directory for extracting book contents. */
83 /** Go to a given (relative) position in current part. */
84 void goToPosition(qreal position);
89 int contentIndex; /**< Current part in book. */
90 Book *mBook; /**< Book to show. */
91 bool restorePositionAfterLoad;
92 /**< If true, restoring position after load is needed. */
93 qreal positionAfterLoad;
94 /**< Position to be restored after load. */
96 /**< Bookmark icon pre-loaded. */
97 bool loaded; /**< True if content has been loaded. */
99 int contentsHeight; /**< Last know height of the frame. */
100 bool decorated; /**< True after adding the arrows to the frame contents. */
104 QAbstractKineticScroller *scroller;