okular
#include <generator.h>
Signals | |
void | error (const QString &message, int duration) |
void | notice (const QString &message, int duration) |
void | warning (const QString &message, int duration) |
Public Member Functions | |
Generator (QObject *parent, const QVariantList &args) | |
virtual | ~Generator () |
virtual bool | canGeneratePixmap () const |
virtual bool | canGenerateTextPage () const |
bool | closeDocument () |
virtual const QList < EmbeddedFile * > * | embeddedFiles () const |
virtual ExportFormat::List | exportFormats () const |
virtual bool | exportTo (const QString &fileName, const ExportFormat &format) |
virtual FontInfo::List | fontsForPage (int page) |
virtual const DocumentInfo * | generateDocumentInfo () |
virtual const DocumentSynopsis * | generateDocumentSynopsis () |
virtual void | generatePixmap (PixmapRequest *request) |
virtual void | generateTextPage (Page *page) |
bool | hasFeature (GeneratorFeature feature) const |
virtual bool | isAllowed (Permission action) 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 Document::OpenResult | loadDocumentWithPassword (const QString &fileName, QVector< Page * > &pagesVector, const QString &password) |
virtual QVariant | metaData (const QString &key, const QVariant &option) const |
virtual void | pageSizeChanged (const PageSize &pageSize, const PageSize &oldPageSize) |
virtual PageSize::List | pageSizes () const |
virtual PageSizeMetric | pagesSizeMetric () const |
virtual bool | print (QPrinter &printer) |
virtual void | rotationChanged (Rotation orientation, Rotation oldOrientation) |
void | setDPI (const QSizeF &dpi) |
virtual void | walletDataForFile (const QString &fileName, QString *walletName, QString *walletFolder, QString *walletKey) const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Protected Slots | |
const SourceReference * | dynamicSourceReference (int pageNr, double absX, double absY) |
Okular::Generator::PrintError | printError () const |
void | requestFontData (const Okular::FontInfo &font, QByteArray *data) |
Protected Member Functions | |
virtual bool | doCloseDocument ()=0 |
const Document * | document () const |
QVariant | documentMetaData (const QString &key, const QVariant &option=QVariant()) const |
QSizeF | dpi () const |
virtual QImage | image (PixmapRequest *page) |
void | setFeature (GeneratorFeature feature, bool on=true) |
void | signalPixmapRequestDone (PixmapRequest *request) |
void | signalTextGenerationDone (Page *page, TextPage *textPage) |
virtual TextPage * | textPage (Page *page) |
void | updatePageBoundingBox (int page, const NormalizedRect &boundingBox) |
QMutex * | userMutex () const |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
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) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
[Abstract Class] The information generator.
Most of class members are virtuals and some of them pure virtual. The pure virtuals provide the minimal functionalities for a Generator, that is being able to generate QPixmap for the Page 's of the Document.
Implementing the other functions will make the Generator able to provide more contents and/or functionalities (like text extraction).
Generation/query is requested by the Document class only, and that class stores the resulting data into Page s. The data will then be displayed by the GUI components (PageView, ThumbnailList, etc..).
- See also
- PrintInterface, ConfigInterface, GuiInterface
Definition at line 186 of file generator.h.
Member Enumeration Documentation
Describe the possible optional features that a Generator can provide.
Enumerator | |
---|---|
Threaded | |
TextExtraction |
Whether the Generator can extract text from the document in the form of TextPage's. |
ReadRawData |
Whether the Generator can read a document directly from its raw data. |
FontInfo |
Whether the Generator can provide information about the fonts used in the document. |
PageSizes |
Whether the Generator can change the size of the document pages. |
PrintNative |
Whether the Generator supports native cross-platform printing (QPainter-based). |
PrintPostscript |
Whether the Generator supports postscript-based file printing. |
PrintToFile |
Whether the Generator supports export to PDF & PS through the Print Dialog. |
TiledRendering |
Whether the Generator can render tiles.
|
Definition at line 200 of file generator.h.
This enum identifies the metric of the page size.
Enumerator | |
---|---|
None |
The page size is not defined in a physical metric. |
Points |
The page size is given in 1/72 inches. |
Pixels |
The page size is given in screen pixels.
|
Definition at line 340 of file generator.h.
Possible print errors.
- Since
- 0.11 (KDE 4.5)
Definition at line 382 of file generator.h.
Constructor & Destructor Documentation
Generator::Generator | ( | QObject * | parent, |
const QVariantList & | args | ||
) |
Creates a new generator.
Definition at line 160 of file generator.cpp.
|
virtual |
Destroys the generator.
Definition at line 174 of file generator.cpp.
Member Function Documentation
|
virtual |
This method returns whether the generator is ready to handle a new pixmap request.
Reimplemented in Okular::TextDocumentGenerator.
Definition at line 229 of file generator.cpp.
|
virtual |
This method returns whether the generator is ready to handle a new text page request.
Definition at line 269 of file generator.cpp.
bool Generator::closeDocument | ( | ) |
This method is called when the document is closed and not used any longer.
- Returns
- true on success, false otherwise.
Definition at line 199 of file generator.cpp.
|
protectedpure virtual |
This method is called when the document is closed and not used any longer.
- Returns
- true on success, false otherwise.
Implemented in Okular::TextDocumentGenerator.
|
protected |
Returns a pointer to the document.
Definition at line 395 of file generator.cpp.
|
protected |
Request a meta data of the Document, if available, like an internal setting.
Definition at line 414 of file generator.cpp.
|
protected |
Returns DPI, previously set via setDPI()
- Since
- 0.19 (KDE 4.13)
Definition at line 456 of file generator.cpp.
|
protectedslot |
Asks the generator to dynamically generate a SourceReference for a given page number and absolute X and Y position on this page.
- Attention
- Ownership of the returned SourceReference is transferred to the caller.
- Since
- 0.10 (KDE 4.4)
Definition at line 445 of file generator.cpp.
|
virtual |
Returns the 'list of embedded files' object of the document or 0 if no list of embedded files is available.
Definition at line 308 of file generator.cpp.
|
signal |
This signal should be emitted whenever an error occurred in the generator.
- Parameters
-
message The message which should be shown to the user. duration The time that the message should be shown to the user.
|
virtual |
Returns the list of additional supported export formats.
Reimplemented in Okular::TextDocumentGenerator.
Definition at line 352 of file generator.cpp.
|
virtual |
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 in Okular::TextDocumentGenerator.
Definition at line 357 of file generator.cpp.
|
virtual |
Definition at line 303 of file generator.cpp.
|
virtual |
Returns the general information object of the document or 0 if no information are available.
Reimplemented in Okular::TextDocumentGenerator.
Definition at line 293 of file generator.cpp.
|
virtual |
Returns the 'table of content' object of the document or 0 if no table of content is available.
Reimplemented in Okular::TextDocumentGenerator.
Definition at line 298 of file generator.cpp.
|
virtual |
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 in Okular::TextDocumentGenerator.
Definition at line 235 of file generator.cpp.
|
virtual |
This method can be called to trigger the generation of a text page for the given page
.
The generation is done synchronous or asynchronous, depending on the type
parameter and the capabilities of the generator (e.g. multithreading).
- See also
- TextPage
Definition at line 275 of file generator.cpp.
bool Generator::hasFeature | ( | GeneratorFeature | feature | ) | const |
Query for the specified feature
.
Definition at line 369 of file generator.cpp.
|
protectedvirtual |
Returns the image of the page as specified in the passed pixmap request
.
- Warning
- this method may be executed in its own separated thread if the Threaded is enabled!
Definition at line 282 of file generator.cpp.
|
virtual |
This method returns whether given action
(Permission) is allowed in this document.
Definition at line 318 of file generator.cpp.
Loads the document with the given fileName
and fills the pagesVector
with the parsed pages.
- Note
- If you implement the WithPassword variants you don't need to implement this one
- Returns
- true on success, false otherwise.
Definition at line 179 of file generator.cpp.
|
virtual |
Loads the document from the raw data fileData
and fills the pagesVector
with the parsed pages.
- Note
- If you implement the WithPassword variants you don't need to implement this one
- the Generator has to have the feature ReadRawData enabled
- Returns
- true on success, false otherwise.
Definition at line 184 of file generator.cpp.
|
virtual |
Loads the document from the raw data fileData
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 loadDocumentFromData()
- the Generator has to have the feature ReadRawData enabled
- Since
- 0.20 (KDE 4.14)
- Returns
- a LoadResult defining the result of the operation
Definition at line 194 of file generator.cpp.
|
virtual |
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 in Okular::TextDocumentGenerator.
Definition at line 189 of file generator.cpp.
This method returns the meta data of the given key
with the given option
of the document.
Definition at line 346 of file generator.cpp.
|
signal |
This signal should be emitted whenever the user should be noticed.
- Parameters
-
message The message which should be shown to the user. duration The time that the message should be shown to the user.
This method is called when the page size has been changed by the user.
Definition at line 332 of file generator.cpp.
|
virtual |
Returns the list of supported page sizes.
Definition at line 327 of file generator.cpp.
|
virtual |
This method returns the metric of the page size.
Default is None.
Definition at line 313 of file generator.cpp.
|
virtual |
This method is called to print the document to the given printer
.
Reimplemented in Okular::TextDocumentGenerator.
Definition at line 336 of file generator.cpp.
|
protectedslot |
Returns the last print error in case print() failed.
- Since
- 0.11 (KDE 4.5)
Definition at line 341 of file generator.cpp.
|
protectedslot |
Gets the font data for the given font.
- Since
- 0.8 (KDE 4.1)
Definition at line 440 of file generator.cpp.
This method is called when the orientation has been changed by the user.
Definition at line 323 of file generator.cpp.
void Generator::setDPI | ( | const QSizeF & | dpi | ) |
|
protected |
Toggle the feature
.
Definition at line 405 of file generator.cpp.
|
protected |
This method must be called when the pixmap request triggered by generatePixmap() has been finished.
Definition at line 375 of file generator.cpp.
This method must be called when a text generation has been finished.
Definition at line 386 of file generator.cpp.
Returns the text page for the given page
.
- Warning
- this method may be executed in its own separated thread if the Threaded is enabled!
Reimplemented in Okular::TextDocumentGenerator.
Definition at line 288 of file generator.cpp.
|
protected |
Set the bounding box of a page after the page has already been handed to the Document.
Call this instead of Page::setBoundingBox() to ensure that all observers are notified.
- Since
- 0.7 (KDE 4.1)
Definition at line 433 of file generator.cpp.
|
protected |
Return the pointer to a mutex the generator can use freely.
Definition at line 423 of file generator.cpp.
|
virtual |
This method is called to know which wallet data should be used for the given file name.
Unless you have very special requirements to where wallet data should be stored you don't need to reimplement this method.
Definition at line 362 of file generator.cpp.
|
signal |
This signal should be emitted whenever the user should be warned.
- Parameters
-
message The message which should be shown to the user. duration The time that the message should be shown to the user.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:19:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.