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();
27 void restoreLastBookmark();
30 void chapterLoadStart(int index);
31 void chapterLoadEnd(int index);
33 /** Signal button press when the real event has been suppressed. */
34 void suppressedMouseButtonPress();
39 void onLoadFinished(bool ok);
40 void onSettingsChanged(const QString &key);
42 /** Add QObjects to the main frame. */
43 void addJavaScriptObjects();
45 /** Handle main frame contents size changes. */
46 void onContentsSizeChanged(const QSize &size);
49 virtual void paintEvent(QPaintEvent *e);
50 virtual void mousePressEvent(QMouseEvent *e);
51 bool eventFilter(QObject *o, QEvent *e);
52 virtual void leaveEvent(QEvent *);
53 virtual void enterEvent(QEvent *);
56 /** Save navigation icons from resource to the file system. */
59 /** Remove extracted icons. */
62 /** Load given chapter. */
63 void loadContent(int index);
65 /** Decorate web page frame with navigation icons. */
66 void addNavigationBar();
68 /** Get temporary directory for extracting book contents. */
71 /** Go to a given (relative) position in current chapter. */
72 void goToPosition(qreal position);
74 int contentIndex; /**< Current chapter in book. */
75 Book *mBook; /**< Book to show. */
76 bool restorePositionAfterLoad;
77 /**< If true, restoring position after load is needed. */
78 qreal positionAfterLoad;
79 /**< Position to be restored after load. */
81 /**< Bookmark icon pre-loaded. */
82 bool loaded; /**< True if content has been loaded. */
84 int contentsHeight; /**< Last know height of the frame. */
85 bool decorated; /**< True after adding the arrows to the frame contents. */