Okular::TextEntity

Okular::TextEntity Class Reference

#include <textpage.h>

Public Types

typedef QList< TextEntity * > List
 

Public Member Functions

 TextEntity (const QString &text, NormalizedRect *area)
 
 ~TextEntity ()
 
NormalizedRectarea () const
 
QString text () const
 
NormalizedRect transformedArea (const QTransform &matrix) const
 

Detailed Description

Represents a piece of text on a TextPage, containing its textual representation and its bounding box.

To enable searching and text selection, a generator can give information about the textual content of a Page using a TextPage. A TextPage is created using TextEntity objects. A TextEntity can represent a single character/glyph, a word, a line, or even the whole page.

Ideally, every single glyph is represented by its own TextEntity. If the textual representation of a graphical glyph contains more than one character, the TextEntity must contain the whole string which represents the glyph.

When the Generator has created the TextPage, and it is added to a Page, the text entities are reordered to words, lines, and paragraphs, to optimize search and text selection. This way, the Generator does not need to care about the logical order of lines or paragraphs.

Text Selection/Highlighting
A TextEntity is the smallest piece of text, which the user can select, or which can be highlighted. That is, if the TextEntity represents a word, only the whole word can be selected. It would not be possible to select a single glyph of the word, because its bounding box is not known.
See also
TextPage, Generator

Definition at line 54 of file textpage.h.

Constructor & Destructor Documentation

TextEntity::TextEntity ( const QString text,
NormalizedRect area 
)

Creates a new text entity with the given text and the given area.

Definition at line 184 of file textpage.cpp.

TextEntity::~TextEntity ( )

Destroys the text entity.

Definition at line 191 of file textpage.cpp.

Member Function Documentation

NormalizedRect * TextEntity::area ( ) const

Returns the bounding area of the text entity.

Definition at line 201 of file textpage.cpp.

QString TextEntity::text ( ) const

Returns the text of the text entity.

Definition at line 196 of file textpage.cpp.

NormalizedRect TextEntity::transformedArea ( const QTransform matrix) const

Returns the transformed area of the text entity.

Definition at line 206 of file textpage.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 Thu Nov 26 2020 22:34:57 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.