okular
page.cpp
Go to the documentation of this file.
54 static void deleteObjectRects( QLinkedList< ObjectRect * >& rects, const QSet<ObjectRect::ObjectType>& which )
212 Q_ASSERT( bbox.left >= -epsilon && bbox.top >= -epsilon && bbox.right <= 1 + epsilon && bbox.bottom <= 1 + epsilon );
218 bool Page::hasPixmap( DocumentObserver *observer, int width, int height, const NormalizedRect &rect ) const
232 QMap< DocumentObserver*, PagePrivate::PixmapObject >::const_iterator it = d->m_pixmaps.constFind( observer );
287 QLinkedList< HighlightAreaRect * >::const_iterator it = m_highlights.begin(), end = m_highlights.end();
320 QString Page::text( const RegularAreaRect * area, TextPage::TextAreaInclusionBehaviour b ) const
340 TextEntity::List Page::words( const RegularAreaRect * area, TextPage::TextAreaInclusionBehaviour b ) const
360 ret[i] = new TextEntity( orig->text(), new Okular::NormalizedRect(orig->transformedArea ( d->rotationMatrix() )) );
375 if ( ( (int)m_orientation + (int)m_rotation ) % 2 != ( (int)m_orientation + (int)orientation ) % 2 )
390 RotationJob *job = new RotationJob( object.m_pixmap->toImage(), object.m_rotation, m_rotation, it.key() );
405 QLinkedList< ObjectRect * >::const_iterator objectIt = m_page->m_rects.begin(), end = m_page->m_rects.end();
409 QLinkedList< HighlightAreaRect* >::const_iterator hlIt = m_page->m_highlights.begin(), hlItEnd = m_page->m_highlights.end();
431 const ObjectRect * Page::objectRect( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale ) const
439 if ( ( objrect->objectType() == type ) && objrect->distanceSqr( x, y, xScale, yScale ) < distanceConsideredEqual )
446 QLinkedList< const ObjectRect * > Page::objectRects( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale ) const
455 if ( ( objrect->objectType() == type ) && objrect->distanceSqr( x, y, xScale, yScale ) < distanceConsideredEqual )
463 const ObjectRect* Page::nearestObjectRect( ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double * distance ) const
468 QLinkedList< ObjectRect * >::const_iterator it = m_rects.constBegin(), end = m_rects.constEnd();
528 QMap< DocumentObserver*, PagePrivate::PixmapObject >::iterator it = d->m_pixmaps.find( observer );
715 QLinkedList< FormField * >::const_iterator it = d->formfields.begin(), itEnd = d->formfields.end();
760 QLinkedList< HighlightAreaRect* >::iterator it = m_page->m_highlights.begin(), end = m_page->m_highlights.end();
790 QLinkedList< Annotation * >::const_iterator aIt = m_annotations.begin(), aEnd = m_annotations.end();
834 kWarning(OkularDebug).nospace() << "page (" << m_number << "): can't restore an annotation from XML.";
880 void PagePrivate::saveLocalContents( QDomNode & parentNode, QDomDocument & document, PageItems what ) const
916 QLinkedList< Annotation * >::const_iterator aIt = m_page->m_annotations.constBegin(), aEnd = m_page->m_annotations.constEnd();
944 QLinkedList< FormField * >::const_iterator fIt = formfields.constBegin(), fItEnd = formfields.constEnd();
978 QMap< DocumentObserver*, PagePrivate::PixmapObject >::const_iterator itPixmap = d->m_pixmaps.constFind( observer );
985 QMap< DocumentObserver*, PagePrivate::PixmapObject >::const_iterator it = d->m_pixmaps.constBegin(), end = d->m_pixmaps.constEnd();
Definition: page_p.h:46
void setRotation(Rotation rotation)
Inform the new rotation of the page.
Definition: tilesmanager.cpp:157
NormalizedPoint is a helper class which stores the coordinates of a normalized point.
Definition: area.h:47
void setUniqueName(const QString &name)
Sets the unique name of the annotation.
Definition: annotations.cpp:551
void deleteHighlights(int id=-1)
Deletes all highlight objects for the observer with the given id.
Definition: page.cpp:757
TilesManager * tilesManager() const
Get/set the tiles manager for the tiled observer.
Definition: page.cpp:1014
PagePrivate(Page *page, uint n, double w, double h, Rotation o)
Definition: page.cpp:67
Definition: page_p.h:55
static QTransform rotationMatrix(Rotation from, Rotation to)
Definition: rotationjob.cpp:69
void performAddPageAnnotation(int page, Annotation *annotation)
Definition: document.cpp:1035
The TextPage class represents the text of a page by providing.
Definition: textpage.h:90
Rotation rotation() const
Returns the rotation of the page as defined by the user.
Definition: page.cpp:170
void correctTextOrder()
Make necessary modifications in the TextList to make the text order correct, so that textselection wo...
Definition: textpage.cpp:1867
RegularAreaRect * textArea(TextSelection *selection) const
Returns the rectangular area of the given selection.
Definition: page.cpp:257
This class describes the object rectangle for a source reference.
Definition: area.h:474
bool hasPixmap(DocumentObserver *observer, int width=-1, int height=-1, const NormalizedRect &rect=NormalizedRect()) const
Returns whether the page of size width x height has a pixmap in the region given by rect for the give...
Definition: page.cpp:218
void setHighlight(int id, RegularAreaRect *area, const QColor &color)
Sets the color and area of the highlight for the observer with the given id.
Definition: page.cpp:582
Rotation totalOrientation() const
Returns the total orientation which is the original orientation plus the user defined rotation...
Definition: page.cpp:175
const ObjectRect * nearestObjectRect(ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double *distance) const
Returns the object rect of the given type which is nearest to the point (x, y) at scale (xScale...
Definition: page.cpp:463
QColor textSelectionColor() const
Returns the color of the current text selection, or an invalid color if no text selection has been se...
Definition: page.cpp:636
void deletePixmap(DocumentObserver *observer)
Deletes the pixmap for the given observer.
Definition: page.cpp:722
void setFormFields(const QLinkedList< FormField * > &fields)
Sets fields as list of FormField of the page.
Definition: page.cpp:711
bool isBoundingBoxKnown() const
Returns whether the bounding box of the page has been computed.
Definition: page.cpp:200
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
Definition: area.h:860
ObjectType objectType() const
Returns the object type of the object rectangle.
Definition: area.cpp:346
TextEntity::List words(const RegularAreaRect *rect, TextPage::TextAreaInclusionBehaviour b) const
Returns the page text (or part of it) including the bounding rectangles.
Definition: page.cpp:340
void deleteSourceReferences()
Deletes all source reference objects of the page.
Definition: page.cpp:780
bool hasTextPage() const
Returns whether the page provides a text page (TextPage).
Definition: page.cpp:244
bool hasTilesManager() const
Returns whether pixmaps for the tiled observer are handled by a tile manager.
Definition: page.cpp:1001
This class describes the object rectangle for an annotation.
Definition: area.h:431
NormalizedRect transformedArea(const QTransform &matrix) const
Returns the transformed area of the text entity.
Definition: textpage.cpp:196
void addRotationJob(RotationJob *job)
Definition: pagecontroller.cpp:31
QDomDocument restoredLocalAnnotationList
Definition: page_p.h:140
const ObjectRect * objectRect(ObjectRect::ObjectType type, double x, double y, double xScale, double yScale) const
Returns the object rect of the given type which is at point (x, y) at scale (xScale, yScale).
Definition: page.cpp:431
bool hasObjectRect(double x, double y, double xScale, double yScale) const
Returns whether the page has an object rect which includes the point (x, y) at scale (xScale...
Definition: page.cpp:265
void restoreLocalContents(const QDomNode &pageNode)
Loads the local contents (e.g.
Definition: page.cpp:796
const Action * pageAction(PageAction action) const
Returns the Action object which is associated with the given page action or 0 if no page action is se...
Definition: page.cpp:497
QList< Tile > tilesAt(const NormalizedRect &rect, TileLeaf tileLeaf)
Returns a list of all tiles intersecting with rect.
Definition: tilesmanager.cpp:358
TextEntity::List words(const RegularAreaRect *rect, TextAreaInclusionBehaviour b) const
Text entity extraction function.
Definition: textpage.cpp:1906
void setObjectRects(const QLinkedList< ObjectRect * > &rects)
Sets the list of object rects of the page.
Definition: page.cpp:564
void setBoundingBox(const NormalizedRect &bbox)
Sets the bounding box of the page content in normalized [0,1] coordinates, in terms of the upright or...
Definition: page.cpp:205
QMap< DocumentObserver *, PixmapObject > m_pixmaps
Definition: page_p.h:119
NormalizedRect boundingBox() const
Returns the bounding box of the page content in normalized [0,1] coordinates, in terms of the upright...
Definition: page.cpp:195
QString text(const RegularAreaRect *rect=0) const
Returns the page text (or part of it).
Definition: page.cpp:315
RegularAreaRect * wordAt(const NormalizedPoint &p, QString *word=0) const
Returns the area and text of the word at the given point Note that ownership of the returned area bel...
Definition: page.cpp:249
static void storeAnnotation(const Annotation *annotation, QDomElement &element, QDomDocument &document)
Saves the annotation as a child of element taking care of saving all revisions if it has any...
Definition: annotations.cpp:128
void setPixmap(DocumentObserver *observer, QPixmap *pixmap, const NormalizedRect &rect=NormalizedRect())
Sets the region described by rect with pixmap for the given observer.
Definition: page.cpp:517
RegularAreaRect * findText(int id, const QString &text, SearchDirection direction, Qt::CaseSensitivity caseSensitivity, const RegularAreaRect *lastRect=0) const
Returns the bounding rect of the text which matches the following criteria or 0 if the search is not ...
Definition: page.cpp:304
bool removeAnnotation(Annotation *annotation)
Removes the annotation from the page.
Definition: page.cpp:661
static void deleteObjectRects(QLinkedList< ObjectRect * > &rects, const QSet< ObjectRect::ObjectType > &which)
Definition: page.cpp:54
void setDuration(double seconds)
Sets the duration of the page to seconds when displayed in presentation mode.
Definition: page.cpp:611
void setTextSelections(RegularAreaRect *areas, const QColor &color)
Sets the color and areas of text selections.
Definition: page.cpp:591
QLinkedList< Annotation * > annotations() const
Returns the list of annotations of the page.
Definition: page.cpp:492
void transform(const QTransform &matrix)
Transforms the regular area with the operations defined by matrix.
Definition: area.h:848
static NormalizedRect toRotatedRect(const NormalizedRect &rect, Rotation rotation)
Returns a rotated NormalizedRect given a rotation.
Definition: tilesmanager.cpp:606
void saveLocalContents(QDomNode &parentNode, QDomDocument &document, PageItems what=AllPageItems) const
Saves the local contents (e.g.
Definition: page.cpp:880
bool canRemovePageAnnotation(const Annotation *annotation) const
Tests if the annotation can be removed.
Definition: document.cpp:3003
QString text(const RegularAreaRect *rect=0) const
Text extraction function.
Definition: textpage.cpp:1059
void setSize(int width, int height)
Inform the new size of the page and mark all tiles to repaint.
Definition: tilesmanager.cpp:136
static Annotation * createAnnotation(const QDomElement &element)
Restore an annotation (with revisions if needed) from the dom element.
Definition: annotations.cpp:90
void changeSize(const PageSize &size)
Changes the size of the page to the given size.
Definition: page.cpp:416
RegularAreaRect * textArea(TextSelection *selection) const
Returns the rectangular area of the given selection.
Definition: textpage.cpp:319
QList< Tile > tilesAt(const NormalizedRect &rect) const
Returns a list of all tiles intersecting with rect.
Definition: page.cpp:1006
RegularAreaRect * wordAt(const NormalizedPoint &p, QString *word=0) const
Returns the area and text of the word at the given point Note that ownership of the returned area bel...
Definition: textpage.cpp:1943
double duration() const
Returns the duration in seconds of the page when displayed in presentation mode.
Definition: page.cpp:616
void imageRotationDone(RotationJob *job)
Definition: page.cpp:93
A character is included into text() result if any pixel of his bounding box is in the given area...
Definition: textpage.h:104
TextAreaInclusionBehaviour
Defines the behaviour of adding characters to text() result.
Definition: textpage.h:102
double distanceSqr(double x, double y, double xScale, double yScale) const
Returns the square of the distance between the object and the point x, y for the scaling factor xScal...
Definition: area.cpp:379
bool hasHighlights(int id=-1) const
Returns whether the page provides highlighting for the observer with the given id.
Definition: page.cpp:278
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:90
QLinkedList< const ObjectRect * > objectRects(ObjectRect::ObjectType type, double x, double y, double xScale, double yScale) const
Returns all object rects of the given type which are at point (x, y) at scale (xScale, yScale).
Definition: page.cpp:446
Base class for objects being notified when something changes.
Definition: observer.h:28
void setPixmap(const QPixmap *pixmap, const NormalizedRect &rect)
Sets the pixmap of the tiles covered by rect (which represents the location of pixmap on the page)...
Definition: tilesmanager.cpp:188
RegularAreaRect * findText(int id, const QString &text, SearchDirection direction, Qt::CaseSensitivity caseSensitivity, const RegularAreaRect *lastRect)
Returns the bounding rect of the text which matches the following criteria or 0 if the search is not ...
Definition: textpage.cpp:703
QString uniqueName() const
Returns the unique name of the annotation.
Definition: annotations.cpp:557
Definition: page_p.h:45
const PageTransition * transition() const
Returns the transition effect of the page or 0 if no transition effect is set (see hasTransition())...
Definition: page.cpp:487
Definition: rotationjob_p.h:26
QString label() const
Returns the label of the page, or a null string if not set.
Definition: page.cpp:626
Rotation orientation() const
Returns the orientation of the page as defined by the document.
Definition: page.cpp:165
void addAnnotation(Annotation *annotation)
Adds a new annotation to the page.
Definition: page.cpp:641
This class stores the coordinates of a highlighting area together with the id of the highlight owner ...
Definition: area.h:878
bool hasTransition() const
Returns whether the page provides a transition effect.
Definition: page.cpp:294
QLinkedList< FormField * > formFields() const
Returns the list of FormField of the page.
Definition: page.cpp:512
bool hasPixmap(const NormalizedRect &rect)
Checks whether all tiles intersecting with rect are available.
Definition: tilesmanager.cpp:325
Definition: page_p.h:51
PageController * m_pageController
Definition: document_p.h:255
void setSourceReferences(const QLinkedList< SourceRefObjectRect * > &rects)
Sets the list of source reference objects rects.
Definition: page.cpp:604
DocumentObserver * m_tiledObserver
Definition: document_p.h:215
Information object for the transition effect of a page.
Definition: pagetransition.h:24
Wrapper around the information needed to generate the selection area There are two assumptions inside...
Definition: misc.h:36
void rotateAt(Rotation orientation)
Rotates the image and object rects of the page to the given orientation.
Definition: page.cpp:367
void setPageAction(PageAction action, Action *link)
Sets the link object for the given page action.
Definition: page.cpp:696
const RegularAreaRect * textSelection() const
Returns the current text selection.
Definition: page.cpp:631
Definition: page_p.h:113
Page(uint number, double width, double height, Rotation orientation)
Creates a new page.
Definition: page.cpp:143
void setTransition(PageTransition *transition)
Sets the page transition effect.
Definition: page.cpp:690
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.