Okular
textdocumentgenerator.cpp
50 Document::OpenResult TextDocumentConverter::convertWithPassword(const QString &fileName, const QString &)
67 DocumentViewport TextDocumentConverter::calculateViewport(QTextDocument *document, const QTextBlock &block)
109 textPage->append(text, new Okular::NormalizedRect(rect.left(), rect.top(), rect.right(), rect.bottom()));
134 void TextDocumentGeneratorPrivate::addAnnotation(Annotation *annotation, int cursorBegin, int cursorEnd)
150 void TextDocumentGeneratorPrivate::addTitle(int level, const QString &title, const QTextBlock &block)
165 QList<TextDocumentGeneratorPrivate::LinkInfo> TextDocumentGeneratorPrivate::generateLinkInfos() const
172 const QVector<QRectF> rects = TextDocumentUtils::calculateBoundingRects(mDocument, linkPosition.startPosition, linkPosition.endPosition);
189 QList<TextDocumentGeneratorPrivate::AnnotationInfo> TextDocumentGeneratorPrivate::generateAnnotationInfos() const
199 TextDocumentUtils::calculateBoundingRect(mDocument, annotationPosition.startPosition, annotationPosition.endPosition, info.boundingRect, info.page);
220 Okular::DocumentViewport viewport = TextDocumentUtils::calculateViewport(mDocument, position.block);
262 QObject::connect(mConverter, &TextDocumentConverter::addAction, q, [this](Action *a, int cb, int ce) { addAction(a, cb, ce); });
263 QObject::connect(mConverter, &TextDocumentConverter::addAnnotation, q, [this](Annotation *a, int cb, int ce) { addAnnotation(a, cb, ce); });
264 QObject::connect(mConverter, &TextDocumentConverter::addTitle, q, [this](int l, const QString &t, const QTextBlock &b) { addTitle(l, t, b); });
265 QObject::connect(mConverter, &TextDocumentConverter::addMetaData, q, [this](DocumentInfo::Key k, const QString &v) { addMetaData(k, v); });
272 TextDocumentGenerator::TextDocumentGenerator(TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
285 Document::OpenResult TextDocumentGenerator::loadDocumentWithPassword(const QString &fileName, QVector<Okular::Page *> &pagesVector, const QString &password)
299 for (const TextDocumentGeneratorPrivate::AnnotationPosition &annPos : qAsConst(d->mAnnotationPositions)) {
310 const QList<TextDocumentGeneratorPrivate::AnnotationInfo> annotationInfos = d->generateAnnotationInfos();
325 objects[info.page].append(new Okular::ObjectRect(rect.left(), rect.top(), rect.right(), rect.bottom(), false, Okular::ObjectRect::Action, info.link));
327 objects[info.page].append(new Okular::NonOwningObjectRect(rect.left(), rect.top(), rect.right(), rect.bottom(), false, Okular::ObjectRect::Action, info.link));
343 QList<Okular::Annotation *>::ConstIterator annIt = annots.at(i).begin(), annEnd = annots.at(i).end();
443 Okular::DocumentInfo TextDocumentGenerator::generateDocumentInfo(const QSet<DocumentInfo::Key> & /*keys*/) const
459 QVariant TextDocumentGeneratorPrivate::metaData(const QString &key, const QVariant &option) const
485 bool TextDocumentGenerator::exportTo(const QString &fileName, const Okular::ExportFormat &format)
514 } else if (format.mimeType().name() == QLatin1String("application/vnd.oasis.opendocument.text")) {
void append(const T &value)
qreal left() const const
const Okular::DocumentSynopsis * generateDocumentSynopsis() override
Returns the 'table of content' object of the document or 0 if no table of content is available.
Definition: textdocumentgenerator.cpp:449
bool isEmpty() const const
void warning(const QString &message, int duration)
This signal should be emitted whenever the user should be warned.
void setObjectRects(const QList< ObjectRect * > &rects)
Sets the list of object rects of the page.
Definition: page.cpp:599
QList< QByteArray > supportedDocumentFormats()
@ Threaded
Whether the Generator supports asynchronous generation of pictures or text pages.
Definition: generator.h:202
Document::OpenResult loadDocumentWithPassword(const QString &fileName, QVector< Okular::Page * > &pagesVector, const QString &password) override
Loads the document with the given fileName and password and fills the pagesVector with the parsed pag...
Definition: textdocumentgenerator.cpp:285
void error(const QString &message, int duration)
This signal should be emitted whenever an error occurred in the generator.
Format_ARGB32
WriteOnly
Text
virtual bool open(QIODevice::OpenMode mode) override
Annotation struct holds properties shared by all annotations.
Definition: annotations.h:95
void generatePixmap(Okular::PixmapRequest *request) override
This method can be called to trigger the generation of a new pixmap as described by request.
Definition: textdocumentgenerator.cpp:373
qreal x() const const
qreal y() const const
void setClipRect(const QRectF &rectangle, Qt::ClipOperation operation)
void append(const T &value)
TextDocumentGenerator(TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
Creates a new generator that uses the specified converter.
Definition: textdocumentgenerator.cpp:272
Q_SCRIPTABLE Q_NOREPLY void start()
void notice(const QString &message, int duration)
This signal should be emitted whenever the user should be noticed.
QStringView level(QStringView ifopt)
void addPages(KConfigDialog *dlg) override
Does nothing by default. You need to reimplement it in your generator.
Definition: textdocumentgenerator.cpp:539
static ExportFormat standardFormat(StandardExportFormat type)
Builds a standard format for the specified type .
Definition: generator.cpp:756
int width() const const
bool doCloseDocument() override
This method is called when the document is closed and not used any longer.
Definition: textdocumentgenerator.cpp:352
virtual bool canGeneratePixmap() const
This method returns whether the generator is ready to handle a new pixmap request.
Definition: generator.cpp:245
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
@ PrintToFile
Whether the Generator supports export to PDF & PS through the Print Dialog.
Definition: generator.h:209
Page * page() const
Returns a pointer to the page where the pixmap shall be generated for.
Definition: generator.cpp:547
void setAttribute(const QString &name, const QString &value)
bool begin(QPaintDevice *device)
KeepAnchor
bool end()
T & top()
void addAnnotation(Annotation *annotation)
Adds a new annotation to the page.
Definition: page.cpp:681
int height() const const
void scale(qreal sx, qreal sy)
Okular::ExportFormat::List exportFormats() const override
Returns the list of additional supported export formats.
Definition: textdocumentgenerator.cpp:468
bool exportTo(const QString &fileName, const Okular::ExportFormat &format) override
This method is called to export the document in the given format and save it under the given fileName...
Definition: textdocumentgenerator.cpp:485
const T & at(int i) const const
Document::PrintError print(QPrinter &printer) override
This method is called to print the document to the given printer.
Definition: textdocumentgenerator.cpp:431
HighResolution
int length() const const
virtual void generatePixmap(PixmapRequest *request)
This method can be called to trigger the generation of a new pixmap as described by request.
Definition: generator.cpp:266
T pop()
bool write(const QTextDocument *document)
qreal bottom() const const
bool isEmpty() const const
name
@ TextExtraction
Whether the Generator can extract text from the document in the form of TextPage's.
Definition: generator.h:203
void resize(int size)
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition: area.h:188
void append(const QString &text, NormalizedRect *area)
Appends the given text with the given area as new TextEntity to the page.
Definition: textpage.cpp:246
Okular::DocumentInfo generateDocumentInfo(const QSet< DocumentInfo::Key > &keys) const override
Returns the general information object of the document.
Definition: textdocumentgenerator.cpp:443
This class is an object rect that doesn't own the given pointer, i.e.
Definition: area.h:631
T convert(const QVariant &value)
qreal top() const const
qreal right() const const
void setOutputFileName(const QString &fileName)
void push(const T &t)
QDomNode appendChild(const QDomNode &newChild)
TextDocumentSettings * generalSettings()
Config skeleton for TextDocumentSettingsWidget.
Definition: textdocumentgenerator.cpp:545
qreal width() const const
void setOutputFormat(QPrinter::OutputFormat format)
void translate(const QPointF &offset)
int count(const T &value) const const
PdfFormat
bool canGeneratePixmap() const override
This method returns whether the generator is ready to handle a new pixmap request.
Definition: textdocumentgenerator.cpp:368
bool reparseConfig() override
By default checks if the default font has changed or not.
Definition: textdocumentgenerator.cpp:526
Okular::TextPage * textPage(Okular::TextRequest *request) override
Returns the text page for the given request.
Definition: textdocumentgenerator.cpp:425
An area with normalized coordinates that contains a reference to an object.
Definition: area.h:457
The DocumentInfo structure can be filled in by generators to display metadata about the currently ope...
Definition: document.h:74
const QList< QKeySequence > & end()
white
Q_D(Todo)
@ PrintNative
Whether the Generator supports native cross-platform printing (QPainter-based).
Definition: generator.h:207
qreal height() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:04:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:04:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.