15 class QAbstractKineticScroller;
18 /** Visual representation of a book. */
19 class BookView: public QWebView
24 explicit BookView(QWidget *parent = 0);
26 void setBook(Book *book);
28 void goToBookmark(const Book::Bookmark &bookmark);
29 void addBookmark(const QString ¬e);
30 void setLastBookmark();
31 void restoreLastBookmark();
32 void goToPart(int part, const QString &fragment);
33 void goToFragment(const QString &fragment);
36 void partLoadStart(int index);
37 void partLoadEnd(int index);
39 /** Signal button press, when the real event has been suppressed. */
40 void suppressedMouseButtonPress();
42 /** Signal progress in reading the book. */
43 void progress(qreal p);
46 /** Go to next part. */
49 /** Go to previous part. */
52 void onLoadFinished(bool ok);
53 void onSettingsChanged(const QString &key);
55 /** Add QObjects to the main frame. */
56 void addJavaScriptObjects();
58 /** Handle main frame contents size changes. */
59 void onContentsSizeChanged(const QSize &size);
61 /** Go to previous page. */
62 void goPreviousPage();
64 /** Go to next page. */
68 void paintEvent(QPaintEvent *e);
69 void mousePressEvent(QMouseEvent *e);
70 void wheelEvent(QWheelEvent *);
71 bool eventFilter(QObject *o, QEvent *e);
73 void leaveEvent(QEvent *e);
74 void enterEvent(QEvent *e);
75 #endif // Q_WS_MAEMO_5
76 void timerEvent(QTimerEvent *e);
77 void keyPressEvent(QKeyEvent *e);
80 /** Load given part. */
81 void loadContent(int index);
83 /** Get temporary directory for extracting book contents. */
86 /** Go to a given (relative) position in current part. */
87 void goToPosition(qreal position);
89 /** Show reading progress. */
92 int contentIndex; /**< Current part in book. */
93 Book *mBook; /**< Book to show. */
94 bool restorePositionAfterLoad;
95 /**< If true, restore current position after load. */
96 qreal positionAfterLoad;
97 /**< Position to be restored after load. */
98 bool restoreFragmentAfterLoad;
99 /**< If true, restore fragment location after load. */
100 QString fragmentAfterLoad;
101 /**< Fragment location to be restored after load. */
102 QImage bookmarkImage;
103 /**< Bookmark icon pre-loaded. */
104 bool loaded; /**< True if content has been loaded. */
106 int contentsHeight; /**< Last know height of the frame. */
108 #if defined(Q_WS_MAEMO_5)
110 QAbstractKineticScroller *scroller;