okular
generator.cpp
Go to the documentation of this file.
103 request->page()->setPixmap( request->observer(), new QPixmap( QPixmap::fromImage( img ) ), request->normalizedRect() );
232 if ( hasFeature( TextExtraction ) && !request->page()->hasTextPage() && canGenerateTextPage() && !d->m_closing ) {
241 request->page()->setPixmap( request->observer(), new QPixmap( QPixmap::fromImage( img ) ), request->normalizedRect() );
420 const SourceReference * Generator::dynamicSourceReference( int /*pageNr*/, double /*absX*/, double /*absY*/)
425 PixmapRequest::PixmapRequest( DocumentObserver *observer, int pageNumber, int width, int height, int priority, PixmapRequestFeatures features )
515 ExportFormatPrivate( const QString &description, const KMimeType::Ptr &mimeType, const KIcon &icon = KIcon() )
538 ExportFormat::ExportFormat( const KIcon &icon, const QString &description, const KMimeType::Ptr &mimeType )
587 return ExportFormat( KIcon( "text-x-generic" ), i18n( "Plain &Text..." ), KMimeType::mimeType( "text/plain" ) );
590 return ExportFormat( KIcon( "application-pdf" ), i18n( "PDF" ), KMimeType::mimeType( "application/pdf" ) );
599 return ExportFormat( KIcon( "text-html" ), i18nc( "This is the document format", "HTML" ), KMimeType::mimeType( "text/html" ) );
TextPageGenerationThread * mTextPageGenerationThread
Definition: generator_p.h:60
void endGeneration()
void signalPixmapRequestDone(PixmapRequest *request)
This method must be called when the pixmap request triggered by generatePixmap() has been finished...
Definition: generator.cpp:350
ExportFormat & operator=(const ExportFormat &other)
Definition: generator.cpp:552
virtual bool exportTo(const QString &fileName, const ExportFormat &format)
This method is called to export the document in the given format and save it under the given fileName...
Definition: generator.cpp:339
virtual PageSize::List pageSizes() const
Returns the list of supported page sizes.
Definition: generator.cpp:309
virtual void generateTextPage(Page *page)
This method can be called to trigger the generation of a text page for the given page.
Definition: generator.cpp:257
NormalizedRect mNormalizedRect
Definition: generator_p.h:84
QMutex * userMutex() const
Return the pointer to a mutex the generator can use freely.
Definition: generator.cpp:398
QVariant documentMetaData(const QString &key, const QVariant &option=QVariant()) const
Request a meta data of the Document, if available, like an internal setting.
Definition: generator.cpp:389
Page * page() const
Returns a pointer to the page where the pixmap shall be generated for.
Definition: generator.cpp:479
The TextPage class represents the text of a page by providing.
Definition: textpage.h:90
PixmapGenerationThread * mPixmapGenerationThread
Definition: generator_p.h:59
virtual void rotationChanged(Rotation orientation, Rotation oldOrientation)
This method is called when the orientation has been changed by the user.
Definition: generator.cpp:305
virtual TextPage * textPage(Page *page)
Returns the text page for the given page.
Definition: generator.cpp:270
virtual const QList< EmbeddedFile * > * embeddedFiles() const
Returns the 'list of embedded files' object of the document or 0 if no list of embedded files is avai...
Definition: generator.cpp:290
virtual bool isAllowed(Permission action) const
This method returns whether given action (Permission) is allowed in this document.
Definition: generator.cpp:300
const NormalizedRect & normalizedRect() const
Returns the normalized region of the page to request.
Definition: generator.cpp:502
virtual bool canGeneratePixmap() const
This method returns whether the generator is ready to handle a new pixmap request.
Definition: generator.cpp:211
virtual PageSizeMetric pagesSizeMetric() const
This method returns the metric of the page size.
Definition: generator.cpp:295
void updatePageBoundingBox(int page, const NormalizedRect &boundingBox)
Set the bounding box of a page after the page has already been handed to the Document.
Definition: generator.cpp:408
bool isBoundingBoxKnown() const
Returns whether the bounding box of the page has been computed.
Definition: page.cpp:200
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
virtual QVariant metaData(const QString &key, const QVariant &option) const
This method returns the meta data of the given key with the given option of the document.
Definition: generator.cpp:328
void textpageGenerationFinished()
Definition: generator.cpp:111
virtual FontInfo::List fontsForPage(int page)
Definition: generator.cpp:285
Definition: generator_p.h:88
bool hasTextPage() const
Returns whether the page provides a text page (TextPage).
Definition: page.cpp:244
const SourceReference * dynamicSourceReference(int pageNr, double absX, double absY)
Asks the generator to dynamically generate a SourceReference for a given page number and absolute X a...
Definition: generator.cpp:420
Definition: generator.h:532
virtual QVariant metaData(const QString &key, const QVariant &option) const
Definition: generator.cpp:146
void setNormalizedRect(const NormalizedRect &rect)
Sets the region of the page to request.
Definition: generator.cpp:494
void requestFontData(const Okular::FontInfo &font, QByteArray *data)
Gets the font data for the given font.
Definition: generator.cpp:415
bool operator!=(const ExportFormat &other) const
Definition: generator.cpp:610
Definition: generator.h:201
void endGeneration()
static ExportFormat standardFormat(StandardExportFormat type)
Builds a standard format for the specified type .
Definition: generator.cpp:582
Generator(QObject *parent, const QVariantList &args)
Creates a new generator.
Definition: generator.cpp:157
virtual ExportFormat::List exportFormats() const
Returns the list of additional supported export formats.
Definition: generator.cpp:334
TextPage * textPage() const
void setFeature(GeneratorFeature feature, bool on=true)
Toggle the feature .
Definition: generator.cpp:380
DocumentObserver * observer() const
Returns the observer of the request.
Definition: generator.cpp:444
static NormalizedRect imageBoundingBox(const QImage *image)
Compute the smallest rectangle that contains all non-white pixels in image), in normalized [0...
Definition: utils.cpp:194
PixmapGenerationThread * pixmapGenerationThread()
Definition: generator.cpp:54
Okular::Generator::PrintError printError() const
Returns the last print error in case print() failed.
Definition: generator.cpp:323
Definition: generator_p.h:70
KIcon icon() const
Returns the icon for GUI representations of the format.
Definition: generator.cpp:572
void setPixmap(DocumentObserver *observer, QPixmap *pixmap, const NormalizedRect &rect=NormalizedRect())
Sets the region described by rect with pixmap for the given observer.
Definition: page.cpp:517
virtual const DocumentInfo * generateDocumentInfo()
Returns the general information object of the document or 0 if no information are available...
Definition: generator.cpp:275
QImage image() const
void pixmapGenerationFinished()
Definition: generator.cpp:82
QDebug operator<<(QDebug str, const Okular::PixmapRequest &req)
Definition: generator.cpp:615
bool asynchronous() const
Returns whether the generation should be done synchronous or asynchronous.
Definition: generator.cpp:469
bool hasFeature(GeneratorFeature feature) const
Query for the specified feature.
Definition: generator.cpp:344
bool preload() const
Returns whether the generation request is for a page that is not important i.e.
Definition: generator.cpp:474
A DOM tree containing information about the document.
Definition: document.h:1073
int priority() const
Returns the priority (less it better, 0 is maximum) of the request.
Definition: generator.cpp:464
bool calcBoundingBox() const
virtual bool print(QPrinter &printer)
This method is called to print the document to the given printer.
Definition: generator.cpp:318
void signalTextGenerationDone(Page *page, TextPage *textPage)
This method must be called when a text generation has been finished.
Definition: generator.cpp:361
PixmapRequest * request() const
virtual bool loadDocumentFromData(const QByteArray &fileData, QVector< Page * > &pagesVector)
Loads the document from the raw data fileData and fills the pagesVector with the parsed pages...
Definition: generator.cpp:176
The page size is not defined in a physical metric.
Definition: generator.h:310
virtual QImage image(PixmapRequest *page)
Returns the image of the page as specified in the passed pixmap request.
Definition: generator.cpp:264
virtual void pageSizeChanged(const PageSize &pageSize, const PageSize &oldPageSize)
This method is called when the page size has been changed by the user.
Definition: generator.cpp:314
Base class for objects being notified when something changes.
Definition: observer.h:28
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:217
bool isTile() const
Returns whether the generator should render just the region given by normalizedRect() or the entire p...
Definition: generator.cpp:489
PixmapRequest(DocumentObserver *observer, int pageNumber, int width, int height, int priority, PixmapRequestFeatures features)
Creates a new pixmap request.
Definition: generator.cpp:425
TextPageGenerationThread * textPageGenerationThread()
Definition: generator.cpp:68
Whether the Generator can extract text from the document in the form of TextPage's.
Definition: generator.h:202
virtual bool canGenerateTextPage() const
This method returns whether the generator is ready to handle a new text page request.
Definition: generator.cpp:251
bool operator==(const ExportFormat &other) const
Definition: generator.cpp:605
NormalizedRect boundingBox() const
virtual const DocumentSynopsis * generateDocumentSynopsis()
Returns the 'table of content' object of the document or 0 if no table of content is available...
Definition: generator.cpp:280
bool closeDocument()
This method is called when the document is closed and not used any longer.
Definition: generator.cpp:181
virtual bool doCloseDocument()=0
This method is called when the document is closed and not used any longer.
Page * page() const
Definition: generator_p.h:34
A DOM tree that describes the Table of Contents.
Definition: document.h:1154
void setTile(bool tile)
Sets whether the generator should render only the given normalized rect or the entire page...
Definition: generator.cpp:484
GeneratorFeature
Describe the possible optional features that a Generator can provide.
Definition: generator.h:199
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.