Okular::Page

Search for usage in LXR

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
 
QList< 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
 
QList< 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
 
const QList< ObjectRect * > & objectRects () const
 
QList< 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 QList< FormField * > &fields)
 
void setLabel (const QString &label)
 
void setObjectRects (const QList< ObjectRect * > &rects)
 
void setPageAction (PageAction action, Action *link)
 
void setPageSize (DocumentObserver *observer, int width, int height)
 
void setPixmap (DocumentObserver *observer, QPixmap *pixmap, const NormalizedRect &rect=NormalizedRect())
 
void setSourceReferences (const QList< SourceRefObjectRect * > &rects)
 
void setTextPage (TextPage *text)
 
void setTransition (PageTransition *transition)
 
QString text (const RegularAreaRect *area, TextPage::TextAreaInclusionBehaviour b) const
 
QString text (const RegularAreaRect *area=nullptr) const
 
std::unique_ptr< RegularAreaRecttextArea (const 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
 
std::unique_ptr< RegularAreaRectwordAt (const NormalizedPoint &p) 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 47 of file page.h.

Member Enumeration Documentation

◆ PageAction

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 53 of file page.h.

Constructor & Destructor Documentation

◆ Page()

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 141 of file page.cpp.

◆ ~Page()

Page::~Page ( )

Destroys the page.

Definition at line 146 of file page.cpp.

Member Function Documentation

◆ addAnnotation()

void Page::addAnnotation ( Annotation * annotation)

Adds a new annotation to the page.

Definition at line 676 of file page.cpp.

◆ annotation()

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

Returns the annotation with the given unique name.

Since
1.3

Definition at line 518 of file page.cpp.

◆ annotations()

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

Returns the list of annotations of the page.

Definition at line 513 of file page.cpp.

◆ boundingBox()

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 195 of file page.cpp.

◆ deleteAnnotations()

void Page::deleteAnnotations ( )

Deletes all annotations of the page.

Definition at line 813 of file page.cpp.

◆ deletePixmap()

void Page::deletePixmap ( DocumentObserver * observer)

Deletes the pixmap for the given observer.

Definition at line 753 of file page.cpp.

◆ deletePixmaps()

void Page::deletePixmaps ( )

Deletes all pixmaps of the page.

Definition at line 765 of file page.cpp.

◆ deleteRects()

void Page::deleteRects ( )

Deletes all object rects of the page.

Definition at line 779 of file page.cpp.

◆ deleteSourceReferences()

void Page::deleteSourceReferences ( )

Deletes all source reference objects of the page.

Definition at line 808 of file page.cpp.

◆ duration()

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 651 of file page.cpp.

◆ findText()

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 323 of file page.cpp.

◆ formFields()

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

Returns the list of FormField of the page.

Definition at line 542 of file page.cpp.

◆ hasAnnotations()

bool Page::hasAnnotations ( ) const

Returns whether the page provides annotations.

Definition at line 318 of file page.cpp.

◆ hasHighlights()

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

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

Definition at line 294 of file page.cpp.

◆ hasObjectRect()

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 279 of file page.cpp.

◆ hasPixmap()

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 219 of file page.cpp.

◆ hasTextPage()

bool Page::hasTextPage ( ) const

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

Definition at line 256 of file page.cpp.

◆ hasTilesManager()

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 1012 of file page.cpp.

◆ hasTransition()

bool Page::hasTransition ( ) const

Returns whether the page provides a transition effect.

Definition at line 313 of file page.cpp.

◆ height()

double Page::height ( ) const

Returns the height of the page.

Definition at line 185 of file page.cpp.

◆ isBoundingBoxKnown()

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 200 of file page.cpp.

◆ label()

QString Page::label ( ) const

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

Definition at line 661 of file page.cpp.

◆ nearestObjectRect()

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 487 of file page.cpp.

◆ number()

int Page::number ( ) const

Returns the number of the page in the document.

Definition at line 160 of file page.cpp.

◆ objectRect()

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 456 of file page.cpp.

◆ objectRects() [1/2]

const QList< ObjectRect * > & Page::objectRects ( ) const

Gets the list of object rects of the page.

Since
22.04

Definition at line 615 of file page.cpp.

◆ objectRects() [2/2]

QList< 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 471 of file page.cpp.

◆ orientation()

Rotation Page::orientation ( ) const

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

Definition at line 165 of file page.cpp.

◆ pageAction()

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 528 of file page.cpp.

◆ ratio()

double Page::ratio ( ) const

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

Definition at line 190 of file page.cpp.

◆ removeAnnotation()

bool Page::removeAnnotation ( Annotation * annotation)

Removes the annotation from the page.

Definition at line 695 of file page.cpp.

◆ rotation()

Rotation Page::rotation ( ) const

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

Definition at line 170 of file page.cpp.

◆ setBoundingBox()

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 205 of file page.cpp.

◆ setDuration()

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 646 of file page.cpp.

◆ setFormFields()

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

Sets fields as list of FormField of the page.

Definition at line 743 of file page.cpp.

◆ setLabel()

void Page::setLabel ( const QString & label)

Sets the labels for the page to label .

Definition at line 656 of file page.cpp.

◆ setObjectRects()

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

Sets the list of object rects of the page.

Rotate the object rects of the page.

Definition at line 597 of file page.cpp.

◆ setPageAction()

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

Sets the link object for the given page action.

Definition at line 729 of file page.cpp.

◆ setPageSize()

void Page::setPageSize ( DocumentObserver * observer,
int width,
int height )

Sets the size of the page (in screen pixels) if there is a TilesManager.

Definition at line 248 of file page.cpp.

◆ setPixmap()

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 547 of file page.cpp.

◆ setSourceReferences()

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

Sets the list of source reference objects rects.

Definition at line 638 of file page.cpp.

◆ setTextPage()

void Page::setTextPage ( TextPage * text)

Sets the text page.

Definition at line 585 of file page.cpp.

◆ setTransition()

void Page::setTransition ( PageTransition * transition)

Sets the page transition effect.

Definition at line 723 of file page.cpp.

◆ text() [1/2]

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 339 of file page.cpp.

◆ text() [2/2]

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

Returns the page text (or part of it).

See also
TextPage::text()

Definition at line 334 of file page.cpp.

◆ textArea()

std::unique_ptr< RegularAreaRect > Page::textArea ( const TextSelection & selection) const

Returns the rectangular area of the given selection.

Definition at line 270 of file page.cpp.

◆ textSelection()

const RegularAreaRect * Page::textSelection ( ) const

Returns the current text selection.

Definition at line 666 of file page.cpp.

◆ textSelectionColor()

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 671 of file page.cpp.

◆ tilesAt()

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 1017 of file page.cpp.

◆ totalOrientation()

Rotation Page::totalOrientation ( ) const

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

Definition at line 175 of file page.cpp.

◆ transition()

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 508 of file page.cpp.

◆ width()

double Page::width ( ) const

Returns the width of the page.

Definition at line 180 of file page.cpp.

◆ wordAt()

std::unique_ptr< RegularAreaRect > Page::wordAt ( const NormalizedPoint & p) 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 261 of file page.cpp.

◆ words()

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 359 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-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:33 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.