15 class QAbstractKineticScroller;
19 /** Visual representation of a book. */
20 class BookView: public QWebView
25 explicit BookView(QWidget *parent = 0);
27 void setBook(Book *book);
29 void goToBookmark(const Book::Bookmark &bookmark);
30 void addBookmark(const QString ¬e);
31 void setLastBookmark();
32 void restoreLastBookmark();
33 void goToPart(int part, const QString &fragment);
34 void goToFragment(const QString &fragment);
37 void partLoadStart(int index);
38 void partLoadEnd(int index);
40 /** Signal button press, when the real event has been suppressed. */
41 void suppressedMouseButtonPress();
43 /** Signal progress in reading the book. */
44 void progress(qreal p);
47 /** Go to next part. */
50 /** Go to previous part. */
53 void onLoadFinished(bool ok);
54 void onSettingsChanged(const QString &key);
56 /** Add QObjects to the main frame. */
57 void addJavaScriptObjects();
59 /** Handle main frame contents size changes. */
60 void onContentsSizeChanged(const QSize &size);
62 /** Go to previous page. */
63 void goPreviousPage();
65 /** Go to next page. */
69 void paintEvent(QPaintEvent *e);
70 void mousePressEvent(QMouseEvent *e);
71 void wheelEvent(QWheelEvent *);
72 bool eventFilter(QObject *o, QEvent *e);
74 void leaveEvent(QEvent *e);
75 void enterEvent(QEvent *e);
76 #endif // Q_WS_MAEMO_5
77 void timerEvent(QTimerEvent *e);
78 void keyPressEvent(QKeyEvent *e);
81 /** Load given part. */
82 void loadContent(int index);
84 /** Get temporary directory for extracting book contents. */
87 /** Go to a given (relative) position in current part. */
88 void goToPosition(qreal position);
90 /** Show reading progress. */
93 int contentIndex; /**< Current part in book. */
94 Book *mBook; /**< Book to show. */
95 bool restorePositionAfterLoad;
96 /**< If true, restore current position after load. */
97 qreal positionAfterLoad;
98 /**< Position to be restored after load. */
99 bool restoreFragmentAfterLoad;
100 /**< If true, restore fragment location after load. */
101 QString fragmentAfterLoad;
102 /**< Fragment location to be restored after load. */
103 QImage bookmarkImage;
104 /**< Bookmark icon pre-loaded. */
105 bool loaded; /**< True if content has been loaded. */
107 int contentsHeight; /**< Last know height of the frame. */
109 #if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
112 #if defined(Q_WS_MAEMO_5)
113 QAbstractKineticScroller *scroller;
114 #elif defined(Q_OS_SYMBIAN)