Okular
textdocumentgenerator.cpp
50Document::OpenResult TextDocumentConverter::convertWithPassword(const QString &fileName, const QString &)
67DocumentViewport TextDocumentConverter::calculateViewport(QTextDocument *document, const QTextBlock &block)
109 textPage->append(text, Okular::NormalizedRect(rect.left(), rect.top(), rect.right(), rect.bottom()));
134void TextDocumentGeneratorPrivate::addAnnotation(Annotation *annotation, int cursorBegin, int cursorEnd)
150void TextDocumentGeneratorPrivate::addTitle(int level, const QString &title, const QTextBlock &block)
165QList<TextDocumentGeneratorPrivate::LinkInfo> TextDocumentGeneratorPrivate::generateLinkInfos() const
172 const QVector<QRectF> rects = TextDocumentUtils::calculateBoundingRects(mDocument, linkPosition.startPosition, linkPosition.endPosition);
189QList<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); });
272TextDocumentGenerator::TextDocumentGenerator(TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
285Document::OpenResult TextDocumentGenerator::loadDocumentWithPassword(const QString &fileName, QVector<Okular::Page *> &pagesVector, const QString &password)
295 for (const TextDocumentGeneratorPrivate::LinkPosition &linkPos : std::as_const(d->mLinkPositions)) {
299 for (const TextDocumentGeneratorPrivate::AnnotationPosition &annPos : std::as_const(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();
443Okular::DocumentInfo TextDocumentGenerator::generateDocumentInfo(const QSet<DocumentInfo::Key> & /*keys*/) const
459QVariant TextDocumentGeneratorPrivate::metaData(const QString &key, const QVariant &option) const
485bool TextDocumentGenerator::exportTo(const QString &fileName, const Okular::ExportFormat &format)
514 } else if (format.mimeType().name() == QLatin1String("application/vnd.oasis.opendocument.text")) {
Annotation struct holds properties shared by all annotations.
Definition annotations.h:96
The DocumentInfo structure can be filled in by generators to display metadata about the currently ope...
Definition document.h:76
static ExportFormat standardFormat(StandardExportFormat type)
Builds a standard format for the specified type .
Definition generator.cpp:753
void error(const QString &message, int duration)
This signal should be emitted whenever an error occurred in the generator.
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:268
void notice(const QString &message, int duration)
This signal should be emitted whenever the user should be noticed.
@ Threaded
Whether the Generator supports asynchronous generation of pictures or text pages.
Definition generator.h:202
@ PrintToFile
Whether the Generator supports export to PDF & PS through the Print Dialog.
Definition generator.h:209
@ TextExtraction
Whether the Generator can extract text from the document in the form of TextPage's.
Definition generator.h:203
@ PrintNative
Whether the Generator supports native cross-platform printing (QPainter-based).
Definition generator.h:207
virtual bool canGeneratePixmap() const
This method returns whether the generator is ready to handle a new pixmap request.
Definition generator.cpp:247
void warning(const QString &message, int duration)
This signal should be emitted whenever the user should be warned.
This class is an object rect that doesn't own the given pointer, i.e.
Definition area.h:632
A NormalizedRect is a rectangle which can be defined by two NormalizedPoints.
Definition area.h:189
An area with normalized coordinates that contains a reference to an object.
Definition area.h:458
void setObjectRects(const QList< ObjectRect * > &rects)
Sets the list of object rects of the page.
Definition page.cpp:597
bool reparseConfig() override
By default checks if the default font has changed or not.
Definition textdocumentgenerator.cpp:526
bool doCloseDocument() override
This method is called when the document is closed and not used any longer.
Definition textdocumentgenerator.cpp:352
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
TextDocumentGenerator(TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
Creates a new generator that uses the specified converter.
Definition textdocumentgenerator.cpp:272
TextDocumentSettings * generalSettings()
Config skeleton for TextDocumentSettingsWidget.
Definition textdocumentgenerator.cpp:545
Okular::TextPage * textPage(Okular::TextRequest *request) override
Returns the text page for the given request.
Definition textdocumentgenerator.cpp:425
Okular::DocumentInfo generateDocumentInfo(const QSet< DocumentInfo::Key > &keys) const override
Returns the general information object of the document.
Definition textdocumentgenerator.cpp:443
void addPages(KConfigDialog *dlg) override
Does nothing by default. You need to reimplement it in your generator.
Definition textdocumentgenerator.cpp:539
Okular::ExportFormat::List exportFormats() const override
Returns the list of additional supported export formats.
Definition textdocumentgenerator.cpp:468
bool canGeneratePixmap() const override
This method returns whether the generator is ready to handle a new pixmap request.
Definition textdocumentgenerator.cpp:368
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
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
Document::PrintError print(QPrinter &printer) override
This method is called to print the document to the given printer.
Definition textdocumentgenerator.cpp:431
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 append(const QString &text, const NormalizedRect &area)
Appends the given text with the given area as new TextEntity to the page.
Definition textpage.cpp:185
Page * page() const
Returns a pointer to the page where the pixmap shall be generated for.
Definition generator.cpp:549
Q_SCRIPTABLE Q_NOREPLY void start()
QStringView level(QStringView ifopt)
const QList< QKeySequence > & end()
void setAttribute(const QString &name, const QString &value)
QDomNode appendChild(const QDomNode &newChild)
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
Format_ARGB32
WriteOnly
void append(QList< T > &&value)
const_reference at(qsizetype i) const const
qsizetype count() const const
bool isEmpty() const const
void resize(qsizetype size)
name
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
bool begin(QPaintDevice *device)
bool end()
void scale(qreal sx, qreal sy)
void setClipRect(const QRect &rectangle, Qt::ClipOperation operation)
void translate(const QPoint &offset)
Text
PdfFormat
HighResolution
void setOutputFileName(const QString &fileName)
void setOutputFormat(OutputFormat format)
qreal bottom() const const
qreal height() const const
qreal left() const const
qreal right() const const
qreal top() const const
qreal width() const const
qreal x() const const
qreal y() const const
int height() const const
int width() const const
T pop()
void push(const T &t)
T & top()
qsizetype length() const const
white
KeepAnchor
QList< QByteArray > supportedDocumentFormats()
bool write(const QTextDocument *document)
T & get(QVariant &v)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:35 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:35 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.