okular
pageitem.cpp
Go to the documentation of this file.
114 Observer *observer = m_isThumbnail ? m_documentItem.data()->thumbnailObserver() : m_documentItem.data()->pageviewObserver();
207 foreach(const KBookmark &bookmark, m_documentItem.data()->document()->bookmarkManager()->bookmarks(m_viewPort.pageNumber)) {
220 //normalizedX is a proportion, so contentX will be the difference between document and viewport times normalizedX
221 m_flickable.data()->setProperty("contentX", qMax((qreal)0, width() - m_flickable.data()->width()) * viewPort.rePos.normalizedX);
223 m_flickable.data()->setProperty("contentY", qMax((qreal)0, height() - m_flickable.data()->height()) * viewPort.rePos.normalizedY);
235 return QPointF(qMax((qreal)0, width() - m_flickable.data()->width()) * viewPort.rePos.normalizedX,
264 if (m_bookmarked && m_documentItem.data()->document()->bookmarkManager()->bookmarks(m_viewPort.pageNumber).count() == 0) {
296 void PageItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
309 Observer *observer = m_isThumbnail ? m_documentItem.data()->thumbnailObserver() : m_documentItem.data()->pageviewObserver();
314 requestedPixmaps.push_back(new Okular::PixmapRequest(observer, m_viewPort.pageNumber, width(), height(), priority, Okular::PixmapRequest::Asynchronous));
315 const Okular::Document::PixmapRequestFlag prf = m_isThumbnail ? Okular::Document::NoOption : Okular::Document::RemoveAllPrevious;
319 const int flags = PagePainter::Accessibility | PagePainter::Highlights | PagePainter::Annotations;
320 PagePainter::paintPageOnPainter(painter, m_page, observer, flags, width(), height(), option->exposedRect.toRect());
357 bool newBookmarked = m_documentItem.data()->document()->bookmarkManager()->isBookmarked(m_viewPort.pageNumber);
373 m_viewPort.rePos.normalizedX = m_flickable.data()->property("contentX").toReal() / (width() - m_flickable.data()->width());
382 m_viewPort.rePos.normalizedY = m_flickable.data()->property("contentY").toReal() / (height() - m_flickable.data()->height());
void setInterval(int msec)
Q_INVOKABLE void goToBookmark(const QString &bookmark)
loads a page bookmark and tries to ensure the bookmarked position is visible
Definition: pageitem.cpp:213
void bookmarkedChanged()
qreal x() const
qreal y() const
void pageNumberChanged()
Q_INVOKABLE void removeBookmark(const QString &bookmark)
Remove a bookmark at a given position, if any.
Definition: pageitem.cpp:272
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0
void setRenderHint(RenderHint hint, bool on)
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
Definition: pageitem.cpp:279
void setFlag(GraphicsItemFlag flag, bool enabled)
RenderHints renderHints() const
int implicitHeight() const
Q_INVOKABLE void removeBookmarkAtPos(qreal x, qreal y)
Remove a bookmark ar a given position of the current page (if present)
Definition: pageitem.cpp:255
BookmarkManager * bookmarkManager() const
Returns the bookmark manager of the document.
Definition: document.cpp:3511
QSizeF size() const
void save()
T * data() const
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
Definition: documentitem.h:37
void update(const QRectF &rect)
void flickableChanged()
void documentChanged()
bool isEmpty() const
QVariant property(const char *name) const
void push_back(const T &value)
int pageNumber() const
QDeclarativeItem * flickable() const
GraphicsItemFlags flags() const
void clear()
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
int pageNumber
The number of the page nearest the center of the viewport.
Definition: document.h:1048
void implicitHeightChanged()
struct Okular::DocumentViewport::@0 rePos
If 'rePos.enabled == true' then this structure contains the viewport center or top left depending on ...
Q_INVOKABLE QPointF bookmarkPosition(const QString &bookmark) const
Returns the position in the page for a bookmark QPointF(-1,-1) if doesn't belong to this page...
Definition: pageitem.cpp:227
Definition: documentitem.h:167
int implicitWidth() const
void restore()
DocumentItem * document() const
void start(int msec)
bool isValid() const
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Definition: pageitem.cpp:296
QStringList bookmarks() const
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Q_INVOKABLE void setBookmarkAtPos(qreal x, qreal y)
Add a new bookmark ar a given position of the current page.
Definition: pageitem.cpp:239
void bookmarksChanged()
bool smooth() const
Remove all the previous requests, even for non requested page pixmaps.
Definition: document.h:357
void setSingleShot(bool singleShot)
void implicitWidthChanged()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.