Okular::TextDocumentGenerator

Okular::TextDocumentGenerator Class Reference

#include <textdocumentgenerator.h>

Inheritance diagram for Okular::TextDocumentGenerator:

Public Member Functions

 TextDocumentGenerator (TextDocumentConverter *converter, const QString &configName, QObject *parent, const QVariantList &args)
 
void addPages (KConfigDialog *dlg) override
 
bool canGeneratePixmap () const override
 
Okular::ExportFormat::List exportFormats () const override
 
bool exportTo (const QString &fileName, const Okular::ExportFormat &format) override
 
TextDocumentSettingsgeneralSettings ()
 
Okular::DocumentInfo generateDocumentInfo (const QSet< DocumentInfo::Key > &keys) const override
 
const Okular::DocumentSynopsisgenerateDocumentSynopsis () override
 
void generatePixmap (Okular::PixmapRequest *request) override
 
Document::OpenResult loadDocumentWithPassword (const QString &fileName, QVector< Okular::Page * > &pagesVector, const QString &password) override
 
bool print (QPrinter &printer) override
 
bool reparseConfig () override
 
- Public Member Functions inherited from Okular::Generator
 Generator (QObject *parent=nullptr, const QVariantList &args=QVariantList())
 
 ~Generator () override
 
virtual bool canGenerateTextPage () const
 
bool closeDocument ()
 
virtual const QList< EmbeddedFile * > * embeddedFiles () const
 
virtual FontInfo::List fontsForPage (int page)
 
void generateTextPage (Page *page)
 
bool hasFeature (GeneratorFeature feature) const
 
virtual bool isAllowed (Permission action) const
 
virtual QAbstractItemModellayersModel () const
 
virtual bool loadDocument (const QString &fileName, QVector< Page * > &pagesVector)
 
virtual bool loadDocumentFromData (const QByteArray &fileData, QVector< Page * > &pagesVector)
 
virtual Document::OpenResult loadDocumentFromDataWithPassword (const QByteArray &fileData, QVector< Page * > &pagesVector, const QString &password)
 
virtual QVariant metaData (const QString &key, const QVariant &option) const
 
virtual void opaqueAction (const BackendOpaqueAction *action)
 
virtual void pageSizeChanged (const PageSize &pageSize, const PageSize &oldPageSize)
 
virtual PageSize::List pageSizes () const
 
virtual PageSizeMetric pagesSizeMetric () const
 
virtual void rotationChanged (Rotation orientation, Rotation oldOrientation)
 
void setDPI (const QSizeF &dpi)
 
virtual SwapBackingFileResult swapBackingFile (const QString &newFileName, QVector< Okular::Page * > &newPagesVector)
 
virtual void walletDataForFile (const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 
- Public Member Functions inherited from Okular::ConfigInterface
 ConfigInterface (const ConfigInterface &)=delete
 
virtual ~ConfigInterface ()
 
ConfigInterfaceoperator= (const ConfigInterface &)=delete
 

Protected Member Functions

TextDocumentConverter * converter ()
 
bool doCloseDocument () override
 
void setTextDocument (QTextDocument *textDocument)
 
Okular::TextPagetextPage (Okular::TextRequest *request) override
 
- Protected Member Functions inherited from Okular::Generator
const Documentdocument () const
 
QVariant documentMetaData (const DocumentMetaDataKey key, const QVariant &option=QVariant()) const
 
OKULARCORE_DEPRECATED QVariant documentMetaData (const QString &key, const QVariant &option=QVariant()) const
 
QSizeF dpi () const
 
virtual QImage image (PixmapRequest *request)
 
Q_INVOKABLE Okular::Generator::PrintError printError () const
 
void setFeature (GeneratorFeature feature, bool on=true)
 
void signalPixmapRequestDone (PixmapRequest *request)
 
void signalTextGenerationDone (Page *page, TextPage *textPage)
 
void updatePageBoundingBox (int page, const NormalizedRect &boundingBox)
 
QMutexuserMutex () const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Types inherited from Okular::Generator
enum  GeneratorFeature {
  Threaded, TextExtraction, ReadRawData, FontInfo,
  PageSizes, PrintNative, PrintPostscript, PrintToFile,
  TiledRendering, SwapBackingFile, SupportsCancelling
}
 
enum  PageSizeMetric { None, Points, Pixels }
 
enum  PrintError {
  NoPrintError, UnknownPrintError, TemporaryFileOpenPrintError, FileConversionPrintError,
  PrintingProcessCrashPrintError, PrintingProcessStartPrintError, PrintToFilePrintError, InvalidPrinterStatePrintError,
  UnableToFindFilePrintError, NoFileToPrintError, NoBinaryToPrintError, InvalidPageSizePrintError
}
 
enum  SwapBackingFileResult { SwapBackingFileError, SwapBackingFileNoOp, SwapBackingFileReloadInternalData }
 
- Properties inherited from QObject
 objectName
 
- Signals inherited from Okular::Generator
void error (const QString &message, int duration)
 
void notice (const QString &message, int duration)
 
void warning (const QString &message, int duration)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Types inherited from Okular::Generator
enum  DocumentMetaDataKey { PaperColorMetaData, TextAntialiasMetaData, GraphicsAntialiasMetaData, TextHintingMetaData }
 
- Protected Slots inherited from Okular::Generator
void requestFontData (const Okular::FontInfo &font, QByteArray *data)
 
void signalPartialPixmapRequest (Okular::PixmapRequest *request, const QImage &image)
 

Detailed Description

QTextDocument-based Generator.

This generator provides a document in the form of a QTextDocument object, parsed using a specialized TextDocumentConverter.

Definition at line 154 of file textdocumentgenerator.h.

Constructor & Destructor Documentation

TextDocumentGenerator::TextDocumentGenerator ( TextDocumentConverter *  converter,
const QString configName,
QObject parent,
const QVariantList &  args 
)

Creates a new generator that uses the specified converter.

Parameters
converterThe text document converter.
configName- see Okular::TextDocumentSettings
parentThe parent object.
argsThe arguments.
Note
the generator will take ownership of the converter, so you don't have to delete it yourself
Since
0.17 (KDE 4.11)

Definition at line 287 of file textdocumentgenerator.cpp.

Member Function Documentation

void TextDocumentGenerator::addPages ( KConfigDialog dlg)
overridevirtual

Does nothing by default. You need to reimplement it in your generator.

Implements Okular::ConfigInterface.

Definition at line 553 of file textdocumentgenerator.cpp.

bool TextDocumentGenerator::canGeneratePixmap ( ) const
overridevirtual

This method returns whether the generator is ready to handle a new pixmap request.

Reimplemented from Okular::Generator.

Definition at line 387 of file textdocumentgenerator.cpp.

bool TextDocumentGenerator::doCloseDocument ( )
overrideprotectedvirtual

This method is called when the document is closed and not used any longer.

Returns
true on success, false otherwise.

Implements Okular::Generator.

Definition at line 371 of file textdocumentgenerator.cpp.

Okular::ExportFormat::List TextDocumentGenerator::exportFormats ( ) const
overridevirtual

Returns the list of additional supported export formats.

Reimplemented from Okular::Generator.

Definition at line 485 of file textdocumentgenerator.cpp.

bool TextDocumentGenerator::exportTo ( const QString fileName,
const Okular::ExportFormat format 
)
overridevirtual

This method is called to export the document in the given format and save it under the given fileName.

The format must be one of the supported export formats.

Reimplemented from Okular::Generator.

Definition at line 502 of file textdocumentgenerator.cpp.

TextDocumentSettings * TextDocumentGenerator::generalSettings ( )

Config skeleton for TextDocumentSettingsWidget.

You must use new construtor to initialize TextDocumentSettings, that contain configName .

Since
0.17 (KDE 4.11)

Definition at line 559 of file textdocumentgenerator.cpp.

Okular::DocumentInfo TextDocumentGenerator::generateDocumentInfo ( const QSet< DocumentInfo::Key > &  keys) const
overridevirtual

Returns the general information object of the document.

Changed signature in okular version 0.21

Reimplemented from Okular::Generator.

Definition at line 460 of file textdocumentgenerator.cpp.

const Okular::DocumentSynopsis * TextDocumentGenerator::generateDocumentSynopsis ( )
overridevirtual

Returns the 'table of content' object of the document or 0 if no table of content is available.

Reimplemented from Okular::Generator.

Definition at line 466 of file textdocumentgenerator.cpp.

void TextDocumentGenerator::generatePixmap ( Okular::PixmapRequest request)
overridevirtual

This method can be called to trigger the generation of a new pixmap as described by request.

We create the text page for every page that is visible to the user, so he can use the text extraction tools without a delay.

Reimplemented from Okular::Generator.

Definition at line 392 of file textdocumentgenerator.cpp.

Document::OpenResult TextDocumentGenerator::loadDocumentWithPassword ( const QString fileName,
QVector< Okular::Page * > &  pagesVector,
const QString password 
)
overridevirtual

Loads the document with the given fileName and password and fills the pagesVector with the parsed pages.

Note
Do not implement this if your format doesn't support passwords, it'll cleanly call loadDocument()
Since
0.20 (KDE 4.14)
Returns
a LoadResult defining the result of the operation

Reimplemented from Okular::Generator.

Definition at line 300 of file textdocumentgenerator.cpp.

bool TextDocumentGenerator::print ( QPrinter printer)
overridevirtual

This method is called to print the document to the given printer.

Reimplemented from Okular::Generator.

Definition at line 449 of file textdocumentgenerator.cpp.

bool TextDocumentGenerator::reparseConfig ( )
overridevirtual

By default checks if the default font has changed or not.

Implements Okular::ConfigInterface.

Definition at line 540 of file textdocumentgenerator.cpp.

Okular::TextPage * TextDocumentGenerator::textPage ( Okular::TextRequest request)
overrideprotectedvirtual

Returns the text page for the given request.

Must return a null pointer if the request was cancelled and the generator supports cancelling

Warning
this method may be executed in its own separated thread if the Threaded is enabled!
Since
1.4

Reimplemented from Okular::Generator.

Definition at line 443 of file textdocumentgenerator.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Jun 5 2020 22:31:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.