Okular::Page

Okular::Page Class Reference

#include <page.h>

Public Types

enum  PageAction { Opening, Closing }
 

Public Member Functions

 Page (uint pageNumber, double width, double height, Rotation orientation)
 
 ~Page ()
 
void addAnnotation (Annotation *annotation)
 
Annotationannotation (const QString &uniqueName) const
 
QLinkedList< Annotation * > annotations () const
 
NormalizedRect boundingBox () const
 
void deleteAnnotations ()
 
void deletePixmap (DocumentObserver *observer)
 
void deletePixmaps ()
 
void deleteRects ()
 
void deleteSourceReferences ()
 
double duration () const
 
RegularAreaRectfindText (int id, const QString &text, SearchDirection direction, Qt::CaseSensitivity caseSensitivity, const RegularAreaRect *lastRect=nullptr) const
 
QLinkedList< FormField * > formFields () const
 
bool hasAnnotations () const
 
bool hasHighlights (int id=-1) const
 
bool hasObjectRect (double x, double y, double xScale, double yScale) const
 
bool hasPixmap (DocumentObserver *observer, int width=-1, int height=-1, const NormalizedRect &rect=NormalizedRect()) const
 
bool hasTextPage () const
 
bool hasTilesManager (const DocumentObserver *observer) const
 
bool hasTransition () const
 
double height () const
 
bool isBoundingBoxKnown () const
 
QString label () const
 
const ObjectRectnearestObjectRect (ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double *distance) const
 
int number () const
 
const ObjectRectobjectRect (ObjectRect::ObjectType type, double x, double y, double xScale, double yScale) const
 
QLinkedList< const ObjectRect * > objectRects (ObjectRect::ObjectType type, double x, double y, double xScale, double yScale) const
 
Rotation orientation () const
 
const ActionpageAction (PageAction action) const
 
double ratio () const
 
bool removeAnnotation (Annotation *annotation)
 
Rotation rotation () const
 
void setBoundingBox (const NormalizedRect &bbox)
 
void setDuration (double seconds)
 
void setFormFields (const QLinkedList< FormField * > &fields)
 
void setLabel (const QString &label)
 
void setObjectRects (const QLinkedList< ObjectRect * > &rects)
 
void setPageAction (PageAction action, Action *link)
 
void setPixmap (DocumentObserver *observer, QPixmap *pixmap, const NormalizedRect &rect=NormalizedRect())
 
void setSourceReferences (const QLinkedList< SourceRefObjectRect * > &rects)
 
void setTextPage (TextPage *text)
 
void setTransition (PageTransition *transition)
 
QString text (const RegularAreaRect *area=nullptr) const
 
QString text (const RegularAreaRect *area, TextPage::TextAreaInclusionBehaviour b) const
 
RegularAreaRecttextArea (TextSelection *selection) const
 
const RegularAreaRecttextSelection () const
 
QColor textSelectionColor () const
 
QList< TiletilesAt (const DocumentObserver *observer, const NormalizedRect &rect) const
 
Rotation totalOrientation () const
 
const PageTransitiontransition () const
 
double width () const
 
RegularAreaRectwordAt (const NormalizedPoint &p, QString *word=nullptr) const
 
TextEntity::List words (const RegularAreaRect *area, TextPage::TextAreaInclusionBehaviour b) const
 

Detailed Description

Collector for all the data belonging to a page.

The Page class contains pixmaps (referenced using observers id as key), a search page (a class used internally for retrieving text), rect classes (that describe links or other active areas in the current page) and more.

All coordinates are normalized to the page, so {x,y} are valid in [0,1] range as long as NormalizedRect components.

Note: The class takes ownership of all objects.

Definition at line 52 of file page.h.

Member Enumeration Documentation

An action to be executed when particular events happen.

Enumerator
Opening 

An action to be executed when the page is "opened".

Closing 

An action to be executed when the page is "closed".

Definition at line 58 of file page.h.

Constructor & Destructor Documentation

Page::Page ( uint  pageNumber,
double  width,
double  height,
Rotation  orientation 
)

Creates a new page.

class Page

Parameters
pageNumberThe number of the page in the document.
widthThe width of the page.
heightThe height of the page.
orientationThe orientation of the page

Definition at line 140 of file page.cpp.

Page::~Page ( )

Destroys the page.

Definition at line 145 of file page.cpp.

Member Function Documentation

void Page::addAnnotation ( Annotation annotation)

Adds a new annotation to the page.

Definition at line 647 of file page.cpp.

Annotation * Page::annotation ( const QString uniqueName) const

Returns the annotation with the given unique name.

Since
1.3

Definition at line 492 of file page.cpp.

QLinkedList< Annotation * > Page::annotations ( ) const

Returns the list of annotations of the page.

Definition at line 487 of file page.cpp.

NormalizedRect Page::boundingBox ( ) const

Returns the bounding box of the page content in normalized [0,1] coordinates, in terms of the upright orientation (Rotation0).

If it has not been computed yet, returns the full page (i.e., (0, 0, 1, 1)). Note that the bounding box may be null if the page is blank.

Since
0.7 (KDE 4.1)

Definition at line 194 of file page.cpp.

void Page::deleteAnnotations ( )

Deletes all annotations of the page.

Definition at line 780 of file page.cpp.

void Page::deletePixmap ( DocumentObserver observer)

Deletes the pixmap for the given observer.

Definition at line 721 of file page.cpp.

void Page::deletePixmaps ( )

Deletes all pixmaps of the page.

Definition at line 733 of file page.cpp.

void Page::deleteRects ( )

Deletes all object rects of the page.

Definition at line 747 of file page.cpp.

void Page::deleteSourceReferences ( )

Deletes all source reference objects of the page.

Definition at line 775 of file page.cpp.

double Page::duration ( ) const

Returns the duration in seconds of the page when displayed in presentation mode.

A negative number means that no time is set.

Definition at line 622 of file page.cpp.

RegularAreaRect * Page::findText ( int  id,
const QString text,
SearchDirection  direction,
Qt::CaseSensitivity  caseSensitivity,
const RegularAreaRect lastRect = nullptr 
) const

Returns the bounding rect of the text which matches the following criteria or 0 if the search is not successful.

Parameters
idAn unique id for this search.
textThe search text.
directionThe direction of the search (SearchDirection)
caseSensitivityIf Qt::CaseSensitive, the search is case sensitive; otherwise the search is case insensitive.
lastRectIf 0 (default) the search starts at the beginning of the page, otherwise right/below the coordinates of the given rect.

Definition at line 308 of file page.cpp.

QLinkedList< FormField * > Page::formFields ( ) const

Returns the list of FormField of the page.

Definition at line 515 of file page.cpp.

bool Page::hasAnnotations ( ) const

Returns whether the page provides annotations.

Definition at line 303 of file page.cpp.

bool Page::hasHighlights ( int  id = -1) const

Returns whether the page provides highlighting for the observer with the given id.

Definition at line 282 of file page.cpp.

bool Page::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, yScale).

Definition at line 269 of file page.cpp.

bool Page::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 given observer If there is a partially rendered pixmap the answer is false.

Definition at line 217 of file page.cpp.

bool Page::hasTextPage ( ) const

Returns whether the page provides a text page (TextPage).

Definition at line 248 of file page.cpp.

bool Page::hasTilesManager ( const DocumentObserver observer) const

Returns whether pixmaps for the tiled observer are handled by a tile manager.

Since
0.19 (KDE 4.13)

Definition at line 977 of file page.cpp.

bool Page::hasTransition ( ) const

Returns whether the page provides a transition effect.

Definition at line 298 of file page.cpp.

double Page::height ( ) const

Returns the height of the page.

Definition at line 184 of file page.cpp.

bool Page::isBoundingBoxKnown ( ) const

Returns whether the bounding box of the page has been computed.

Note that even if the bounding box is computed, it may be null if the page is blank.

Since
0.7 (KDE 4.1)

Definition at line 199 of file page.cpp.

QString Page::label ( ) const

Returns the label of the page, or a null string if not set.

Definition at line 632 of file page.cpp.

const ObjectRect * Page::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, yScale).

Since
0.8.2 (KDE 4.2.2)

Definition at line 461 of file page.cpp.

int Page::number ( ) const

Returns the number of the page in the document.

Definition at line 159 of file page.cpp.

const ObjectRect * Page::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 at line 432 of file page.cpp.

QLinkedList< const ObjectRect * > Page::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).

Since
0.16 (KDE 4.10)

Definition at line 446 of file page.cpp.

Rotation Page::orientation ( ) const

Returns the orientation of the page as defined by the document.

Definition at line 164 of file page.cpp.

const Action * Page::pageAction ( PageAction  action) const

Returns the Action object which is associated with the given page action or 0 if no page action is set.

Definition at line 501 of file page.cpp.

double Page::ratio ( ) const

Returns the ration (height / width) of the page.

Definition at line 189 of file page.cpp.

bool Page::removeAnnotation ( Annotation annotation)

Removes the annotation from the page.

Definition at line 666 of file page.cpp.

Rotation Page::rotation ( ) const

Returns the rotation of the page as defined by the user.

Definition at line 169 of file page.cpp.

void Page::setBoundingBox ( const NormalizedRect bbox)

Sets the bounding box of the page content in normalized [0,1] coordinates, in terms of the upright orientation (Rotation0).

(This does not inform the document's observers, call Document::SetPageBoundingBox instead if you want that.)

Since
0.7 (KDE 4.1)

Definition at line 204 of file page.cpp.

void Page::setDuration ( double  seconds)

Sets the duration of the page to seconds when displayed in presentation mode.

Setting a negative number disables the duration.

Definition at line 617 of file page.cpp.

void Page::setFormFields ( const QLinkedList< FormField * > &  fields)

Sets fields as list of FormField of the page.

Definition at line 712 of file page.cpp.

void Page::setLabel ( const QString label)

Sets the labels for the page to label .

Definition at line 627 of file page.cpp.

void Page::setObjectRects ( const QLinkedList< ObjectRect * > &  rects)

Sets the list of object rects of the page.

Rotate the object rects of the page.

Definition at line 570 of file page.cpp.

void Page::setPageAction ( PageAction  action,
Action link 
)

Sets the link object for the given page action.

Definition at line 698 of file page.cpp.

void Page::setPixmap ( DocumentObserver observer,
QPixmap pixmap,
const NormalizedRect rect = NormalizedRect() 
)

Sets the region described by rect with pixmap for the given observer.

If rect is not set (default) the pixmap is set to the entire page.

Definition at line 520 of file page.cpp.

void Page::setSourceReferences ( const QLinkedList< SourceRefObjectRect * > &  rects)

Sets the list of source reference objects rects.

Definition at line 609 of file page.cpp.

void Page::setTextPage ( TextPage text)

Sets the text page.

Definition at line 558 of file page.cpp.

void Page::setTransition ( PageTransition transition)

Sets the page transition effect.

Definition at line 692 of file page.cpp.

QString Page::text ( const RegularAreaRect area = nullptr) const

Returns the page text (or part of it).

See also
TextPage::text()

Definition at line 318 of file page.cpp.

QString Page::text ( const RegularAreaRect area,
TextPage::TextAreaInclusionBehaviour  b 
) const

Returns the page text (or part of it).

See also
TextPage::text()
Since
0.10 (KDE 4.4)

Definition at line 323 of file page.cpp.

RegularAreaRect * Page::textArea ( TextSelection selection) const

Returns the rectangular area of the given selection.

Definition at line 261 of file page.cpp.

const RegularAreaRect * Page::textSelection ( ) const

Returns the current text selection.

Definition at line 637 of file page.cpp.

QColor Page::textSelectionColor ( ) const

Returns the color of the current text selection, or an invalid color if no text selection has been set.

Definition at line 642 of file page.cpp.

QList< Tile > Page::tilesAt ( const DocumentObserver observer,
const NormalizedRect rect 
) const

Returns a list of all tiles intersecting with rect.

The list contains only tiles with a pixmap

Since
0.19 (KDE 4.13)

Definition at line 982 of file page.cpp.

Rotation Page::totalOrientation ( ) const

Returns the total orientation which is the original orientation plus the user defined rotation.

Definition at line 174 of file page.cpp.

const PageTransition * Page::transition ( ) const

Returns the transition effect of the page or 0 if no transition effect is set (see hasTransition()).

Definition at line 482 of file page.cpp.

double Page::width ( ) const

Returns the width of the page.

Definition at line 179 of file page.cpp.

RegularAreaRect * Page::wordAt ( const NormalizedPoint p,
QString word = nullptr 
) const

Returns the area and text of the word at the given point Note that ownership of the returned area belongs to the caller.

See also
TextPage::wordAt()
Since
0.15 (KDE 4.9)

Definition at line 253 of file page.cpp.

TextEntity::List Page::words ( const RegularAreaRect area,
TextPage::TextAreaInclusionBehaviour  b 
) const

Returns the page text (or part of it) including the bounding rectangles.

Note that ownership of the contents of the returned list belongs to the caller.

See also
TextPage::words()
Since
0.14 (KDE 4.8)

Definition at line 341 of file page.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Nov 21 2020 22:36:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.