14 /** Visual representation of a book. */
15 class BookView: public QWebView
20 explicit BookView(QWidget *parent = 0);
22 void setBook(Book *book);
24 void goToBookmark(const Book::Bookmark &bookmark);
26 void setLastBookmark();
29 void chapterLoadStart(int index);
30 void chapterLoadEnd(int index);
32 /** Signal button press when the real event has been suppressed. */
33 void suppressedMouseButtonPress();
38 void onLoadFinished(bool ok);
39 void onSettingsChanged(const QString &key);
41 /** Add QObjects to the main frame. */
42 void addJavaScriptObjects();
44 /** Handle main frame contents size changes. */
45 void onContentsSizeChanged(const QSize &size);
48 virtual void paintEvent(QPaintEvent *e);
49 virtual void mousePressEvent(QMouseEvent *e);
50 bool eventFilter(QObject *o, QEvent *e);
53 /** Save navigation icons from resource to the file system. */
56 /** Remove extracted icons. */
59 /** Load given chapter. */
60 void loadContent(int index);
62 /** Decorate web page frame with navigation icons. */
63 void addNavigationBar();
65 /** Get temporary directory for extracting book contents. */
68 int contentIndex; /**< Current chapter in book. */
69 Book *mBook; /**< Book to show. */
70 bool restore; /**< Restoring position after load is needed. */
71 qreal positionAfterLoad;
72 /**< Position to be restored after load. */
74 /**< Bookmark icon pre-loaded. */
75 bool loaded; /**< True if content has been loaded. */
77 int contentsHeight; /**< Last know height of the frame. */
78 bool decorated; /**< True after adding the arrows to the frame contents. */