X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=bookview.cpp;h=cd6ba22b0f0102e24d81b01559601ebf4df16238;hb=539729f459b95168493510c024e4b581901618e3;hp=c665865fac62dd459f177eb3d706fd23b0e82c48;hpb=2041f8c2122b2c42a033196a103eaa736c4625eb;p=dorian diff --git a/bookview.cpp b/bookview.cpp index c665865..cd6ba22 100644 --- a/bookview.cpp +++ b/bookview.cpp @@ -5,8 +5,10 @@ #include #include -#ifdef Q_WS_MAEMO_5 +#if defined(Q_WS_MAEMO_5) # include +#elif defined(Q_OS_SYMBIAN) +# include "flickcharm.h" #endif #include "book.h" @@ -16,12 +18,6 @@ #include "trace.h" #include "progress.h" -#ifdef Q_WS_MAC -# define ICON_PREFIX ":/icons/mac/" -#else -# define ICON_PREFIX ":/icons/" -#endif - BookView::BookView(QWidget *parent): QWebView(parent), contentIndex(-1), mBook(0), restorePositionAfterLoad(false), positionAfterLoad(0), loaded(false), @@ -45,12 +41,12 @@ BookView::BookView(QWidget *parent): settings()->setDefaultTextEncoding("utf-8"); page()->setContentEditable(false); -#if defined(Q_WS_MAEMO_5) - // Suppress unwanted text selections on Maemo +#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) + // Suppress unwanted text selections on Maemo and Symbian installEventFilter(this); #endif QWebFrame *frame = page()->mainFrame(); -#if defined(Q_WS_MAEMO_5) +#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN) frame->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); #endif frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); @@ -78,9 +74,12 @@ BookView::BookView(QWidget *parent): s->setValue("scheme", s->value("scheme", "default")); setBook(0); -#ifdef Q_WS_MAEMO_5 +#if defined(Q_WS_MAEMO_5) scrollerMonitor = 0; scroller = property("kineticScroller").value(); +#elif defined(Q_OS_SYMBIAN) + FlickCharm *charm = new FlickCharm(this); + charm->activateOn(this); #endif } @@ -288,7 +287,7 @@ void BookView::wheelEvent(QWheelEvent *e) showProgress(); } -void BookView::addBookmark() +void BookView::addBookmark(const QString ¬e) { Trace t("BookView::addBookmark"); if (!mBook) { @@ -297,7 +296,7 @@ void BookView::addBookmark() int y = page()->mainFrame()->scrollPosition().y(); int height = page()->mainFrame()->contentsSize().height(); qDebug() << ((qreal)y / (qreal)height); - mBook->addBookmark(contentIndex, (qreal)y / (qreal)height); + mBook->addBookmark(contentIndex, (qreal)y / (qreal)height, note); update(); } @@ -406,9 +405,8 @@ void BookView::timerEvent(QTimerEvent *e) killTimer(scrollerMonitor); } } -#else - Q_UNUSED(e); -#endif // Q_WS_MAEMO_5 +#endif + QWebView::timerEvent(e); } void BookView::keyPressEvent(QKeyEvent* event)