15 /** Visual representation of a book. */
16 class BookView: public QWebView
21 explicit BookView(QWidget *parent = 0);
23 void setBook(Book *book);
25 void goToBookmark(const Book::Bookmark &bookmark);
27 void setLastBookmark();
28 void restoreLastBookmark();
31 void partLoadStart(int index);
32 void partLoadEnd(int index);
34 /** Signal button press when the real event has been suppressed. */
35 void suppressedMouseButtonPress();
37 /** Signal progress in reading the book. */
38 void progress(qreal p);
43 void onLoadFinished(bool ok);
44 void onSettingsChanged(const QString &key);
46 /** Add QObjects to the main frame. */
47 void addJavaScriptObjects();
49 /** Handle main frame contents size changes. */
50 void onContentsSizeChanged(const QSize &size);
53 void paintEvent(QPaintEvent *e);
54 void mousePressEvent(QMouseEvent *e);
55 void mouseReleaseEvent(QMouseEvent *e);
56 void wheelEvent(QWheelEvent *);
57 bool eventFilter(QObject *o, QEvent *e);
58 void leaveEvent(QEvent *e);
59 void enterEvent(QEvent *e);
62 /** Save navigation icons from resource to the file system. */
65 /** Remove extracted icons. */
68 /** Load given part. */
69 void loadContent(int index);
71 /** Decorate web page frame with navigation icons. */
72 void addNavigationBar();
74 /** Get temporary directory for extracting book contents. */
77 /** Go to a given (relative) position in current part. */
78 void goToPosition(qreal position);
83 int contentIndex; /**< Current part in book. */
84 Book *mBook; /**< Book to show. */
85 bool restorePositionAfterLoad;
86 /**< If true, restoring position after load is needed. */
87 qreal positionAfterLoad;
88 /**< Position to be restored after load. */
90 /**< Bookmark icon pre-loaded. */
91 bool loaded; /**< True if content has been loaded. */
93 int contentsHeight; /**< Last know height of the frame. */
94 bool decorated; /**< True after adding the arrows to the frame contents. */