Okular::TextEntity
#include <textpage.h>
Public Types | |
typedef QList< TextEntity * > | List |
Public Member Functions | |
TextEntity (const QString &text, NormalizedRect *area) | |
~TextEntity () | |
NormalizedRect * | area () 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.
Definition at line 51 of file textpage.h.
Constructor & Destructor Documentation
◆ TextEntity()
TextEntity::TextEntity | ( | const QString & | text, |
NormalizedRect * | area | ||
) |
Creates a new text entity with the given text
and the given area
.
Definition at line 183 of file textpage.cpp.
◆ ~TextEntity()
TextEntity::~TextEntity | ( | ) |
Destroys the text entity.
Definition at line 190 of file textpage.cpp.
Member Function Documentation
◆ area()
NormalizedRect * TextEntity::area | ( | ) | const |
Returns the bounding area of the text entity.
Definition at line 200 of file textpage.cpp.
◆ text()
QString TextEntity::text | ( | ) | const |
Returns the text of the text entity.
Definition at line 195 of file textpage.cpp.
◆ transformedArea()
NormalizedRect TextEntity::transformedArea | ( | const QTransform & | matrix | ) | const |
Returns the transformed area of the text entity.
Definition at line 205 of file textpage.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 8 2023 03:56:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.