Okular::TextEntity
#include <textpage.h>
Public Types | |
typedef QList< TextEntity > | List |
Public Member Functions | |
TextEntity (const QString &text, const 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 52 of file textpage.h.
Member Typedef Documentation
◆ List
Definition at line 55 of file textpage.h.
Constructor & Destructor Documentation
◆ TextEntity()
TextEntity::TextEntity | ( | const QString & | text, |
const NormalizedRect & | area ) |
Creates a new text entity with the given text
and the given area
.
Definition at line 134 of file textpage.cpp.
◆ ~TextEntity()
|
default |
Destroys the text entity.
Member Function Documentation
◆ area()
NormalizedRect TextEntity::area | ( | ) | const |
Returns the bounding area of the text entity.
Definition at line 147 of file textpage.cpp.
◆ text()
QString TextEntity::text | ( | ) | const |
Returns the text of the text entity.
Definition at line 142 of file textpage.cpp.
◆ transformedArea()
NormalizedRect TextEntity::transformedArea | ( | const QTransform & | matrix | ) | const |
Returns the transformed area of the text entity.
Definition at line 152 of file textpage.cpp.
The documentation for this class was generated from the following files:
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.