Okular::TextDocumentGenerator

Search for usage in LXR

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
 
Document::PrintError 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
 
virtual bool canSign () const
 
virtual CertificateStorecertificateStore () const
 
bool closeDocument ()
 
virtual const QList< EmbeddedFile * > * embeddedFiles () const
 
virtual FontInfo::List fontsForPage (int page)
 
virtual void freeOpaqueActionContents (const BackendOpaqueAction &action)
 
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 bool sign (const NewSignatureData &data, const QString &rFilename)
 
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)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 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
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, 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
 
QSizeF dpi () const
 
virtual QImage image (PixmapRequest *request)
 
virtual QByteArray requestFontData (const Okular::FontInfo &font)
 
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  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 *context, Functor functor, 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)
 
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, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (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 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 145 of file textdocumentgenerator.h.

Constructor & Destructor Documentation

◆ TextDocumentGenerator()

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 272 of file textdocumentgenerator.cpp.

◆ ~TextDocumentGenerator()

TextDocumentGenerator::~TextDocumentGenerator ( )
override

Definition at line 281 of file textdocumentgenerator.cpp.

Member Function Documentation

◆ addPages()

void TextDocumentGenerator::addPages ( KConfigDialog * dlg)
overridevirtual

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

Implements Okular::ConfigInterface.

Definition at line 539 of file textdocumentgenerator.cpp.

◆ canGeneratePixmap()

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 368 of file textdocumentgenerator.cpp.

◆ converter()

TextDocumentConverter * TextDocumentGenerator::converter ( )
protected

Definition at line 552 of file textdocumentgenerator.cpp.

◆ doCloseDocument()

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 352 of file textdocumentgenerator.cpp.

◆ exportFormats()

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

Returns the list of additional supported export formats.

Reimplemented from Okular::Generator.

Definition at line 468 of file textdocumentgenerator.cpp.

◆ exportTo()

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 485 of file textdocumentgenerator.cpp.

◆ generalSettings()

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 545 of file textdocumentgenerator.cpp.

◆ generateDocumentInfo()

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 443 of file textdocumentgenerator.cpp.

◆ generateDocumentSynopsis()

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 449 of file textdocumentgenerator.cpp.

◆ generatePixmap()

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 373 of file textdocumentgenerator.cpp.

◆ loadDocumentWithPassword()

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 285 of file textdocumentgenerator.cpp.

◆ print()

Document::PrintError TextDocumentGenerator::print ( QPrinter & printer)
overridevirtual

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

Reimplemented from Okular::Generator.

Definition at line 431 of file textdocumentgenerator.cpp.

◆ reparseConfig()

bool TextDocumentGenerator::reparseConfig ( )
overridevirtual

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

Implements Okular::ConfigInterface.

Definition at line 526 of file textdocumentgenerator.cpp.

◆ setTextDocument()

void TextDocumentGenerator::setTextDocument ( QTextDocument * textDocument)
protected

Definition at line 559 of file textdocumentgenerator.cpp.

◆ textPage()

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 425 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-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.