• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • Okular
  • Page
Public Types | Public Member Functions | List of all members
Okular::Page Class Reference

#include <page.h>

Public Types

enum  PageAction { Opening, Closing }
 

Public Member Functions

 Page (uint number, double width, double height, Rotation orientation)
 
 ~Page ()
 
void addAnnotation (Annotation *annotation)
 
QLinkedList< Annotation * > annotations () const
 
NormalizedRect boundingBox () const
 
void deleteAnnotations ()
 
void deletePixmap (DocumentObserver *observer)
 
void deletePixmaps ()
 
void deleteRects ()
 
void deleteSourceReferences ()
 
double duration () const
 
RegularAreaRect * findText (int id, const QString &text, SearchDirection direction, Qt::CaseSensitivity caseSensitivity, const RegularAreaRect *lastRect=0) 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
 
bool hasTransition () const
 
double height () const
 
bool isBoundingBoxKnown () const
 
QString label () const
 
const ObjectRect * nearestObjectRect (ObjectRect::ObjectType type, double x, double y, double xScale, double yScale, double *distance) const
 
int number () const
 
const ObjectRect * objectRect (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 Action * pageAction (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 *rect=0) const
 
QString text (const RegularAreaRect *rect, TextPage::TextAreaInclusionBehaviour b) const
 
RegularAreaRect * textArea (TextSelection *selection) const
 
const RegularAreaRect * textSelection () const
 
QColor textSelectionColor () const
 
QList< Tile > tilesAt (const NormalizedRect &rect) const
 
Rotation totalOrientation () const
 
const PageTransition * transition () const
 
double width () const
 
RegularAreaRect * wordAt (const NormalizedPoint &p, QString *word=0) const
 
TextEntity::List words (const RegularAreaRect *rect, 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 49 of file page.h.

Member Enumeration Documentation

enum Okular::Page::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 55 of file page.h.

Constructor & Destructor Documentation

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

Creates a new page.

class Page

Parameters
numberThe 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 143 of file page.cpp.

Page::~Page ( )

Destroys the page.

Definition at line 148 of file page.cpp.

Member Function Documentation

void Page::addAnnotation ( Annotation *  annotation)

Adds a new annotation to the page.

Definition at line 641 of file page.cpp.

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

Returns the list of annotations of the page.

Definition at line 492 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 195 of file page.cpp.

void Page::deleteAnnotations ( )

Deletes all annotations of the page.

Definition at line 785 of file page.cpp.

void Page::deletePixmap ( DocumentObserver *  observer)

Deletes the pixmap for the given observer.

Definition at line 722 of file page.cpp.

void Page::deletePixmaps ( )

Deletes all pixmaps of the page.

Definition at line 736 of file page.cpp.

void Page::deleteRects ( )

Deletes all object rects of the page.

Definition at line 749 of file page.cpp.

void Page::deleteSourceReferences ( )

Deletes all source reference objects of the page.

Definition at line 780 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 616 of file page.cpp.

RegularAreaRect * Page::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 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 304 of file page.cpp.

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

Returns the list of FormField of the page.

Definition at line 512 of file page.cpp.

bool Page::hasAnnotations ( ) const

Returns whether the page provides annotations.

Definition at line 299 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 278 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 265 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.

Definition at line 218 of file page.cpp.

bool Page::hasTextPage ( ) const

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

Definition at line 244 of file page.cpp.

bool Page::hasTilesManager ( ) const

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

Since
0.16 (KDE 4.10)

Definition at line 1001 of file page.cpp.

bool Page::hasTransition ( ) const

Returns whether the page provides a transition effect.

Definition at line 294 of file page.cpp.

double Page::height ( ) const

Returns the height of the page.

Definition at line 185 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 200 of file page.cpp.

QString Page::label ( ) const

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

Definition at line 626 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 463 of file page.cpp.

int Page::number ( ) const

Returns the number of the page in the document.

Definition at line 160 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 431 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 165 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 497 of file page.cpp.

double Page::ratio ( ) const

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

Definition at line 190 of file page.cpp.

bool Page::removeAnnotation ( Annotation *  annotation)

Removes the annotation from the page.

Definition at line 661 of file page.cpp.

Rotation Page::rotation ( ) const

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

Definition at line 170 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 205 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 611 of file page.cpp.

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

Sets fields as list of FormField of the page.

Definition at line 711 of file page.cpp.

void Page::setLabel ( const QString &  label)

Sets the labels for the page to label .

Definition at line 621 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 564 of file page.cpp.

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

Sets the link object for the given page action.

Definition at line 696 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 517 of file page.cpp.

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

Sets the list of source reference objects rects.

Definition at line 604 of file page.cpp.

void Page::setTextPage ( TextPage *  text)

Sets the text page.

Correct text order for before text selection

Definition at line 549 of file page.cpp.

void Page::setTransition ( PageTransition *  transition)

Sets the page transition effect.

Definition at line 690 of file page.cpp.

QString Page::text ( const RegularAreaRect *  rect = 0) const

Returns the page text (or part of it).

See also
TextPage::text()

Definition at line 315 of file page.cpp.

QString Page::text ( const RegularAreaRect *  rect,
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 320 of file page.cpp.

RegularAreaRect * Page::textArea ( TextSelection *  selection) const

Returns the rectangular area of the given selection.

Definition at line 257 of file page.cpp.

const RegularAreaRect * Page::textSelection ( ) const

Returns the current text selection.

Definition at line 631 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 636 of file page.cpp.

QList< Tile > Page::tilesAt ( const NormalizedRect &  rect) const

Returns a list of all tiles intersecting with rect.

The list contains only tiles with a pixmap

Since
0.16 (KDE 4.10)

Definition at line 1006 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 175 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 487 of file page.cpp.

double Page::width ( ) const

Returns the width of the page.

Definition at line 180 of file page.cpp.

RegularAreaRect * Page::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 belongs to the caller.

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

Definition at line 249 of file page.cpp.

TextEntity::List Page::words ( const RegularAreaRect *  rect,
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 340 of file page.cpp.


The documentation for this class was generated from the following files:
  • page.h
  • page.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal