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
170 const QVector<QRectF> rects = TextDocumentUtils::calculateBoundingRects(mDocument, linkPosition.startPosition, linkPosition.endPosition);
187QList<TextDocumentGeneratorPrivate::AnnotationInfo> TextDocumentGeneratorPrivate::generateAnnotationInfos() const
197 TextDocumentUtils::calculateBoundingRect(mDocument, annotationPosition.startPosition, annotationPosition.endPosition, info.boundingRect, info.page);
218 Okular::DocumentViewport viewport = TextDocumentUtils::calculateViewport(mDocument, position.block);
260 QObject::connect(mConverter, &TextDocumentConverter::addAction, q, [this](Action *a, int cb, int ce) { addAction(a, cb, ce); });
261 QObject::connect(mConverter, &TextDocumentConverter::addAnnotation, q, [this](Annotation *a, int cb, int ce) { addAnnotation(a, cb, ce); });
262 QObject::connect(mConverter, &TextDocumentConverter::addTitle, q, [this](int l, const QString &t, const QTextBlock &b) { addTitle(l, t, b); });
263 QObject::connect(mConverter, &TextDocumentConverter::addMetaData, q, [this](DocumentInfo::Key k, const QString &v) { addMetaData(k, v); });
270TextDocumentGenerator::TextDocumentGenerator(TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
283Document::OpenResult TextDocumentGenerator::loadDocumentWithPassword(const QString &fileName, QVector<Okular::Page *> &pagesVector, const QString &password)
293 for (const TextDocumentGeneratorPrivate::LinkPosition &linkPos : std::as_const(d->mLinkPositions)) {
297 for (const TextDocumentGeneratorPrivate::AnnotationPosition &annPos : std::as_const(d->mAnnotationPositions)) {
308 const QList<TextDocumentGeneratorPrivate::AnnotationInfo> annotationInfos = d->generateAnnotationInfos();
323 objects[info.page].append(new Okular::ObjectRect(rect.left(), rect.top(), rect.right(), rect.bottom(), false, Okular::ObjectRect::Action, info.link));
325 objects[info.page].append(new Okular::NonOwningObjectRect(rect.left(), rect.top(), rect.right(), rect.bottom(), false, Okular::ObjectRect::Action, info.link));
341 QList<Okular::Annotation *>::ConstIterator annIt = annots.at(i).begin(), annEnd = annots.at(i).end();
441Okular::DocumentInfo TextDocumentGenerator::generateDocumentInfo(const QSet<DocumentInfo::Key> & /*keys*/) const
457QVariant TextDocumentGeneratorPrivate::metaData(const QString &key, const QVariant &option) const
483bool TextDocumentGenerator::exportTo(const QString &fileName, const Okular::ExportFormat &format)
512 } else if (format.mimeType().name() == QLatin1String("application/vnd.oasis.opendocument.text")) {
Annotation struct holds properties shared by all annotations.
Definition annotations.h:99
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:770
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:269
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:203
@ PrintToFile
Whether the Generator supports export to PDF & PS through the Print Dialog.
Definition generator.h:210
@ TextExtraction
Whether the Generator can extract text from the document in the form of TextPage's.
Definition generator.h:204
@ PrintNative
Whether the Generator supports native cross-platform printing (QPainter-based).
Definition generator.h:208
virtual bool canGeneratePixmap() const
This method returns whether the generator is ready to handle a new pixmap request.
Definition generator.cpp:248
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:524
bool doCloseDocument() override
This method is called when the document is closed and not used any longer.
Definition textdocumentgenerator.cpp:350
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:447
TextDocumentGenerator(TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
Creates a new generator that uses the specified converter.
Definition textdocumentgenerator.cpp:270
TextDocumentSettings * generalSettings()
Config skeleton for TextDocumentSettingsWidget.
Definition textdocumentgenerator.cpp:543
Okular::TextPage * textPage(Okular::TextRequest *request) override
Returns the text page for the given request.
Definition textdocumentgenerator.cpp:423
Okular::DocumentInfo generateDocumentInfo(const QSet< DocumentInfo::Key > &keys) const override
Returns the general information object of the document.
Definition textdocumentgenerator.cpp:441
void addPages(KConfigDialog *dlg) override
Does nothing by default. You need to reimplement it in your generator.
Definition textdocumentgenerator.cpp:537
Okular::ExportFormat::List exportFormats() const override
Returns the list of additional supported export formats.
Definition textdocumentgenerator.cpp:466
bool canGeneratePixmap() const override
This method returns whether the generator is ready to handle a new pixmap request.
Definition textdocumentgenerator.cpp:366
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:371
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:483
Document::PrintError print(QPrinter &printer) override
This method is called to print the document to the given printer.
Definition textdocumentgenerator.cpp:429
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:283
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:566
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
ConstIterator
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)
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:47:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:47:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.